mirror of
https://github.com/lucysrausch/hoverboard-firmware-hack.git
synced 2025-08-01 00:24:28 +02:00
fixed compile issues
This commit is contained in:
@@ -18,6 +18,9 @@ extern volatile adc_buf_t adc_buffer;
|
||||
|
||||
extern volatile uint32_t timeout;
|
||||
|
||||
float currentR = 0;
|
||||
float currentL = 0;
|
||||
|
||||
uint32_t buzzerFreq = 0;
|
||||
uint32_t buzzerPattern = 0;
|
||||
|
||||
@@ -166,7 +169,8 @@ void DMA1_Channel1_IRQHandler() {
|
||||
}
|
||||
|
||||
//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) {
|
||||
currentL = (adc_buffer.dcl - offsetdcl) * MOTOR_AMP_CONV_DC_AMP;
|
||||
if(ABS(currentL) > DC_CUR_LIMIT || timeout > TIMEOUT || enable == 0) {
|
||||
LEFT_TIM->BDTR &= ~TIM_BDTR_MOE;
|
||||
//HAL_GPIO_WritePin(LED_PORT, LED_PIN, 1);
|
||||
} else {
|
||||
@@ -174,7 +178,8 @@ void DMA1_Channel1_IRQHandler() {
|
||||
//HAL_GPIO_WritePin(LED_PORT, LED_PIN, 0);
|
||||
}
|
||||
|
||||
if(ABS((adc_buffer.dcr - offsetdcr) * MOTOR_AMP_CONV_DC_AMP) > DC_CUR_LIMIT || timeout > TIMEOUT || enable == 0) {
|
||||
currentR = (adc_buffer.dcr - offsetdcr) * MOTOR_AMP_CONV_DC_AMP;
|
||||
if(ABS(currentR) > DC_CUR_LIMIT || timeout > TIMEOUT || enable == 0) {
|
||||
RIGHT_TIM->BDTR &= ~TIM_BDTR_MOE;
|
||||
} else {
|
||||
RIGHT_TIM->BDTR |= TIM_BDTR_MOE;
|
||||
|
@@ -187,7 +187,7 @@ int main(void) {
|
||||
|
||||
#ifdef SUPPORT_LCD
|
||||
I2C_Init();
|
||||
Led_init();
|
||||
//Led_init();
|
||||
|
||||
lcd.pcf8574.PCF_I2C_ADDRESS = 0x27;
|
||||
lcd.pcf8574.PCF_I2C_TIMEOUT = 5;
|
||||
|
1716
build/hover.hex
Normal file
1716
build/hover.hex
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user