From 400e529703ea4846267d63d9d9b4b67bf1cea094 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Wed, 23 May 2012 00:31:08 -0400 Subject: [PATCH] bu: add back LED feedback LED support was dropped from the BU images due to a lack of proper abstraction for LED definitions between CC and CC3D HW variants in the CopterControl board family. Use the new LED abstraction to hide board revision details from the BU image so it can once again flash some LEDs. --- flight/Bootloaders/BootloaderUpdater/pios_board.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/flight/Bootloaders/BootloaderUpdater/pios_board.c b/flight/Bootloaders/BootloaderUpdater/pios_board.c index 93973b470..0b7cb9efc 100644 --- a/flight/Bootloaders/BootloaderUpdater/pios_board.c +++ b/flight/Bootloaders/BootloaderUpdater/pios_board.c @@ -35,6 +35,8 @@ #include void PIOS_Board_Init(void) { + const struct pios_board_info * bdinfo = &pios_board_info_blob; + /* Enable Prefetch Buffer */ FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable); @@ -42,8 +44,15 @@ void PIOS_Board_Init(void) { FLASH_SetLatency(FLASH_Latency_2); /* Delay system */ - PIOS_DELAY_Init(); - + PIOS_DELAY_Init(); + + /* LEDs */ +#if defined(PIOS_INCLUDE_LED) + const struct pios_led_cfg * led_cfg = PIOS_BOARD_HW_DEFS_GetLedCfg(bdinfo->board_rev); + PIOS_Assert(led_cfg); + PIOS_LED_Init(led_cfg); +#endif /* PIOS_INCLUDE_LED */ + /* Initialize the PiOS library */ PIOS_GPIO_Init(); }