mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 05:23:33 +08:00
fix commander: avoid LED printf errors on every SITL startup
This commit is contained in:
@@ -1196,13 +1196,8 @@ Commander::run()
|
|||||||
param_t _param_rc_map_arm_switch = param_find("RC_MAP_ARM_SW");
|
param_t _param_rc_map_arm_switch = param_find("RC_MAP_ARM_SW");
|
||||||
|
|
||||||
/* initialize */
|
/* initialize */
|
||||||
if (led_init() != OK) {
|
led_init();
|
||||||
PX4_WARN("LED init failed");
|
buzzer_init();
|
||||||
}
|
|
||||||
|
|
||||||
if (buzzer_init() != OK) {
|
|
||||||
PX4_WARN("Buzzer init failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// we need to do an initial publication to make sure uORB allocates the buffer, which cannot happen
|
// we need to do an initial publication to make sure uORB allocates the buffer, which cannot happen
|
||||||
|
|||||||
@@ -296,8 +296,9 @@ int led_init()
|
|||||||
fd_leds = px4_open(LED0_DEVICE_PATH, O_RDWR);
|
fd_leds = px4_open(LED0_DEVICE_PATH, O_RDWR);
|
||||||
|
|
||||||
if (fd_leds < 0) {
|
if (fd_leds < 0) {
|
||||||
PX4_ERR("LED: open %s failed", LED0_DEVICE_PATH);
|
// there might not be an LED available, so don't make this an error
|
||||||
return PX4_ERROR;
|
PX4_INFO("LED: open %s failed (%i)", LED0_DEVICE_PATH, errno);
|
||||||
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the green LED is only available on FMUv5 */
|
/* the green LED is only available on FMUv5 */
|
||||||
|
|||||||
Reference in New Issue
Block a user