mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Work queue in RGB driver without work_cancel()
This commit is contained in:
parent
16efc0d2d9
commit
c6b58491bb
@ -248,6 +248,11 @@ RGBLED::led_trampoline(void *arg)
|
||||
void
|
||||
RGBLED::led()
|
||||
{
|
||||
if (!_should_run) {
|
||||
_running = false;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_mode) {
|
||||
case RGBLED_MODE_BLINK_SLOW:
|
||||
case RGBLED_MODE_BLINK_NORMAL:
|
||||
@ -471,11 +476,6 @@ RGBLED::set_mode(rgbled_mode_t mode)
|
||||
work_queue(LPWORK, &_work, (worker_t)&RGBLED::led_trampoline, this, 1);
|
||||
}
|
||||
|
||||
/* if it should stop, then cancel the workq */
|
||||
if (!should_run && _running) {
|
||||
_running = false;
|
||||
work_cancel(LPWORK, &_work);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user