@@ -1,2 +1,2 | |||||
1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters |
|
1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters | |
2 | 449d1ebc41af2e62571508883dab8043a33f16df header/lfr_common_headers |
|
2 | 1f3d7ce688e982a378d739596c8e3f8972f40b9d header/lfr_common_headers |
@@ -35,6 +35,7 void spacewire_read_statistics( void ); | |||||
35 | void spacewire_get_last_error( void ); |
|
35 | void spacewire_get_last_error( void ); | |
36 | void update_hk_lfr_last_er_fields(unsigned int rid, unsigned char code); |
|
36 | void update_hk_lfr_last_er_fields(unsigned int rid, unsigned char code); | |
37 | void update_hk_with_grspw_stats(void ); |
|
37 | void update_hk_with_grspw_stats(void ); | |
|
38 | void spacewire_update_hk_lfr_link_state( unsigned char *hk_lfr_status_word_0 ); | |||
38 | void increase_unsigned_char_counter( unsigned char *counter ); |
|
39 | void increase_unsigned_char_counter( unsigned char *counter ); | |
39 |
|
40 | |||
40 | void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header ); |
|
41 | void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header ); |
@@ -275,7 +275,7 rtems_task hous_task(rtems_task_argument | |||||
275 | status = rtems_rate_monotonic_cancel(HK_id); |
|
275 | status = rtems_rate_monotonic_cancel(HK_id); | |
276 | DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state) |
|
276 | DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state) | |
277 |
|
277 | |||
278 |
set_hk_lfr_reset_cause( |
|
278 | set_hk_lfr_reset_cause( UNKNOWN_CAUSE ); | |
279 |
|
279 | |||
280 | while(1){ // launch the rate monotonic task |
|
280 | while(1){ // launch the rate monotonic task | |
281 | status = rtems_rate_monotonic_period( HK_id, HK_PERIOD ); |
|
281 | status = rtems_rate_monotonic_period( HK_id, HK_PERIOD ); | |
@@ -295,6 +295,8 rtems_task hous_task(rtems_task_argument | |||||
295 | housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
295 | housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
296 | housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
296 | housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time); | |
297 |
|
297 | |||
|
298 | spacewire_update_hk_lfr_link_state( &housekeeping_packet.lfr_status_word[0] ); | |||
|
299 | ||||
298 | spacewire_read_statistics(); |
|
300 | spacewire_read_statistics(); | |
299 |
|
301 | |||
300 | update_hk_with_grspw_stats(); |
|
302 | update_hk_with_grspw_stats(); | |
@@ -679,8 +681,11 void set_hk_lfr_calib_enable( bool state | |||||
679 |
|
681 | |||
680 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ) |
|
682 | void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ) | |
681 | { |
|
683 | { | |
|
684 | housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] & 0xf8; // [1111 1000] | |||
|
685 | ||||
682 | housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] |
|
686 | housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | |
683 | | (lfr_reset_cause & 0x07 ); // [0000 0111] |
|
687 | | (lfr_reset_cause & 0x07 ); // [0000 0111] | |
|
688 | ||||
684 | } |
|
689 | } | |
685 |
|
690 | |||
686 | void hk_lfr_le_me_he_update() |
|
691 | void hk_lfr_le_me_he_update() |
@@ -800,6 +800,19 void update_hk_with_grspw_stats( void ) | |||||
800 | housekeeping_packet.hk_lfr_dpu_spw_rx_too_big = (unsigned char) grspw_stats.rx_truncated; |
|
800 | housekeeping_packet.hk_lfr_dpu_spw_rx_too_big = (unsigned char) grspw_stats.rx_truncated; | |
801 | } |
|
801 | } | |
802 |
|
802 | |||
|
803 | void spacewire_update_hk_lfr_link_state( unsigned char *hk_lfr_status_word_0 ) | |||
|
804 | { | |||
|
805 | unsigned int *statusRegisterPtr; | |||
|
806 | unsigned char linkState; | |||
|
807 | ||||
|
808 | statusRegisterPtr = (unsigned int *) (REGS_ADDR_GRSPW + APB_OFFSET_GRSPW_STATUS_REGISTER); | |||
|
809 | linkState = (unsigned char) ( ( (*statusRegisterPtr) >> 21) & 0x07); // [0000 0111] | |||
|
810 | ||||
|
811 | *hk_lfr_status_word_0 = *hk_lfr_status_word_0 & 0xf8; // [1111 1000] set link state to 0 | |||
|
812 | ||||
|
813 | *hk_lfr_status_word_0 = *hk_lfr_status_word_0 | linkState; // update hk_lfr_dpu_spw_link_state | |||
|
814 | } | |||
|
815 | ||||
803 | void increase_unsigned_char_counter( unsigned char *counter ) |
|
816 | void increase_unsigned_char_counter( unsigned char *counter ) | |
804 | { |
|
817 | { | |
805 | // update the number of valid timecodes that have been received |
|
818 | // update the number of valid timecodes that have been received |
General Comments 0
You need to be logged in to leave comments.
Login now