From bd7d0b919447e3c04ad492f5d4829d196f122cb6 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 20 Dec 2021 13:14:48 +0000 Subject: [PATCH] Correct a misleading comment. The effect of the lsr instruction here is to shift the LSB of r0 into the processor's carry flag. The subsequent bcc instruction ("branch if carry clear") will then branch if this bit was zero. The LSB corresponds to the exchange interrupt flag for slice A only. The other interrupt flag bits are not checked here, contrary to the comment. --- firmware/hackrf_usb/sgpio_m0.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/hackrf_usb/sgpio_m0.s b/firmware/hackrf_usb/sgpio_m0.s index f77b81da..2bc1505b 100644 --- a/firmware/hackrf_usb/sgpio_m0.s +++ b/firmware/hackrf_usb/sgpio_m0.s @@ -168,7 +168,7 @@ loop: // Grab the exchange interrupt staus... ldr r0, [sgpio_int, #INT_STATUS] // 10, twice - // ... check to see if it has any interrupt bits set... + // ... check to see if bit #0 (slice A) was set, by shifting it into the carry bit... lsr r0, #1 // 1, twice // ... and if not, jump back to the beginning.