mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Notify: auto-start oreoled driver if enabled
This commit is contained in:
parent
e24cebec33
commit
74182b6b3d
@ -19,6 +19,7 @@
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
|
||||
#include <AP_BoardConfig/AP_BoardConfig.h>
|
||||
#include "OreoLED_PX4.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -53,9 +54,20 @@ OreoLED_PX4::OreoLED_PX4() : NotifyDevice(),
|
||||
memset(_state_sent,0,sizeof(_state_sent));
|
||||
}
|
||||
|
||||
extern "C" int oreoled_main(int, char **);
|
||||
|
||||
// init - initialised the device
|
||||
bool OreoLED_PX4::init()
|
||||
{
|
||||
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V2)
|
||||
if (!AP_BoardConfig::px4_start_driver(oreoled_main, "oreoled", "start autoupdate")) {
|
||||
hal.console->printf("Unable to start oreoled driver\n");
|
||||
} else {
|
||||
// give it time to initialise
|
||||
hal.scheduler->delay(500);
|
||||
}
|
||||
#endif
|
||||
|
||||
// open the device
|
||||
_oreoled_fd = open(OREOLED0_DEVICE_PATH, O_RDWR);
|
||||
if (_oreoled_fd == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user