mirror of
https://github.com/EFeru/hoverboard-firmware-hack-FOC.git
synced 2025-06-24 22:41:34 +02:00
Exit MULTI_MODE_DRIVE if inputs are not calibrated
- Timeout: 3 seconds
This commit is contained in:
@ -241,8 +241,11 @@ int main(void) {
|
|||||||
while(HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) { HAL_Delay(10); }
|
while(HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) { HAL_Delay(10); }
|
||||||
|
|
||||||
#ifdef MULTI_MODE_DRIVE
|
#ifdef MULTI_MODE_DRIVE
|
||||||
// Wait until triggers are released
|
// Wait until triggers are released. Exit if timeout elapses (to unblock if the inputs are not calibrated)
|
||||||
while((adc_buffer.l_rx2 + adc_buffer.l_tx2) >= (input1[0].min + input2[0].min)) { HAL_Delay(10); }
|
int iTimeout = 0;
|
||||||
|
while((adc_buffer.l_rx2 + adc_buffer.l_tx2) >= (input1[0].min + input2[0].min) && iTimeout++ < 300) {
|
||||||
|
HAL_Delay(10);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
Reference in New Issue
Block a user