HAL_ChibiOS: allow control of interrupt port

F412 has radio IRQ on port B
This commit is contained in:
Andrew Tridgell 2018-01-17 09:08:01 +11:00
parent 3cacb1d4b5
commit 591e0c2249
3 changed files with 24 additions and 18 deletions

View File

@ -80,22 +80,22 @@ static EXTConfig extcfg = {
}; };
static const uint32_t irq_port_list[] = { static const uint32_t irq_port_list[] = {
EXT_MODE_GPIOD, //Chan 0 HAL_GPIO_INTERRUPT_PORT, //Chan 0
EXT_MODE_GPIOD, //Chan 1 HAL_GPIO_INTERRUPT_PORT, //Chan 1
EXT_MODE_GPIOD, //Chan 2 HAL_GPIO_INTERRUPT_PORT, //Chan 2
EXT_MODE_GPIOD, //Chan 3 HAL_GPIO_INTERRUPT_PORT, //Chan 3
EXT_MODE_GPIOD, //Chan 4 HAL_GPIO_INTERRUPT_PORT, //Chan 4
EXT_MODE_GPIOD, //Chan 5 HAL_GPIO_INTERRUPT_PORT, //Chan 5
EXT_MODE_GPIOD, //Chan 6 HAL_GPIO_INTERRUPT_PORT, //Chan 6
EXT_MODE_GPIOD, //Chan 7 HAL_GPIO_INTERRUPT_PORT, //Chan 7
EXT_MODE_GPIOD, //Chan 8 HAL_GPIO_INTERRUPT_PORT, //Chan 8
EXT_MODE_GPIOD, //Chan 9 HAL_GPIO_INTERRUPT_PORT, //Chan 9
EXT_MODE_GPIOD, //Chan 10 HAL_GPIO_INTERRUPT_PORT, //Chan 10
EXT_MODE_GPIOD, //Chan 11 HAL_GPIO_INTERRUPT_PORT, //Chan 11
EXT_MODE_GPIOD, //Chan 12 HAL_GPIO_INTERRUPT_PORT, //Chan 12
EXT_MODE_GPIOD, //Chan 13 HAL_GPIO_INTERRUPT_PORT, //Chan 13
EXT_MODE_GPIOD, //Chan 14 HAL_GPIO_INTERRUPT_PORT, //Chan 14
EXT_MODE_GPIOD //Chan 15 HAL_GPIO_INTERRUPT_PORT //Chan 15
}; };
GPIO::GPIO() GPIO::GPIO()

View File

@ -26,6 +26,11 @@
#define HAL_BOARD_INIT_HOOK_CALL #define HAL_BOARD_INIT_HOOK_CALL
#endif #endif
// default to interrupts on port D
#ifndef HAL_GPIO_INTERRUPT_PORT
#define HAL_GPIO_INTERRUPT_PORT EXT_MODE_GPIOD
#endif
#if !defined(_FROM_ASM_) #if !defined(_FROM_ASM_)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -103,8 +103,9 @@ define HAL_INS_DEFAULT_ROTATION ROTATION_NONE
define HAL_INS_MPU60x0_I2C_BUS 1 define HAL_INS_MPU60x0_I2C_BUS 1
define HAL_INS_MPU60x0_I2C_ADDR 0x68 define HAL_INS_MPU60x0_I2C_ADDR 0x68
define HAL_GPIO_RADIO_RESET 1 # radio IRQ is on PB0
define HAL_GPIO_RADIO_IRQ 2 define HAL_GPIO_RADIO_IRQ 0
define HAL_GPIO_INTERRUPT_PORT EXT_MODE_GPIOB
define HAL_RCINPUT_WITH_AP_RADIO 1 define HAL_RCINPUT_WITH_AP_RADIO 1
define STORAGE_FLASH_PAGE 1 define STORAGE_FLASH_PAGE 1