mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Added stop command to RGB led
This commit is contained in:
parent
93794642d3
commit
871b4c19bc
@ -443,7 +443,7 @@ 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(" -b i2cbus (%d)", PX4_I2C_BUS_LED);
|
||||
errx(0, " -a addr (0x%x)", ADDR);
|
||||
@ -534,7 +534,8 @@ rgbled_main(int argc, char *argv[])
|
||||
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);
|
||||
if (fd == -1) {
|
||||
errx(1, "Unable to open " RGBLED_DEVICE_PATH);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user