19 lines
450 B
C
Raw Normal View History

2017-06-20 00:23:49 +02:00
#include "power.h"
#include "i2c.h"
#include "cache.h"
void Reboot() {
I2C_writeReg(I2C_DEV_MCU, 0x22, 1 << 0); // poweroff LCD to prevent MCU hangs
2017-06-20 00:23:49 +02:00
flushEntireDCache();
2017-07-10 01:46:52 +02:00
if (I2C_writeReg(I2C_DEV_MCU, 0x20, 1 << 2))
while(true);
2017-06-20 00:23:49 +02:00
}
void PowerOff()
{
I2C_writeReg(I2C_DEV_MCU, 0x22, 1 << 0); // poweroff LCD to prevent MCU hangs
2017-06-20 00:23:49 +02:00
flushEntireDCache();
2017-07-10 01:46:52 +02:00
if (I2C_writeReg(I2C_DEV_MCU, 0x20, 1 << 0))
while (true);
2017-06-20 00:23:49 +02:00
}