Добавлен ForceDisconnect

This commit is contained in:
2025-05-16 13:46:26 +03:00
parent 1c5ce14f0f
commit 6392d35129
3 changed files with 7 additions and 4 deletions

View File

@@ -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)((uint16_t)TIMER->CNT - phase_A.ctrl.angle.start_delay_tick);
disc[2 * PORT_WIDTH + 1] = ((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;
}
@@ -61,9 +61,12 @@ void ReadToSFunc(real_T* in)
detect_front(5, Upp.ForceStop, 1);
detect_rise(5, Upp.ForceStop, 0);
detect_front(6, Upp.ForceDisconnect, 1);
detect_rise(6, Upp.ForceDisconnect, 0);
Upp.sine_freq = in[6];
Upp.Duration = in[7];
Upp.sine_freq = in[7];
Upp.Duration = in[8];
for (int i = 0; i < IN_PORT_WIDTH; i++)