From 75696997ccf5d841d1090b76e70a174e79373d7f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 31 Aug 2019 13:37:07 +1000 Subject: [PATCH] HAL_ChibiOS: added buzzer support to CUAV_GPS --- libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat | 12 +++++++++++- .../AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat index 591e322a72..4556f75d2f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat @@ -17,6 +17,8 @@ APJ_BOARD_ID 1001 # setup build for a peripheral firmware env AP_PERIPH 1 +STM32_ST_USE_TIMER 5 + # crystal frequency OSCILLATOR_HZ 16000000 @@ -83,6 +85,12 @@ COMPASS IST8310 I2C:0:0x0E false ROTATION_NONE # BMP388 baro BARO BMP388 I2C:0:0x76 +# PWM output for buzzer +PB10 TIM2_CH3 TIM2 GPIO(77) LOW ALARM + +# safety LED, active low +PB1 SAFE_LED OUTPUT HIGH + define HAL_BARO_ALLOW_INIT_NO_BARO define HAL_USE_ADC FALSE @@ -139,9 +147,11 @@ define AP_PARAM_MAX_EMBEDDED_PARAM 0 define GPS_MAX_RECEIVERS 1 define GPS_MAX_INSTANCES 1 -# GPS+MAG+BARO +# GPS+MAG+BARO+Buzzer define HAL_PERIPH_ENABLE_GPS define HAL_PERIPH_ENABLE_MAG define HAL_PERIPH_ENABLE_BARO +define HAL_PERIPH_ENABLE_BUZZER + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index eb5dd6776e..9c2fc73fae 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1102,7 +1102,7 @@ def write_PWM_config(f): if p.type not in pwm_timers: pwm_timers.append(p.type) - if not pwm_out: + if not pwm_out and not alarm: print("No PWM output defined") f.write(''' #ifndef HAL_USE_PWM