diff options
-rw-r--r-- | xbee.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,7 +1,13 @@ #ifndef XBEE_H #define XBEE_H +#include "mutex.h" + +Mutex xbm; + void xbee_send(uint16_t type, int len, const uint8_t* buf) { + xbm.lock(); + // Start and length. usart_send(0x7e); usart_send(((len + 16) >> 8) & 0xff); @@ -40,6 +46,8 @@ void xbee_send(uint16_t type, int len, const uint8_t* buf) { } usart_send(chsum); + + xbm.unlock(); } #endif |