RPi: make sure navio_rgbled works and add it to autostart

This commit is contained in:
Beat Küng
2017-02-24 10:24:40 +01:00
committed by Lorenz Meier
parent 38156d862f
commit df791cef94
3 changed files with 14 additions and 8 deletions
+12 -7
View File
@@ -68,12 +68,10 @@ RGBLED::~RGBLED()
int RGBLED::start()
{
int res;
res = DevObj::init();
int res = DevObj::init();
if (res != 0) {
DF_LOG_ERR("error: could not init DevObj");
DF_LOG_ERR("could not init DevObj (%i)", res);
return res;
}
@@ -86,7 +84,14 @@ int RGBLED::start()
// update at fixed interval
DevObj::setSampleInterval(_led_controller.maximum_update_interval());
return 0;
res = DevObj::start();
if (res != 0) {
DF_LOG_ERR("could not start DevObj (%i)", res);
return res;
}
return res;
}
int RGBLED::stop()
@@ -98,7 +103,7 @@ int RGBLED::stop()
res = DevObj::stop();
if (res < 0) {
DF_LOG_ERR("error: could not stop DevObj");
DF_LOG_ERR("could not stop DevObj");
//this may not be an error for this device
return res;
}
@@ -208,7 +213,7 @@ int stop()
void usage()
{
PX4_WARN("Usage: navio_rgbled 'start', 'stop'");
PX4_INFO("Usage: navio_rgbled 'start', 'stop'");
}
} //namespace navio_rgbled