diff --git a/atusb/fw/mac.c b/atusb/fw/mac.c index 33c891b..05d16d6 100644 --- a/atusb/fw/mac.c +++ b/atusb/fw/mac.c @@ -34,6 +34,9 @@ static bool queued_rx = 0; static uint8_t next_seq, this_seq, queued_seq; +/* ----- Register access --------------------------------------------------- */ + + static uint8_t reg_read(uint8_t reg) { uint8_t value; @@ -56,6 +59,9 @@ static void reg_write(uint8_t reg, uint8_t value) } +/* ----- Interrupt handling ------------------------------------------------ */ + + static void receive_frame(void); @@ -137,6 +143,9 @@ static bool handle_irq(void) } +/* ----- TX/RX ------------------------------------------------------------- */ + + static void change_state(uint8_t new) { while ((reg_read(REG_TRX_STATUS) & TRX_STATUS_MASK) ==