diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2021-04-20 12:58:50 -0400 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2021-04-20 12:58:50 -0400 |
commit | 21f05a3c0115e3effd9b6c40c14f6b19482f03fe (patch) | |
tree | 96e384167512cdc882af88cb087a70bb8c9ad77e /src | |
parent | b65d4eb910deec1a366cf117f2fa2c0418bb0595 (diff) |
Resolve sio32intr_clock_slave fakematching. One left!
Diffstat (limited to 'src')
-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 ( |