X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=gpio%2Fps_protocol.c;h=94e38a41b60481e2f2d5008af6cb862cfa2cd996;hb=4b2af2ee35810267ca85e07dbbb649dd7594b523;hp=cc21af6c27b35b268b78fffc460e4fa4d1241709;hpb=635711f79827ad76eb4c61e99ccbb28fea4e0876;p=pistorm diff --git a/gpio/ps_protocol.c b/gpio/ps_protocol.c index cc21af6..94e38a4 100644 --- a/gpio/ps_protocol.c +++ b/gpio/ps_protocol.c @@ -177,10 +177,9 @@ unsigned int ps_read_16(unsigned int address) { *(gpio + 7) = (REG_DATA << PIN_A0); *(gpio + 7) = 1 << PIN_RD; - while (*(gpio + 13) & (1 << PIN_TXN_IN_PROGRESS)) - ; - unsigned int value = *(gpio + 13); + while ((value=*(gpio + 13)) & (1 << PIN_TXN_IN_PROGRESS)) + ; *(gpio + 10) = 0xffffec; @@ -209,10 +208,9 @@ unsigned int ps_read_8(unsigned int address) { *(gpio + 7) = (REG_DATA << PIN_A0); *(gpio + 7) = 1 << PIN_RD; - while (*(gpio + 13) & (1 << PIN_TXN_IN_PROGRESS)) - ; - unsigned int value = *(gpio + 13); + while ((value=*(gpio + 13)) & (1 << PIN_TXN_IN_PROGRESS)) + ; *(gpio + 10) = 0xffffec;