summaryrefslogtreecommitdiff
path: root/src/siirtc.c
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-05-23 10:51:26 -0400
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-05-23 10:51:26 -0400
commitc723d980e772f7e7ab82dbcb7ad07132c09ab5b4 (patch)
tree0bed002b2990b9e837220618a321f3b6517a1099 /src/siirtc.c
parentc50a21fba07db80ac44c6f09fd202ba4b2e2c7d3 (diff)
parentffbbc88801de3fc56d0bf5f0af1418ca7cfcfa4f (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald
Diffstat (limited to 'src/siirtc.c')
-rw-r--r--src/siirtc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/siirtc.c b/src/siirtc.c
index 5c153a841..01d2e0e72 100644
--- a/src/siirtc.c
+++ b/src/siirtc.c
@@ -417,6 +417,9 @@ static u8 ReadData()
u8 i;
u8 temp;
u8 value;
+ #ifdef UBFIX
+ value = 0;
+ #endif
for (i = 0; i < 8; i++)
{
@@ -428,7 +431,7 @@ static u8 ReadData()
GPIO_PORT_DATA = SCK_HI | CS_HI;
temp = ((GPIO_PORT_DATA & SIO_HI) >> 1);
- value = (value >> 1) | (temp << 7); // UB: accessing uninitialized var
+ value = (value >> 1) | (temp << 7); // UB: value is uninitialized on first iteration
}
return value;