diff --git a/header/tc_handler.h b/header/tc_handler.h --- a/header/tc_handler.h +++ b/header/tc_handler.h @@ -26,8 +26,12 @@ #define STATUS_8 8 #define STATUS_9 9 -#define CAL_F0 625 -#define CAL_F1 10000 +#define CAL_F0 625. +#define CAL_F1 10000. +#define CAL_W0 (2. * pi * CAL_F0) +#define CAL_W1 (2. * pi * CAL_F1) +#define CAL_A0 1. +#define CAL_A1 2. #define CAL_FS 160256.410 #define CAL_SCALE_FACTOR (0.250 / 0.000654) // 191, 500 mVpp, 2 sinus waves => 500 mVpp each, amplitude = 250 mV #define CAL_NB_PTS 256 diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -174,7 +174,6 @@ int action_enter_mode(ccsdsTelecommandPa rtems_status_code status; unsigned char requestedMode; - unsigned int *transitionCoarseTime_ptr; unsigned int transitionCoarseTime; unsigned char * bytePosPtr; @@ -183,7 +182,7 @@ int action_enter_mode(ccsdsTelecommandPa printf("(1)\n"); requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ]; printf("(2)\n"); - copyInt32ByChar( &transitionCoarseTime, &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); + copyInt32ByChar( (char*) &transitionCoarseTime, &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); printf("(3)\n"); transitionCoarseTime = transitionCoarseTime & COARSE_TIME_MASK; printf("(4)\n"); @@ -1394,8 +1393,8 @@ void setCalibrationData( void ) // build the signal for the SCM calibration for (k = 0; k < CAL_NB_PTS; k++) { - val = sin( 2 * pi * CAL_F0 * k * Ts ) - + sin( 2 * pi * CAL_F1 * k * Ts ); + val = CAL_A0 * sin( CAL_W0 * k * Ts ) + + CAL_A1 * sin( CAL_W1 * k * Ts ); data = (unsigned short) ((val * CAL_SCALE_FACTOR) + CONST_2048); time_management_regs->calData = data & CAL_DATA_MASK; }