From dc81e38a67dce036c49dfec26bf0d323891e7ac3 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 25 Aug 2017 18:37:59 -0400 Subject: [PATCH] #475 --- firmware/ChibiOS3 | 2 +- firmware/config/stm32f4ems/mcuconf.h | 5 ++++- firmware/hw_layer/rtc_helper.cpp | 6 ++++-- firmware/rusefi.cpp | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/firmware/ChibiOS3 b/firmware/ChibiOS3 index d8d4ff6c28..2d64b37df4 160000 --- a/firmware/ChibiOS3 +++ b/firmware/ChibiOS3 @@ -1 +1 @@ -Subproject commit d8d4ff6c28c9b47dc81138ddfd34f707c39c85c2 +Subproject commit 2d64b37df4fc3dde421d049250e202564f368ba7 diff --git a/firmware/config/stm32f4ems/mcuconf.h b/firmware/config/stm32f4ems/mcuconf.h index fde0e3d15f..47f136d3cb 100644 --- a/firmware/config/stm32f4ems/mcuconf.h +++ b/firmware/config/stm32f4ems/mcuconf.h @@ -68,7 +68,10 @@ #define STM32_HSI_ENABLED TRUE #define STM32_LSI_ENABLED TRUE #define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE + +// rusEfi would automatically detect if we have 32768 quarts osc - see 'rtcWorks' +#define STM32_LSE_ENABLED TRUE + #define STM32_CLOCK48_REQUIRED TRUE #define STM32_SW STM32_SW_PLL #define STM32_PLLSRC STM32_PLLSRC_HSE diff --git a/firmware/hw_layer/rtc_helper.cpp b/firmware/hw_layer/rtc_helper.cpp index f6701ba916..313c9485e3 100644 --- a/firmware/hw_layer/rtc_helper.cpp +++ b/firmware/hw_layer/rtc_helper.cpp @@ -16,6 +16,8 @@ static LoggingWithStorage logger("RTC"); static RTCDateTime timespec; +extern bool rtcWorks; + #endif /* EFI_RTC */ void date_set_tm(struct tm *timp) { @@ -139,8 +141,8 @@ void printDateTime(void) { date_get_tm(&timp); appendMsgPrefix(&logger); - appendPrintf(&logger, "Current RTC localtime is: %04u-%02u-%02u %02u:%02u:%02u", timp.tm_year + 1900, timp.tm_mon + 1, timp.tm_mday, timp.tm_hour, - timp.tm_min, timp.tm_sec); + appendPrintf(&logger, "Current RTC localtime is: %04u-%02u-%02u %02u:%02u:%02u w=%d", timp.tm_year + 1900, timp.tm_mon + 1, timp.tm_mday, timp.tm_hour, + timp.tm_min, timp.tm_sec, rtcWorks); appendMsgPostfix(&logger); scheduleLogging(&logger); } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index a1818573e0..c35bd62663 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -260,5 +260,5 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20170817; + return 20170825; }