refactor latest commit
This commit is contained in:
parent
af822e5af5
commit
70757e564d
@ -214,10 +214,8 @@ bool I2C_writeRegBuf(I2cDevice devId, u8 regAddr, const u8 *in, u32 size)
|
||||
|
||||
u8 I2C_readReg(I2cDevice devId, u8 regAddr)
|
||||
{
|
||||
// note: don't use it in itcm code
|
||||
u8 data;
|
||||
if(!I2C_readRegBuf(devId, regAddr, &data, 1)) return 0xFF;
|
||||
wait(3);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -86,8 +86,16 @@ u32 waitInput(bool isMenu)
|
||||
|
||||
if(!key)
|
||||
{
|
||||
if((!(I2C_readReg(I2C_DEV_MCU, 0xF) & 2) && shouldShellShutdown) ||
|
||||
(I2C_readReg(I2C_DEV_MCU, 0x10) & 1) == 1) mcuPowerOff();
|
||||
if (shouldShellShutdown) {
|
||||
u8 shellState = I2C_readReg(I2C_DEV_MCU, 0xF);
|
||||
wait(3);
|
||||
if (!(shellState & 2)) mcuPowerOff();
|
||||
}
|
||||
|
||||
u8 intstatus = I2C_readReg(I2C_DEV_MCU, 0x10);
|
||||
wait(3);
|
||||
if (intstatus & 1) mcuPowerOff(); //Power button pressed
|
||||
|
||||
oldKey = 0;
|
||||
dPadDelay = 0;
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user