@@ -1,2 +1,2 | |||||
1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters |
|
1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters | |
2 |
|
|
2 | 7ee7da2ed42fbc9cd673ae7f3a865345cea0f83f header/lfr_common_headers |
@@ -175,12 +175,9 typedef struct{ | |||||
175 | // |
|
175 | // | |
176 | unsigned int buffer_length; // 0x8c = buffer length in burst 2688 / 16 = 168 |
|
176 | unsigned int buffer_length; // 0x8c = buffer length in burst 2688 / 16 = 168 | |
177 | // |
|
177 | // | |
178 |
volatile int |
|
178 | volatile int v; // 0x90 | |
179 |
volatile int |
|
179 | volatile int e1; // 0x94 | |
180 |
volatile int |
|
180 | volatile int e2; // 0x98 | |
181 | volatile int16_t e1; // 0x94 |
|
|||
182 | volatile int16_t e2_dummy; // 0x98 |
|
|||
183 | volatile int16_t e2; // 0x98 |
|
|||
184 | } waveform_picker_regs_0_1_18_t; |
|
181 | } waveform_picker_regs_0_1_18_t; | |
185 |
|
182 | |||
186 | //********************* |
|
183 | //********************* |
@@ -93,6 +93,8 unsigned int check_update_info_hk_tds_mo | |||||
93 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ); |
|
93 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ); | |
94 | void set_hk_lfr_sc_rw_f_flag( unsigned char wheel, unsigned char freq, float value ); |
|
94 | void set_hk_lfr_sc_rw_f_flag( unsigned char wheel, unsigned char freq, float value ); | |
95 | void set_hk_lfr_sc_rw_f_flags( void ); |
|
95 | void set_hk_lfr_sc_rw_f_flags( void ); | |
|
96 | int check_sy_lfr_rw_f( ccsdsTelecommandPacket_t *TC, int offset, int* pos, float* value ); | |||
|
97 | int check_all_sy_lfr_rw_f( ccsdsTelecommandPacket_t *TC, int *pos, float*value ); | |||
96 | void getReactionWheelsFrequencies( ccsdsTelecommandPacket_t *TC ); |
|
98 | void getReactionWheelsFrequencies( ccsdsTelecommandPacket_t *TC ); | |
97 | void setFBinMask(unsigned char *fbins_mask, float rw_f, unsigned char deltaFreq, float sy_lfr_rw_k ); |
|
99 | void setFBinMask(unsigned char *fbins_mask, float rw_f, unsigned char deltaFreq, float sy_lfr_rw_k ); | |
98 | void build_sy_lfr_rw_mask( unsigned int channel ); |
|
100 | void build_sy_lfr_rw_mask( unsigned int channel ); |
@@ -80,12 +80,12 unsigned char hk_lfr_q_p0_fifo_size_max | |||||
80 | unsigned char hk_lfr_q_p1_fifo_size_max = 0; |
|
80 | unsigned char hk_lfr_q_p1_fifo_size_max = 0; | |
81 | unsigned char hk_lfr_q_p2_fifo_size_max = 0; |
|
81 | unsigned char hk_lfr_q_p2_fifo_size_max = 0; | |
82 | // sequence counters are incremented by APID (PID + CAT) and destination ID |
|
82 | // sequence counters are incremented by APID (PID + CAT) and destination ID | |
83 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST = 0; |
|
83 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST __attribute__((aligned(0x4))) = 0; | |
84 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2 = 0; |
|
84 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2 __attribute__((aligned(0x4))) = 0; | |
85 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID] = {0}; |
|
85 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID] __attribute__((aligned(0x4))) = {0}; | |
86 | unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID] = {0}; |
|
86 | unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID] __attribute__((aligned(0x4))) = {0}; | |
87 | unsigned short sequenceCounterHK = {0}; |
|
87 | unsigned short sequenceCounterHK __attribute__((aligned(0x4))) = {0}; | |
88 | spw_stats grspw_stats = {0}; |
|
88 | spw_stats grspw_stats __attribute__((aligned(0x4))) = {0}; | |
89 |
|
89 | |||
90 | // TC_LFR_UPDATE_INFO |
|
90 | // TC_LFR_UPDATE_INFO | |
91 | rw_f_t rw_f; |
|
91 | rw_f_t rw_f; |
@@ -34,8 +34,8 | |||||
34 | #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT) |
|
34 | #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT) | |
35 | #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) |
|
35 | #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) | |
36 | #define CONFIGURE_MAXIMUM_DRIVERS 16 |
|
36 | #define CONFIGURE_MAXIMUM_DRIVERS 16 | |
37 |
#define CONFIGURE_MAXIMUM_PERIODS |
|
37 | #define CONFIGURE_MAXIMUM_PERIODS 6 // [hous] [load] [avgv] | |
38 |
#define CONFIGURE_MAXIMUM_TIMERS |
|
38 | #define CONFIGURE_MAXIMUM_TIMERS 6 // [spiq] [link] [spacewire_reset_link] | |
39 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5 |
|
39 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5 | |
40 | #ifdef PRINT_STACK_REPORT |
|
40 | #ifdef PRINT_STACK_REPORT | |
41 | #define CONFIGURE_STACK_CHECKER_ENABLED |
|
41 | #define CONFIGURE_STACK_CHECKER_ENABLED |
@@ -347,6 +347,24 rtems_task hous_task(rtems_task_argument | |||||
347 | return; |
|
347 | return; | |
348 | } |
|
348 | } | |
349 |
|
349 | |||
|
350 | int32_t getIntFromShort( int reg ) | |||
|
351 | { | |||
|
352 | int16_t ret_as_int16; | |||
|
353 | int32_t ret_as_int32; | |||
|
354 | char *regPtr; | |||
|
355 | char *ret_as_int16_ptr; | |||
|
356 | ||||
|
357 | regPtr = (char*) ® | |||
|
358 | ret_as_int16_ptr = (char*) &ret_as_int16; | |||
|
359 | ||||
|
360 | ret_as_int16_ptr[BYTE_0] = regPtr[BYTE_3]; | |||
|
361 | ret_as_int16_ptr[BYTE_1] = regPtr[BYTE_4]; | |||
|
362 | ||||
|
363 | ret_as_int32 = (int32_t) ret_as_int16; | |||
|
364 | ||||
|
365 | return ret_as_int32; | |||
|
366 | } | |||
|
367 | ||||
350 | rtems_task avgv_task(rtems_task_argument argument) |
|
368 | rtems_task avgv_task(rtems_task_argument argument) | |
351 | { |
|
369 | { | |
352 | #define MOVING_AVERAGE 16 |
|
370 | #define MOVING_AVERAGE 16 | |
@@ -401,9 +419,9 rtems_task avgv_task(rtems_task_argument | |||||
401 | else |
|
419 | else | |
402 | { |
|
420 | { | |
403 | // get new values |
|
421 | // get new values | |
404 |
newValue_v = ( |
|
422 | newValue_v = getIntFromShort( waveform_picker_regs->v ); | |
405 |
newValue_e1 = ( |
|
423 | newValue_e1 = getIntFromShort( waveform_picker_regs->e1 ); | |
406 |
newValue_e2 = ( |
|
424 | newValue_e2 = getIntFromShort( waveform_picker_regs->e2 ); | |
407 |
|
425 | |||
408 | // compute the moving average |
|
426 | // compute the moving average | |
409 | average_v = average_v + newValue_v - v[k]; |
|
427 | average_v = average_v + newValue_v - v[k]; |
@@ -764,6 +764,7 unsigned char acquisitionTimeIsValid( un | |||||
764 | + offsetInFineTime |
|
764 | + offsetInFineTime | |
765 | + shiftInFineTime |
|
765 | + shiftInFineTime | |
766 | - acquisitionDurations[channel]; |
|
766 | - acquisitionDurations[channel]; | |
|
767 | ||||
767 | acquisitionTimeRangeMax = |
|
768 | acquisitionTimeRangeMax = | |
768 | timecodeReference |
|
769 | timecodeReference | |
769 | + offsetInFineTime |
|
770 | + offsetInFineTime |
@@ -256,10 +256,16 int action_update_info(ccsdsTelecommandP | |||||
256 | */ |
|
256 | */ | |
257 |
|
257 | |||
258 | unsigned int val; |
|
258 | unsigned int val; | |
259 | int result; |
|
|||
260 | unsigned int status; |
|
259 | unsigned int status; | |
261 | unsigned char mode; |
|
260 | unsigned char mode; | |
262 | unsigned char * bytePosPtr; |
|
261 | unsigned char * bytePosPtr; | |
|
262 | int pos; | |||
|
263 | float value; | |||
|
264 | ||||
|
265 | pos = INIT_CHAR; | |||
|
266 | value = INIT_FLOAT; | |||
|
267 | ||||
|
268 | status = LFR_DEFAULT; | |||
263 |
|
269 | |||
264 | bytePosPtr = (unsigned char *) &TC->packetID; |
|
270 | bytePosPtr = (unsigned char *) &TC->packetID; | |
265 |
|
271 | |||
@@ -276,15 +282,14 int action_update_info(ccsdsTelecommandP | |||||
276 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & BITS_THR_MODE); |
|
282 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & BITS_THR_MODE); | |
277 | status = check_update_info_hk_thr_mode( mode ); |
|
283 | status = check_update_info_hk_thr_mode( mode ); | |
278 | } |
|
284 | } | |
279 |
if (status == LFR_SUCCESSFUL) |
|
285 | if (status == LFR_SUCCESSFUL) // check reaction wheels frequencies | |
280 | { |
|
286 | { | |
281 | val = (housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * CONST_256) |
|
287 | status = check_all_sy_lfr_rw_f(TC, &pos, &value); | |
282 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; |
|
|||
283 | val++; |
|
|||
284 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> SHIFT_1_BYTE); |
|
|||
285 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); |
|
|||
286 | } |
|
288 | } | |
287 |
|
289 | |||
|
290 | // if the parameters checking succeeds, udpate all parameters | |||
|
291 | if (status == LFR_SUCCESSFUL) | |||
|
292 | { | |||
288 | // pa_bia_status_info |
|
293 | // pa_bia_status_info | |
289 | // => pa_bia_mode_mux_set 3 bits |
|
294 | // => pa_bia_mode_mux_set 3 bits | |
290 | // => pa_bia_mode_hv_enabled 1 bit |
|
295 | // => pa_bia_mode_hv_enabled 1 bit | |
@@ -304,9 +309,18 int action_update_info(ccsdsTelecommandP | |||||
304 | // once the masks are built, they have to be merged with the fbins_mask |
|
309 | // once the masks are built, they have to be merged with the fbins_mask | |
305 | merge_fbins_masks(); |
|
310 | merge_fbins_masks(); | |
306 |
|
311 | |||
307 | result = status; |
|
312 | // increase the TC_LFR_UPDATE_INFO counter | |
|
313 | if (status == LFR_SUCCESSFUL) // if the parameter check is successful | |||
|
314 | { | |||
|
315 | val = (housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * CONST_256) | |||
|
316 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; | |||
|
317 | val++; | |||
|
318 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> SHIFT_1_BYTE); | |||
|
319 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); | |||
|
320 | } | |||
|
321 | } | |||
308 |
|
322 | |||
309 |
return |
|
323 | return status; | |
310 | } |
|
324 | } | |
311 |
|
325 | |||
312 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
326 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
@@ -791,6 +791,7 int set_sy_lfr_n_cwf_long_f3(ccsdsTeleco | |||||
791 |
|
791 | |||
792 | //********************** |
|
792 | //********************** | |
793 | // BURST MODE PARAMETERS |
|
793 | // BURST MODE PARAMETERS | |
|
794 | ||||
794 | int set_sy_lfr_b_bp_p0(ccsdsTelecommandPacket_t *TC) |
|
795 | int set_sy_lfr_b_bp_p0(ccsdsTelecommandPacket_t *TC) | |
795 | { |
|
796 | { | |
796 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P0). |
|
797 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P0). | |
@@ -829,6 +830,7 int set_sy_lfr_b_bp_p1( ccsdsTelecommand | |||||
829 |
|
830 | |||
830 | //********************* |
|
831 | //********************* | |
831 | // SBM1 MODE PARAMETERS |
|
832 | // SBM1 MODE PARAMETERS | |
|
833 | ||||
832 | int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC ) |
|
834 | int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC ) | |
833 | { |
|
835 | { | |
834 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P0). |
|
836 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P0). | |
@@ -867,6 +869,7 int set_sy_lfr_s1_bp_p1( ccsdsTelecomman | |||||
867 |
|
869 | |||
868 | //********************* |
|
870 | //********************* | |
869 | // SBM2 MODE PARAMETERS |
|
871 | // SBM2 MODE PARAMETERS | |
|
872 | ||||
870 | int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC ) |
|
873 | int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC ) | |
871 | { |
|
874 | { | |
872 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P0). |
|
875 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P0). | |
@@ -905,6 +908,7 int set_sy_lfr_s2_bp_p1( ccsdsTelecomman | |||||
905 |
|
908 | |||
906 | //******************* |
|
909 | //******************* | |
907 | // TC_LFR_UPDATE_INFO |
|
910 | // TC_LFR_UPDATE_INFO | |
|
911 | ||||
908 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ) |
|
912 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ) | |
909 | { |
|
913 | { | |
910 | unsigned int status; |
|
914 | unsigned int status; | |
@@ -1040,6 +1044,113 void set_hk_lfr_sc_rw_f_flags( void ) | |||||
1040 | set_hk_lfr_sc_rw_f_flag( WHEEL_4, FREQ_4, rw_f.cp_rpw_sc_rw4_f4 ); |
|
1044 | set_hk_lfr_sc_rw_f_flag( WHEEL_4, FREQ_4, rw_f.cp_rpw_sc_rw4_f4 ); | |
1041 | } |
|
1045 | } | |
1042 |
|
1046 | |||
|
1047 | int check_sy_lfr_rw_f( ccsdsTelecommandPacket_t *TC, int offset, int* pos, float* value ) | |||
|
1048 | { | |||
|
1049 | float rw_k; | |||
|
1050 | int ret; | |||
|
1051 | ||||
|
1052 | ret = LFR_SUCCESSFUL; | |||
|
1053 | rw_k = INIT_FLOAT; | |||
|
1054 | ||||
|
1055 | copyFloatByChar( (unsigned char*) &rw_k, (unsigned char*) &TC->packetID[ offset ] ); | |||
|
1056 | ||||
|
1057 | *pos = offset; | |||
|
1058 | *value = rw_k; | |||
|
1059 | ||||
|
1060 | if (rw_k < MIN_SY_LFR_RW_F) | |||
|
1061 | { | |||
|
1062 | ret = WRONG_APP_DATA; | |||
|
1063 | } | |||
|
1064 | ||||
|
1065 | return ret; | |||
|
1066 | } | |||
|
1067 | ||||
|
1068 | int check_all_sy_lfr_rw_f( ccsdsTelecommandPacket_t *TC, int *pos, float*value ) | |||
|
1069 | { | |||
|
1070 | int ret; | |||
|
1071 | ||||
|
1072 | ret = LFR_SUCCESSFUL; | |||
|
1073 | ||||
|
1074 | //**** | |||
|
1075 | //**** | |||
|
1076 | // RW1 | |||
|
1077 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F1, pos, value ); // F1 | |||
|
1078 | if (ret == LFR_SUCCESSFUL) // F2 | |||
|
1079 | { | |||
|
1080 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F2, pos, value ); | |||
|
1081 | } | |||
|
1082 | if (ret == LFR_SUCCESSFUL) // F3 | |||
|
1083 | { | |||
|
1084 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F3, pos, value ); | |||
|
1085 | } | |||
|
1086 | if (ret == LFR_SUCCESSFUL) // F4 | |||
|
1087 | { | |||
|
1088 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F4, pos, value ); | |||
|
1089 | } | |||
|
1090 | ||||
|
1091 | //**** | |||
|
1092 | //**** | |||
|
1093 | // RW2 | |||
|
1094 | if (ret == LFR_SUCCESSFUL) // F1 | |||
|
1095 | { | |||
|
1096 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F1, pos, value ); | |||
|
1097 | } | |||
|
1098 | if (ret == LFR_SUCCESSFUL) // F2 | |||
|
1099 | { | |||
|
1100 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F2, pos, value ); | |||
|
1101 | } | |||
|
1102 | if (ret == LFR_SUCCESSFUL) // F3 | |||
|
1103 | { | |||
|
1104 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F3, pos, value ); | |||
|
1105 | } | |||
|
1106 | if (ret == LFR_SUCCESSFUL) // F4 | |||
|
1107 | { | |||
|
1108 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F4, pos, value ); | |||
|
1109 | } | |||
|
1110 | ||||
|
1111 | //**** | |||
|
1112 | //**** | |||
|
1113 | // RW3 | |||
|
1114 | if (ret == LFR_SUCCESSFUL) // F1 | |||
|
1115 | { | |||
|
1116 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F1, pos, value ); | |||
|
1117 | } | |||
|
1118 | if (ret == LFR_SUCCESSFUL) // F2 | |||
|
1119 | { | |||
|
1120 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F2, pos, value ); | |||
|
1121 | } | |||
|
1122 | if (ret == LFR_SUCCESSFUL) // F3 | |||
|
1123 | { | |||
|
1124 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F3, pos, value ); | |||
|
1125 | } | |||
|
1126 | if (ret == LFR_SUCCESSFUL) // F4 | |||
|
1127 | { | |||
|
1128 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F4, pos, value ); | |||
|
1129 | } | |||
|
1130 | ||||
|
1131 | //**** | |||
|
1132 | //**** | |||
|
1133 | // RW4 | |||
|
1134 | if (ret == LFR_SUCCESSFUL) // F1 | |||
|
1135 | { | |||
|
1136 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F1, pos, value ); | |||
|
1137 | } | |||
|
1138 | if (ret == LFR_SUCCESSFUL) // F2 | |||
|
1139 | { | |||
|
1140 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F2, pos, value ); | |||
|
1141 | } | |||
|
1142 | if (ret == LFR_SUCCESSFUL) // F3 | |||
|
1143 | { | |||
|
1144 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F3, pos, value ); | |||
|
1145 | } | |||
|
1146 | if (ret == LFR_SUCCESSFUL) // F4 | |||
|
1147 | { | |||
|
1148 | ret = check_sy_lfr_rw_f( TC, BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F4, pos, value ); | |||
|
1149 | } | |||
|
1150 | ||||
|
1151 | return ret; | |||
|
1152 | } | |||
|
1153 | ||||
1043 | void getReactionWheelsFrequencies( ccsdsTelecommandPacket_t *TC ) |
|
1154 | void getReactionWheelsFrequencies( ccsdsTelecommandPacket_t *TC ) | |
1044 | { |
|
1155 | { | |
1045 | /** This function get the reaction wheels frequencies in the incoming TC_LFR_UPDATE_INFO and copy the values locally. |
|
1156 | /** This function get the reaction wheels frequencies in the incoming TC_LFR_UPDATE_INFO and copy the values locally. | |
@@ -1345,7 +1456,7 int check_sy_lfr_rw_k( ccsdsTelecommandP | |||||
1345 | *pos = offset; |
|
1456 | *pos = offset; | |
1346 | *value = rw_k; |
|
1457 | *value = rw_k; | |
1347 |
|
1458 | |||
1348 |
if (rw_k < MIN_SY_LFR_RW_ |
|
1459 | if (rw_k < MIN_SY_LFR_RW_F) | |
1349 | { |
|
1460 | { | |
1350 | ret = WRONG_APP_DATA; |
|
1461 | ret = WRONG_APP_DATA; | |
1351 | } |
|
1462 | } | |
@@ -1436,8 +1547,6 int check_all_sy_lfr_rw_k( ccsdsTelecomm | |||||
1436 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW4_K4, pos, value ); |
|
1547 | ret = check_sy_lfr_rw_k( TC, DATAFIELD_POS_SY_LFR_RW4_K4, pos, value ); | |
1437 | } |
|
1548 | } | |
1438 |
|
1549 | |||
1439 |
|
||||
1440 |
|
||||
1441 | return ret; |
|
1550 | return ret; | |
1442 | } |
|
1551 | } | |
1443 |
|
1552 | |||
@@ -1453,19 +1562,16 int check_sy_lfr_filter_parameters( ccsd | |||||
1453 | float sy_lfr_pas_filter_shift; |
|
1562 | float sy_lfr_pas_filter_shift; | |
1454 | float sy_lfr_sc_rw_delta_f; |
|
1563 | float sy_lfr_sc_rw_delta_f; | |
1455 | char *parPtr; |
|
1564 | char *parPtr; | |
1456 |
int |
|
1565 | int datafield_pos; | |
1457 |
float |
|
1566 | float rw_k; | |
1458 |
|
1567 | |||
1459 | flag = LFR_SUCCESSFUL; |
|
1568 | flag = LFR_SUCCESSFUL; | |
1460 | sy_lfr_pas_filter_tbad = INIT_FLOAT; |
|
1569 | sy_lfr_pas_filter_tbad = INIT_FLOAT; | |
1461 | sy_lfr_pas_filter_shift = INIT_FLOAT; |
|
1570 | sy_lfr_pas_filter_shift = INIT_FLOAT; | |
1462 | sy_lfr_sc_rw_delta_f = INIT_FLOAT; |
|
1571 | sy_lfr_sc_rw_delta_f = INIT_FLOAT; | |
1463 | parPtr = NULL; |
|
1572 | parPtr = NULL; | |
1464 |
datafield_pos = |
|
1573 | datafield_pos = INIT_INT; | |
1465 |
rw_k = |
|
1574 | rw_k = INIT_FLOAT; | |
1466 |
|
||||
1467 | *datafield_pos = LFR_DEFAULT_ALT; |
|
|||
1468 | *rw_k = INIT_FLOAT; |
|
|||
1469 |
|
1575 | |||
1470 | //*************** |
|
1576 | //*************** | |
1471 | // get parameters |
|
1577 | // get parameters | |
@@ -1502,12 +1608,15 int check_sy_lfr_filter_parameters( ccsd | |||||
1502 |
|
1608 | |||
1503 | //*********************** |
|
1609 | //*********************** | |
1504 | // sy_lfr_pas_filter_tbad |
|
1610 | // sy_lfr_pas_filter_tbad | |
|
1611 | if (flag == LFR_SUCCESSFUL) | |||
|
1612 | { | |||
1505 | if ( (sy_lfr_pas_filter_tbad < MIN_PAS_FILTER_TBAD) || (sy_lfr_pas_filter_tbad > MAX_PAS_FILTER_TBAD) ) |
|
1613 | if ( (sy_lfr_pas_filter_tbad < MIN_PAS_FILTER_TBAD) || (sy_lfr_pas_filter_tbad > MAX_PAS_FILTER_TBAD) ) | |
1506 | { |
|
1614 | { | |
1507 | parPtr = (char*) &sy_lfr_pas_filter_tbad; |
|
1615 | parPtr = (char*) &sy_lfr_pas_filter_tbad; | |
1508 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_PAS_FILTER_TBAD + DATAFIELD_OFFSET, parPtr[FLOAT_LSBYTE] ); |
|
1616 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_PAS_FILTER_TBAD + DATAFIELD_OFFSET, parPtr[FLOAT_LSBYTE] ); | |
1509 | flag = WRONG_APP_DATA; |
|
1617 | flag = WRONG_APP_DATA; | |
1510 | } |
|
1618 | } | |
|
1619 | } | |||
1511 |
|
1620 | |||
1512 | //************************* |
|
1621 | //************************* | |
1513 | // sy_lfr_pas_filter_offset |
|
1622 | // sy_lfr_pas_filter_offset | |
@@ -1549,6 +1658,7 int check_sy_lfr_filter_parameters( ccsd | |||||
1549 | { |
|
1658 | { | |
1550 | if ( sy_lfr_sc_rw_delta_f < MIN_SY_LFR_SC_RW_DELTA_F ) |
|
1659 | if ( sy_lfr_sc_rw_delta_f < MIN_SY_LFR_SC_RW_DELTA_F ) | |
1551 | { |
|
1660 | { | |
|
1661 | parPtr = (char*) &sy_lfr_pas_filter_shift; | |||
1552 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + DATAFIELD_OFFSET, sy_lfr_sc_rw_delta_f ); |
|
1662 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + DATAFIELD_OFFSET, sy_lfr_sc_rw_delta_f ); | |
1553 | flag = WRONG_APP_DATA; |
|
1663 | flag = WRONG_APP_DATA; | |
1554 | } |
|
1664 | } | |
@@ -1558,14 +1668,14 int check_sy_lfr_filter_parameters( ccsd | |||||
1558 | // sy_lfr_rw_k |
|
1668 | // sy_lfr_rw_k | |
1559 | if (flag == LFR_SUCCESSFUL) |
|
1669 | if (flag == LFR_SUCCESSFUL) | |
1560 | { |
|
1670 | { | |
1561 | flag = check_all_sy_lfr_rw_k( TC, datafield_pos, rw_k ); |
|
1671 | flag = check_all_sy_lfr_rw_k( TC, &datafield_pos, &rw_k ); | |
1562 | if (flag != LFR_SUCCESSFUL) |
|
1672 | if (flag != LFR_SUCCESSFUL) | |
1563 | { |
|
1673 | { | |
1564 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, *datafield_pos + DATAFIELD_OFFSET, *rw_k ); |
|
1674 | parPtr = (char*) &sy_lfr_pas_filter_shift; | |
|
1675 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, datafield_pos + DATAFIELD_OFFSET, parPtr[FLOAT_LSBYTE] ); | |||
1565 | } |
|
1676 | } | |
1566 | } |
|
1677 | } | |
1567 |
|
1678 | |||
1568 |
|
||||
1569 | return flag; |
|
1679 | return flag; | |
1570 | } |
|
1680 | } | |
1571 |
|
1681 |
General Comments 0
You need to be logged in to leave comments.
Login now