To benefit from the chunked ringbuffer if large frames are being sent,
we need to allocate more than one ethernet frame length to it.
Rename the define and make it overwriteable by the user.
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.
`DOSE_TIMER_DEV` is defined in `board.h`, so we have to include it.
It's not included by the header (and should not), so move the check
to the .c file.
Previously we would not disable the sense pin, this meant that
a node could still wake up if the standby pin is not connected.
Properly disable sensing when in standby and wait for a state
transition to IDLE to avoid aborting a reception and messing up the
DOSE internal state.
Some CAN transceivers have a standby pin that has to be pulled low
in order to use it.
If the interface is disabled we can set it to high again to save some
power.
A fixed timeout is either too long for high symbol rates or too short
for low symbol rates.
To fix this, calculate the timeout based on the symbol rate.
For this, the old 5ms timeout is equivalent to 58 bytes being transmitted
at 115200 baud (8 data bit + start & stop bit).
I rounded this to 50 bytes which should yield 4340 µs.
The expandable GPIO API requires the comparison of structured GPIO types. This means that inline functions must be used instead of direct comparisons. For the migration process, drivers must first be changed so that they use the inline comparison functions.