1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/dose: only disable watchdog when transiting from RECV state

The DOSE watchdog should only run if at least one interface is in RECV
state.

That means it must be enabled when entering RECV state and disabled
when leaving RECV state.

The watchdog was *always* disabled on a transition to IDLE.
This is wrong: If there are two interfaces and one is in RECV state
but the other did just SEND something and transitions to IDLE state
from SEND state, it would still disable the watchdog.

Fix this by only disabling the watchdog if the current state is RECV.
This commit is contained in:
Benjamin Valentin 2022-02-28 17:15:04 +01:00
parent bbfa69153e
commit e6d2ff668b

View File

@ -201,12 +201,12 @@ static dose_signal_t state_transit_idle(dose_t *ctx, dose_signal_t signal)
(void) ctx;
(void) signal;
_watchdog_stop();
if (ctx->state == DOSE_STATE_RECV) {
bool dirty = ctx->flags & DOSE_FLAG_RECV_BUF_DIRTY;
bool done = ctx->flags & DOSE_FLAG_END_RECEIVED;
_watchdog_stop();
/* We got here from RECV state. The driver's thread has to look
* if this frame should be processed. By queuing NETDEV_EVENT_ISR,
* the netif thread will call _isr at some time. */