diff --git a/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat index 3e5ba8bded..758bb7d03c 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat @@ -128,19 +128,19 @@ define HAL_EXT_COMPASS_HMC5843_I2C_BUS 1 # PWM out pins -PA0 TIM2_CH1 TIM2 PWM(1) -PA1 TIM2_CH2 TIM2 PWM(2) -PA2 TIM2_CH3 TIM2 PWM(3) -PA3 TIM2_CH4 TIM2 PWM(4) -PE9 TIM1_CH1 TIM1 PWM(5) -PE11 TIM1_CH2 TIM1 PWM(6) -PE13 TIM1_CH3 TIM1 PWM(7) -PE14 TIM1_CH4 TIM1 PWM(8) +PA0 TIM2_CH1 TIM2 PWM(1) GPIO(50) +PA1 TIM2_CH2 TIM2 PWM(2) GPIO(51) +PA2 TIM2_CH3 TIM2 PWM(3) GPIO(52) +PA3 TIM2_CH4 TIM2 PWM(4) GPIO(53) +PE9 TIM1_CH1 TIM1 PWM(5) GPIO(54) +PE11 TIM1_CH2 TIM1 PWM(6) GPIO(55) +PE13 TIM1_CH3 TIM1 PWM(7) GPIO(56) +PE14 TIM1_CH4 TIM1 PWM(8) GPIO(57) -PD13 TIM4_CH2 TIM4 PWM(9) -PD12 TIM4_CH1 TIM4 PWM(10) -PD15 TIM4_CH4 TIM4 PWM(11) -PD14 TIM4_CH3 TIM4 PWM(12) +PD13 TIM4_CH2 TIM4 PWM(9) GPIO(58) +PD12 TIM4_CH1 TIM4 PWM(10) GPIO(59) +PD15 TIM4_CH4 TIM4 PWM(11) GPIO(60) +PD14 TIM4_CH3 TIM4 PWM(12) GPIO(61) # also USART6_RX for serial RC PC7 TIM8_CH2 TIM8 RCIN PULLUP LOW DMA_CH0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat index 875b039f8f..2ab603666f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat @@ -83,15 +83,15 @@ define HAL_GPIO_B_LED_PIN 1 #pwm output -PB7 TIM4_CH2 TIM4 PWM(1) GPIO(59) -PB6 TIM4_CH1 TIM4 PWM(2) GPIO(58) -PB0 TIM3_CH3 TIM3 PWM(3) GPIO(26) -PB1 TIM3_CH4 TIM3 PWM(4) GPIO(27) -PC8 TIM8_CH3 TIM8 PWM(5) GPIO(39) -PC9 TIM8_CH4 TIM8 PWM(6) GPIO(40) -PB14 TIM1_CH2N TIM1 PWM(7) GPIO(35) -PB15 TIM1_CH3N TIM1 PWM(8) GPIO(36) -PA8 TIM1_CH1 TIM1 PWM(9) GPIO(41) +PB7 TIM4_CH2 TIM4 PWM(1) GPIO(50) +PB6 TIM4_CH1 TIM4 PWM(2) GPIO(51) +PB0 TIM3_CH3 TIM3 PWM(3) GPIO(52) +PB1 TIM3_CH4 TIM3 PWM(4) GPIO(53) +PC8 TIM8_CH3 TIM8 PWM(5) GPIO(54) +PC9 TIM8_CH4 TIM8 PWM(6) GPIO(55) +PB14 TIM1_CH2N TIM1 PWM(7) GPIO(56) +PB15 TIM1_CH3N TIM1 PWM(8) GPIO(57) +PA8 TIM1_CH1 TIM1 PWM(9) GPIO(58) # SD CARD SPI PB3 SPI3_SCK SPI3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat index a8912a5f3d..a23b7dd666 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/OMNIBUSF7V2/hwdef.dat @@ -104,10 +104,10 @@ PC6 USART6_TX USART6 # UART7, RX only? #PE7 UART7_RX UART7 -PB0 TIM3_CH3 TIM3 PWM(1) -PB1 TIM3_CH4 TIM3 PWM(2) -PE9 TIM1_CH1 TIM1 PWM(3) -PE11 TIM1_CH2 TIM1 PWM(4) +PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50) +PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) +PE9 TIM1_CH1 TIM1 PWM(3) GPIO(52) +PE11 TIM1_CH2 TIM1 PWM(4) GPIO(53) define HAL_STORAGE_SIZE 16384 define STORAGE_FLASH_PAGE 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/airbotf4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/airbotf4/hwdef.dat index 5d5a3bece5..d03b71203a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/airbotf4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/airbotf4/hwdef.dat @@ -34,12 +34,12 @@ PC2 BAT_VOLT_SENS ADC1 SCALE(1) PA0 RSSI_IN ADC1 #pwm output -PB0 TIM1_CH2N TIM1 PWM(1) GPIO(26) -PB1 TIM1_CH3N TIM1 PWM(2) GPIO(27) -PA3 TIM2_CH4 TIM2 PWM(3) GPIO(17) -PA2 TIM2_CH3 TIM2 PWM(4) GPIO(16) -PA1 TIM2_CH2 TIM2 PWM(5) GPIO(15) -PA8 TIM1_CH1 TIM1 PWM(6) GPIO(41) +PB0 TIM1_CH2N TIM1 PWM(1) GPIO(50) +PB1 TIM1_CH3N TIM1 PWM(2) GPIO(51) +PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52) +PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53) +PA1 TIM2_CH2 TIM2 PWM(5) GPIO(54) +PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55) PA4 MPU6000_CS CS PA5 SPI1_SCK SPI1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat index 992827d368..a9d08e0c34 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat @@ -34,12 +34,12 @@ PC2 BAT_VOLT_SENS ADC1 SCALE(1) PA0 RSSI_IN ADC1 #pwm output -PB0 TIM1_CH2N TIM1 PWM(1) GPIO(26) -PB1 TIM1_CH3N TIM1 PWM(2) GPIO(27) -PA3 TIM2_CH4 TIM2 PWM(3) GPIO(17) -PA2 TIM2_CH3 TIM2 PWM(4) GPIO(16) -PA1 TIM2_CH2 TIM2 PWM(5) GPIO(15) -PA8 TIM1_CH1 TIM1 PWM(6) GPIO(41) +PB0 TIM1_CH2N TIM1 PWM(1) GPIO(50) +PB1 TIM1_CH3N TIM1 PWM(2) GPIO(51) +PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52) +PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53) +PA1 TIM2_CH2 TIM2 PWM(5) GPIO(54) +PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55) PA4 MPU6000_CS CS PA5 SPI1_SCK SPI1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index fe8e69ca5e..374659e395 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1042,11 +1042,15 @@ def write_GPIO_config(f): '''write GPIO config defines''' f.write('// GPIO config\n') gpios = [] + gpioset = set() for l in bylabel: p = bylabel[l] gpio = p.extra_value('GPIO', type=int) if gpio is None: continue + if gpio in gpioset: + error("Duplicate GPIO value %u" % gpio) + gpioset.add(gpio) # see if it is also a PWM pin pwm = p.extra_value('PWM', type=int, default=0) port = p.port