@@ -26,8 +26,12 | |||||
26 | #define STATUS_8 8 |
|
26 | #define STATUS_8 8 | |
27 | #define STATUS_9 9 |
|
27 | #define STATUS_9 9 | |
28 |
|
28 | |||
29 | #define CAL_F0 625 |
|
29 | #define CAL_F0 625. | |
30 | #define CAL_F1 10000 |
|
30 | #define CAL_F1 10000. | |
|
31 | #define CAL_W0 (2. * pi * CAL_F0) | |||
|
32 | #define CAL_W1 (2. * pi * CAL_F1) | |||
|
33 | #define CAL_A0 1. | |||
|
34 | #define CAL_A1 2. | |||
31 | #define CAL_FS 160256.410 |
|
35 | #define CAL_FS 160256.410 | |
32 | #define CAL_SCALE_FACTOR (0.250 / 0.000654) // 191, 500 mVpp, 2 sinus waves => 500 mVpp each, amplitude = 250 mV |
|
36 | #define CAL_SCALE_FACTOR (0.250 / 0.000654) // 191, 500 mVpp, 2 sinus waves => 500 mVpp each, amplitude = 250 mV | |
33 | #define CAL_NB_PTS 256 |
|
37 | #define CAL_NB_PTS 256 |
@@ -174,7 +174,6 int action_enter_mode(ccsdsTelecommandPa | |||||
174 |
|
174 | |||
175 | rtems_status_code status; |
|
175 | rtems_status_code status; | |
176 | unsigned char requestedMode; |
|
176 | unsigned char requestedMode; | |
177 | unsigned int *transitionCoarseTime_ptr; |
|
|||
178 | unsigned int transitionCoarseTime; |
|
177 | unsigned int transitionCoarseTime; | |
179 | unsigned char * bytePosPtr; |
|
178 | unsigned char * bytePosPtr; | |
180 |
|
179 | |||
@@ -183,7 +182,7 int action_enter_mode(ccsdsTelecommandPa | |||||
183 | printf("(1)\n"); |
|
182 | printf("(1)\n"); | |
184 | requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ]; |
|
183 | requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ]; | |
185 | printf("(2)\n"); |
|
184 | printf("(2)\n"); | |
186 | copyInt32ByChar( &transitionCoarseTime, &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); |
|
185 | copyInt32ByChar( (char*) &transitionCoarseTime, &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); | |
187 | printf("(3)\n"); |
|
186 | printf("(3)\n"); | |
188 | transitionCoarseTime = transitionCoarseTime & COARSE_TIME_MASK; |
|
187 | transitionCoarseTime = transitionCoarseTime & COARSE_TIME_MASK; | |
189 | printf("(4)\n"); |
|
188 | printf("(4)\n"); | |
@@ -1394,8 +1393,8 void setCalibrationData( void ) | |||||
1394 | // build the signal for the SCM calibration |
|
1393 | // build the signal for the SCM calibration | |
1395 | for (k = 0; k < CAL_NB_PTS; k++) |
|
1394 | for (k = 0; k < CAL_NB_PTS; k++) | |
1396 | { |
|
1395 | { | |
1397 |
val = sin( |
|
1396 | val = CAL_A0 * sin( CAL_W0 * k * Ts ) | |
1398 |
+ sin( |
|
1397 | + CAL_A1 * sin( CAL_W1 * k * Ts ); | |
1399 | data = (unsigned short) ((val * CAL_SCALE_FACTOR) + CONST_2048); |
|
1398 | data = (unsigned short) ((val * CAL_SCALE_FACTOR) + CONST_2048); | |
1400 | time_management_regs->calData = data & CAL_DATA_MASK; |
|
1399 | time_management_regs->calData = data & CAL_DATA_MASK; | |
1401 | } |
|
1400 | } |
General Comments 0
You need to be logged in to leave comments.
Login now