diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-07-31 13:30:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-31 13:30:40 -0400 |
commit | 3e60a7840653e50845abf10bb02cd1b519dcd80f (patch) | |
tree | cb4a0d227a238ebdeb3b6cb9fdb92781bcc4f5e7 /src/librfu_intr.c | |
parent | 602855ea99d8015ef5b7709f6fb1e9fd167239e2 (diff) | |
parent | d391486247cc9f29d85787d6711f7cb993cf6585 (diff) |
Merge branch 'master' into doc-frontierpass2
Diffstat (limited to 'src/librfu_intr.c')
-rw-r--r-- | src/librfu_intr.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/librfu_intr.c b/src/librfu_intr.c index 1361be40e..19ea60b06 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -148,11 +148,7 @@ static void sio32intr_clock_slave(void) { u32 regSIODATA32; u32 r0; - #ifndef NONMATCHING - register u32 reqLen asm("r2"); - #else - u32 reqLen; - #endif + u32 reqLen; gSTWIStatus->timerActive = 0; STWI_set_timer_in_RAM(100); @@ -165,10 +161,14 @@ static void sio32intr_clock_slave(void) ((u32*)gSTWIStatus->rxPacket)[0] = regSIODATA32; gSTWIStatus->reqNext = 1; r0 = 0x99660000; - if ((regSIODATA32 >> 16) == (r0 >> 16)) + // variable reuse required + reqLen = (regSIODATA32 >> 16); + if (reqLen == (r0 >> 16)) { - gSTWIStatus->reqLength = reqLen = regSIODATA32 >> 8; - gSTWIStatus->reqActiveCommand = regSIODATA32; + // only reqLen = regSIODATA32 >> 8 is needed to match, but it looks a bit + // more consistent when both lines update the variables. Might have been a macro? + gSTWIStatus->reqLength = reqLen = (regSIODATA32 >> 8); + gSTWIStatus->reqActiveCommand = reqLen = (regSIODATA32 >> 0); if (gSTWIStatus->reqLength == 0) { if ( |