Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / drivers / lights_io.c
bloba495a324930630624a9c80785dff37ddf1b3c291
1 #include "drivers/lights_io.h"
2 #include "drivers/io.h"
4 #ifdef USE_LIGHTS
6 #ifndef LIGHTS_OUTPUT_MODE
7 #define LIGHTS_OUTPUT_MODE IOCFG_OUT_PP
8 #endif
10 static IO_t lightsIO = DEFIO_IO(NONE);
12 bool lightsHardwareInit(void)
14 lightsIO = IOGetByTag(IO_TAG(LIGHTS_PIN));
16 if (lightsIO) {
17 IOInit(lightsIO, OWNER_LED, RESOURCE_OUTPUT, 0);
18 IOConfigGPIO(lightsIO, LIGHTS_OUTPUT_MODE);
19 return(true);
20 } else
21 return(false);
24 void lightsHardwareSetStatus(bool status)
26 if (lightsIO)
27 IOWrite(lightsIO, status);
30 #endif /* USE_LIGHTS */