mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
Merge branch 'master' of https://github.com/PX4/Firmware
This commit is contained in:
@@ -121,7 +121,7 @@ private:
|
|||||||
/* for now, we only support one RGBLED */
|
/* for now, we only support one RGBLED */
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
RGBLED *g_rgbled;
|
RGBLED *g_rgbled = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgbled_usage();
|
void rgbled_usage();
|
||||||
@@ -680,15 +680,15 @@ rgbled_main(int argc, char *argv[])
|
|||||||
|
|
||||||
ret = ioctl(fd, RGBLED_SET_MODE, (unsigned long)RGBLED_MODE_OFF);
|
ret = ioctl(fd, RGBLED_SET_MODE, (unsigned long)RGBLED_MODE_OFF);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
/* delete the rgbled object if stop was requested, in addition to turning off the LED. */
|
||||||
|
if (!strcmp(verb, "stop")) {
|
||||||
|
delete g_rgbled;
|
||||||
|
g_rgbled = nullptr;
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
exit(ret);
|
exit(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(verb, "stop")) {
|
|
||||||
delete g_rgbled;
|
|
||||||
g_rgbled = nullptr;
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strcmp(verb, "rgb")) {
|
if (!strcmp(verb, "rgb")) {
|
||||||
if (argc < 5) {
|
if (argc < 5) {
|
||||||
errx(1, "Usage: rgbled rgb <red> <green> <blue>");
|
errx(1, "Usage: rgbled rgb <red> <green> <blue>");
|
||||||
|
|||||||
Reference in New Issue
Block a user