mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
Added stop command to RGB led
This commit is contained in:
@@ -443,7 +443,7 @@ void rgbled_usage();
|
|||||||
|
|
||||||
|
|
||||||
void rgbled_usage() {
|
void rgbled_usage() {
|
||||||
warnx("missing command: try 'start', 'test', 'info', 'off', 'rgb'");
|
warnx("missing command: try 'start', 'test', 'info', 'stop'/'off', 'rgb 30 40 50'");
|
||||||
warnx("options:");
|
warnx("options:");
|
||||||
warnx(" -b i2cbus (%d)", PX4_I2C_BUS_LED);
|
warnx(" -b i2cbus (%d)", PX4_I2C_BUS_LED);
|
||||||
errx(0, " -a addr (0x%x)", ADDR);
|
errx(0, " -a addr (0x%x)", ADDR);
|
||||||
@@ -534,7 +534,8 @@ rgbled_main(int argc, char *argv[])
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(verb, "off")) {
|
if (!strcmp(verb, "stop") || !strcmp(verb, "off")) {
|
||||||
|
/* although technically it doesn't stop, this is the excepted syntax */
|
||||||
fd = open(RGBLED_DEVICE_PATH, 0);
|
fd = open(RGBLED_DEVICE_PATH, 0);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
errx(1, "Unable to open " RGBLED_DEVICE_PATH);
|
errx(1, "Unable to open " RGBLED_DEVICE_PATH);
|
||||||
|
|||||||
Reference in New Issue
Block a user