lock mutexes in the r8, r16, ... as well as the w8, w16, ... functions. This prevents any DMA-desynchronized due to unsafe thread accessing
Problem:
"DMA desynchronized" -> program exited with code null
Why it happens:
Previously, the mutex was released after the transfer function, meaning that another thread could start a transfer while the initial one was still trying to access the memory. By locking the mutex in the read and write functions themselves, my tests didn't get any more segmentation faults / DMA desynchronized
r8
,r16
, ... as well as thew8
,w16
, ... functions. This prevents any DMA-desynchronized due to unsafe thread accessingProblem: