From 14065bb69dd4cfed30e42497a4d22802b796d774 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 20 Dec 2021 13:47:34 +0000 Subject: [PATCH] Initialise M0 state at startup. This is not currently essential, since the current M4 code will not trigger an SGPIO interrupt until the offset and tx fields are set. In future though, we want to explicitly set up the M0 state here. --- firmware/hackrf_usb/sgpio_m0.s | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/hackrf_usb/sgpio_m0.s b/firmware/hackrf_usb/sgpio_m0.s index cbef0364..d06c295e 100644 --- a/firmware/hackrf_usb/sgpio_m0.s +++ b/firmware/hackrf_usb/sgpio_m0.s @@ -150,6 +150,12 @@ main: ldr value, =STATE_BASE // 2 mov state, value // 1 + // Initialise state. + zero .req r0 + mov zero, #0 // 1 + str zero, [state, #OFFSET] // 2 + str zero, [state, #TX] // 2 + loop: // The worst case timing is assumed to occur when reading the interrupt // status register *just* misses the flag being set - so we include the