Skip to content
Snippets Groups Projects
Commit 3ea3c1f5 authored by David Sidrane's avatar David Sidrane Committed by Lorenz Meier
Browse files

px4fmu-v5:Runtime Safety LED support.

   Safety Switch is HW version dependent on having an PX4IO
   So we init to a benign state with the _INIT definition
   and use the non _INIT verion in the driver if the run time
   decision is we do not have a PX4IO
parent 31365214
No related branches found
No related tags found
No related merge requests found
......@@ -79,10 +79,10 @@ static uint32_t g_ledmap[] = {
# define xlat(p) (p)
static uint32_t g_ledmap[] = {
GPIO_nLED_BLUE, // Indexed by LED_BLUE
GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER
GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY
GPIO_nLED_GREEN, // Indexed by LED_GREEN
GPIO_nLED_BLUE, // Indexed by LED_BLUE
GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER
GPIO_nSAFETY_SWITCH_LED_OUT_INIT, // Indexed by LED_SAFETY (defaulted to an input)
GPIO_nLED_GREEN, // Indexed by LED_GREEN
};
#endif
......@@ -90,6 +90,10 @@ static uint32_t g_ledmap[] = {
__EXPORT void led_init(void)
{
/* Configure LED GPIOs for output */
if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_PX4IO)) {
g_ledmap[2] = GPIO_nSAFETY_SWITCH_LED_OUT;
}
for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) {
stm32_configgpio(g_ledmap[l]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment