implemented setting HIGH of OUT_6, OUT_7 at 1/3 and 2/3 of laser current change cycle. Both are reseted at the end of cycle. their purpose -- switch amplifier stages of signal after detector, before ADC. NOT TESTED!
This commit is contained in:
14
Src/main.c
14
Src/main.c
@ -442,6 +442,10 @@ int main(void)
|
||||
TIM4 -> CNT = TIM4 -> ARR - 20; // not zero to make phase shift that will be robust to big delay in RF subsystem (up to ~400 ns)
|
||||
TIM11 -> CNT = 0;
|
||||
|
||||
uint32_t curr_step_N = 0;
|
||||
uint32_t postAmpl_1_en_curr_step_N = ((task.max_param - task.current_param)/3.0 * 1.0) / task.delta_param;
|
||||
uint32_t postAmpl_2_en_curr_step_N = ((task.max_param - task.current_param)/3.0 * 2.0) / task.delta_param;
|
||||
|
||||
|
||||
while (task.current_param < task.max_param)
|
||||
{
|
||||
@ -456,6 +460,14 @@ int main(void)
|
||||
TO10 = 0;
|
||||
TIM10_coflag = 0;
|
||||
|
||||
if (curr_step_N == postAmpl_1_en_curr_step_N){
|
||||
HAL_GPIO_WritePin(OUT_6_GPIO_Port, OUT_6_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
if (curr_step_N == postAmpl_2_en_curr_step_N){
|
||||
HAL_GPIO_WritePin(OUT_7_GPIO_Port, OUT_7_Pin, GPIO_PIN_SET);;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_SET); // set the current step laser current trigger
|
||||
//HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_RESET);
|
||||
@ -502,6 +514,8 @@ int main(void)
|
||||
|
||||
|
||||
Stop_TIM10();
|
||||
HAL_GPIO_WritePin(OUT_6_GPIO_Port, OUT_6_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(OUT_7_GPIO_Port, OUT_7_Pin, GPIO_PIN_RESET);
|
||||
|
||||
task.current_param = task.min_param;
|
||||
Set_LTEC(TT_CHANGE_CURR_1, task.current_param);
|
||||
|
||||
Reference in New Issue
Block a user