diff --git a/header/fsw_misc.h b/header/fsw_misc.h --- a/header/fsw_misc.h +++ b/header/fsw_misc.h @@ -37,6 +37,9 @@ void send_dumb_hk( void ); void get_temperatures( unsigned char *temperatures ); void get_v_e1_e2_f3( unsigned char *spacecraft_potential ); void get_cpu_load( unsigned char *resource_statistics ); +void set_hk_lfr_sc_potential_flag( bool state ); +void set_hk_lfr_calib_enable( bool state ); + extern int sched_yield( void ); extern void rtems_cpu_usage_reset(); diff --git a/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -56,7 +56,6 @@ void setCalibrationReload( bool state); void setCalibrationEnable( bool state ); void setCalibrationInterleaved( bool state ); void setCalibration( bool state ); -void set_hk_lfr_calib_enable( bool state ); void configureCalibration( bool interleaved ); // void update_last_TC_exe( ccsdsTelecommandPacket_t *TC , unsigned char *time ); diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -526,5 +526,26 @@ void get_cpu_load( unsigned char *resour } +void set_hk_lfr_sc_potential_flag( bool state ) +{ + if (state == true) + { + housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | 0x40; // [0100 0000] + } + else + { + housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] & 0xbf; // [1011 1111] + } +} - +void set_hk_lfr_calib_enable( bool state ) +{ + if (state == true) + { + housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | 0x08; // [0000 1000] + } + else + { + housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] & 0xf7; // [1111 0111] + } +} diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -996,18 +996,6 @@ void setCalibration( bool state ) } } -void set_hk_lfr_calib_enable( bool state ) -{ - if (state == true) - { - housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | 0x08; // [0000 1000] - } - else - { - housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] & 0xf7; // [1111 0111] - } -} - void configureCalibration( bool interleaved ) { setCalibration( false ); @@ -1171,4 +1159,6 @@ void reset_lfr( void ) set_lfr_soft_reset( 1 ); set_lfr_soft_reset( 0 ); + + set_hk_lfr_sc_potential_flag( true ); }