Skip to content

Commit

Permalink
Poweroff LCD before reboot / poweroff
Browse files Browse the repository at this point in the history
... fixes several MCU issues
  • Loading branch information
d0k3 committed Jul 11, 2017
1 parent 730b886 commit c60237a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#endif

// GodMode9 version
#define VERSION "1.2.6"
#define VERSION "1.2.7"

// input / output paths
#define SUPPORT_PATHS "0:/gm9/support", "0:", "0:/files9" // legacy paths
Expand Down
5 changes: 2 additions & 3 deletions source/common/power.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#include "power.h"
#include "i2c.h"
#include "cache.h"
#include "ui.h"

void Reboot() {
ClearScreenF(true, true, COLOR_STD_BG);
I2C_writeReg(I2C_DEV_MCU, 0x22, 1 << 0); // poweroff LCD to prevent MCU hangs
flushEntireDCache();
if (I2C_writeReg(I2C_DEV_MCU, 0x20, 1 << 2))
while(true);
}

void PowerOff()
{
ClearScreenF(true, true, COLOR_STD_BG);
I2C_writeReg(I2C_DEV_MCU, 0x22, 1 << 0); // poweroff LCD to prevent MCU hangs
flushEntireDCache();
if (I2C_writeReg(I2C_DEV_MCU, 0x20, 1 << 0))
while (true);
Expand Down

0 comments on commit c60237a

Please sign in to comment.