Skip to content
Commit 586a4bfc authored by Jordan Yates's avatar Jordan Yates Committed by Christopher Friedt
Browse files

lora: sx12xx_common: thread-safe API



Ensure that the modem is not asked to perform new operations before the
previous operation completes.

An atomic variable is used instead of a mutex as multiple threads need
to release the lock. A semaphore isn't used as there is no indication
whether `k_sem_give` gives the semaphore or not, which is required to
determine if `Radio.Sleep()` should be run.

`Radio.Sleep()` is only ever run by the context that successfully
releases the modem usage, to guard against double calls.

Signed-off-by: default avatarJordan Yates <jordan.yates@data61.csiro.au>
parent 4b370fb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment