# HG changeset patch # User paul # Date 2015-06-04 08:30:26 # Node ID f4c6f6db73fca25dc1dbdab0271942e30cf1c5cd # Parent 2bc5b89e7f11fd6f4d174dead0d04031e5bfd999 Bug #354, hk_sy_lfr_calib_enabled is set in TM_LFR_HK packets diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro --- a/FSW-qt/fsw-qt.pro +++ b/FSW-qt/fsw-qt.pro @@ -12,7 +12,7 @@ SWVERSION=-1-0 DEFINES += SW_VERSION_N1=3 # major DEFINES += SW_VERSION_N2=0 # minor DEFINES += SW_VERSION_N3=0 # patch -DEFINES += SW_VERSION_N4=2 # internal +DEFINES += SW_VERSION_N4=3 # internal # #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage diff --git a/header/grlib_regs.h b/header/grlib_regs.h --- a/header/grlib_regs.h +++ b/header/grlib_regs.h @@ -57,7 +57,7 @@ typedef struct { volatile unsigned int calData; } time_management_regs_t; -// PDB >= 0.1.28 +// PDB >= 0.1.28, 0x80000f54 typedef struct{ int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] @@ -94,7 +94,7 @@ typedef struct{ volatile unsigned int f2_1_coarse_time; // 0x74 volatile unsigned int f2_1_fine_time; // 0x78 // - volatile unsigned int f3_0_coarse_time; // 0x7c + volatile unsigned int f3_0_coarse_time; // 0x7c => 0x7c + 0xf54 = 0xd0 volatile unsigned int f3_0_fine_time; // 0x80 volatile unsigned int f3_1_coarse_time; // 0x84 volatile unsigned int f3_1_fine_time; // 0x88 diff --git a/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -55,8 +55,8 @@ void setCalibrationData( void ); void setCalibrationReload( bool state); void setCalibrationEnable( bool state ); void setCalibrationInterleaved( bool state ); -void startCalibration( void ); -void stopCalibration( void ); +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/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -272,7 +272,7 @@ int action_enable_calibration(ccsdsTelec result = LFR_DEFAULT; - startCalibration(); + setCalibration( true ); result = LFR_SUCCESSFUL; @@ -292,7 +292,7 @@ int action_disable_calibration(ccsdsTele result = LFR_DEFAULT; - stopCalibration(); + setCalibration( false ); result = LFR_SUCCESSFUL; @@ -981,21 +981,37 @@ void setCalibrationInterleaved( bool sta } } -void startCalibration( void ) +void setCalibration( bool state ) { - setCalibrationEnable( true ); - setCalibrationReload( false ); + if (state == true) + { + setCalibrationEnable( true ); + setCalibrationReload( false ); + set_hk_lfr_calib_enable( true ); + } + else + { + setCalibrationEnable( false ); + setCalibrationReload( true ); + set_hk_lfr_calib_enable( false ); + } } -void stopCalibration( void ) +void set_hk_lfr_calib_enable( bool state ) { - setCalibrationEnable( false ); - setCalibrationReload( true ); + 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 ) { - stopCalibration(); + setCalibration( false ); if ( interleaved == true ) { setCalibrationInterleaved( true );