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

View File

@ -9,6 +9,7 @@ df_lsm9ds1_wrapper start -R 4
#df_mpu9250_wrapper start -R 10 #df_mpu9250_wrapper start -R 10
#df_hmc5883_wrapper start #df_hmc5883_wrapper start
df_ms5611_wrapper start df_ms5611_wrapper start
navio_rgbled start
gps start -d /dev/spidev0.0 -i spi -p ubx gps start -d /dev/spidev0.0 -i spi -p ubx
sensors start sensors start
commander start commander start

View File

@ -7,7 +7,7 @@ param set SYS_MC_EST_GROUP 2
dataman start dataman start
df_lsm9ds1_wrapper start -R 4 df_lsm9ds1_wrapper start -R 4
df_ms5611_wrapper start df_ms5611_wrapper start
#navio_rgbled start navio_rgbled start
gps start -d /dev/spidev0.0 -i spi -p ubx gps start -d /dev/spidev0.0 -i spi -p ubx
sensors start sensors start
commander start commander start

View File

@ -68,12 +68,10 @@ RGBLED::~RGBLED()
int RGBLED::start() int RGBLED::start()
{ {
int res; int res = DevObj::init();
res = DevObj::init();
if (res != 0) { if (res != 0) {
DF_LOG_ERR("error: could not init DevObj"); DF_LOG_ERR("could not init DevObj (%i)", res);
return res; return res;
} }
@ -86,7 +84,14 @@ int RGBLED::start()
// update at fixed interval // update at fixed interval
DevObj::setSampleInterval(_led_controller.maximum_update_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() int RGBLED::stop()
@ -98,7 +103,7 @@ int RGBLED::stop()
res = DevObj::stop(); res = DevObj::stop();
if (res < 0) { 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 //this may not be an error for this device
return res; return res;
} }
@ -208,7 +213,7 @@ int stop()
void usage() void usage()
{ {
PX4_WARN("Usage: navio_rgbled 'start', 'stop'"); PX4_INFO("Usage: navio_rgbled 'start', 'stop'");
} }
} //namespace navio_rgbled } //namespace navio_rgbled