fixed serial debug output, backward beep and low bat beeps work now together, low bat beeps can now be disabled, added inactivity timeout

This commit is contained in:
larsm
2018-07-25 12:54:13 +02:00
parent 2932480274
commit 612dce68ea
5 changed files with 280 additions and 254 deletions

View File

@@ -165,18 +165,6 @@ void DMA1_Channel1_IRQHandler() {
batteryVoltage = batteryVoltage * 0.999 + ((float)adc_buffer.batt1 * ((float)BAT_CALIB_REAL_VOLTAGE / (float)BAT_CALIB_ADC)) * 0.001;
}
#ifdef BEEPS_BACKWARD
if (speed < -50 && enable == 1) {
buzzerFreq = 5;
buzzerPattern = 1;
} else if (enable == 1) {
buzzerFreq = 0;
buzzerPattern = 1;
}
#endif
//disable PWM when current limit is reached (current chopping)
if(ABS((adc_buffer.dcl - offsetdcl) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > TIMEOUT || enable == 0) {
LEFT_TIM->BDTR &= ~TIM_BDTR_MOE;