From 5a24abafe99536f43872639e87b704f84051206e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 27 Mar 2022 13:41:34 +1100 Subject: [PATCH] hwdef: changed MatekH743 to a 32 bit timer the 68ms issue is still present on this board. Switching to a 32 bit timer will fix it, but loses us the tonealarm support --- .../hwdef/MatekH743-bdshot/hwdef.dat | 9 +-------- .../AP_HAL_ChibiOS/hwdef/MatekH743/hwdef.dat | 17 +++++++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-bdshot/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-bdshot/hwdef.dat index 06e4834e90..ec449a6303 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-bdshot/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-bdshot/hwdef.dat @@ -5,7 +5,7 @@ include ../MatekH743/hwdef.dat # undefine the pins we are going to change -undef PC7 PB0 PB1 PA0 PA1 PA15 PD14 PD15 PE5 PE6 +undef PC7 PA0 PD14 PD15 PE5 PE6 PB0 PB1 PC7 USART6_RX USART6 @@ -13,7 +13,6 @@ PC7 USART6_RX USART6 PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50) BIDIR PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) PA0 TIM2_CH1 TIM2 PWM(3) GPIO(52) BIDIR -PA1 TIM2_CH2 TIM2 PWM(4) GPIO(53) # Disable DMA on PWM9-12 so that the LEDs get a channel PD14 TIM4_CH3 TIM4 PWM(9) GPIO(58) NODMA @@ -21,11 +20,5 @@ PD15 TIM4_CH4 TIM4 PWM(10) GPIO(59) NODMA PE5 TIM15_CH1 TIM15 PWM(11) GPIO(60) NODMA PE6 TIM15_CH2 TIM15 PWM(12) GPIO(61) NODMA -# Beeper -PA15 BUZZER OUTPUT GPIO(32) LOW -define HAL_BUZZER_PIN 32 -define HAL_BUZZER_ON 1 -define HAL_BUZZER_OFF 0 - DMA_PRIORITY S* TIM3* TIM2* DMA_NOSHARE SPI1* SPI4* TIM3* TIM2* diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743/hwdef.dat index 6f930300db..ffb4b9bddc 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743/hwdef.dat @@ -16,10 +16,8 @@ env OPTIMIZE -Os # bootloader takes first sector FLASH_RESERVE_START_KB 128 - # ChibiOS system timer -STM32_ST_USE_TIMER 12 -define CH_CFG_ST_RESOLUTION 16 +STM32_ST_USE_TIMER 5 # USB PA11 OTG_FS_DM OTG1 @@ -145,10 +143,10 @@ PD3 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(70) # Motors PB0 TIM8_CH2N TIM8 PWM(1) GPIO(50) PB1 TIM8_CH3N TIM8 PWM(2) GPIO(51) -PA0 TIM5_CH1 TIM5 PWM(3) GPIO(52) -PA1 TIM5_CH2 TIM5 PWM(4) GPIO(53) -PA2 TIM5_CH3 TIM5 PWM(5) GPIO(54) -PA3 TIM5_CH4 TIM5 PWM(6) GPIO(55) +PA0 TIM2_CH1 TIM2 PWM(3) GPIO(52) +PA1 TIM2_CH2 TIM2 PWM(4) GPIO(53) +PA2 TIM2_CH3 TIM2 PWM(5) GPIO(54) +PA3 TIM2_CH4 TIM2 PWM(6) GPIO(55) PD12 TIM4_CH1 TIM4 PWM(7) GPIO(56) PD13 TIM4_CH2 TIM4 PWM(8) GPIO(57) PD14 TIM4_CH3 TIM4 PWM(9) GPIO(58) @@ -158,7 +156,10 @@ PE6 TIM15_CH2 TIM15 PWM(12) GPIO(61) PA8 TIM1_CH1 TIM1 PWM(13) GPIO(62) # for WS2812 LED # Beeper -PA15 TIM2_CH1 TIM2 GPIO(32) ALARM +PA15 BUZZER OUTPUT GPIO(32) LOW +define HAL_BUZZER_PIN 32 +define HAL_BUZZER_ON 1 +define HAL_BUZZER_OFF 0 # microSD support PC8 SDMMC1_D0 SDMMC1