HAL_ChibiOS: added buzzer support to CUAV_GPS

This commit is contained in:
Andrew Tridgell 2019-08-31 13:37:07 +10:00
parent a469b93d23
commit 75696997cc
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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