diff --git a/App_Wrapper/app_io.c b/App_Wrapper/app_io.c index 6210df6..02810b0 100644 --- a/App_Wrapper/app_io.c +++ b/App_Wrapper/app_io.c @@ -32,7 +32,7 @@ void WriteFromSFunc(real_T* disc) } } disc[2 * PORT_WIDTH + 0] = phase_A.ctrl.angle.delay_us; - disc[2 * PORT_WIDTH + 1] = ((uint16_t)TIMER->CNT - phase_A.ctrl.angle.start_delay_tick); + disc[2 * PORT_WIDTH + 1] = (uint16_t)((uint16_t)TIMER->CNT - phase_A.ctrl.angle.start_delay_tick); disc[2 * PORT_WIDTH + 2] = phase_A.ctrl.angle.start_delay_tick; disc[2 * PORT_WIDTH + 3] = TIMER->CNT; }