Enable SWD back, Add Off mode for Sleep

This commit is contained in:
Ben V. Brown
2018-03-30 19:16:38 +11:00
parent fe5ee91104
commit 8eadb98496
8 changed files with 61 additions and 31 deletions

View File

@@ -47,6 +47,7 @@ int main(void) {
lcd.setFont(0); // default to bigger font
//Testing for new weird board version
uint8_t buffer[1];
HAL_IWDG_Refresh(&hiwdg);
if (HAL_I2C_Mem_Read(&hi2c1, 29 << 1, 0x0F, I2C_MEMADD_SIZE_8BIT, buffer, 1,
1000) == HAL_OK) {
PCBVersion = 1;
@@ -59,6 +60,8 @@ int main(void) {
accel2.initalize(); //startup the accelerometer
} else {
PCBVersion = 3;
systemSettings.SleepTime=0;
systemSettings.ShutdownTime=0;//No accel -> disable sleep
}
HAL_IWDG_Refresh(&hiwdg);
restoreSettings(); // load the settings from flash