From a4c8ef9d16d45c58bbfc0aba451e4c197c552f0f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 8 Feb 2016 21:43:37 +0200 Subject: esp8266: Reset "virtual RTC" on power on. Initialize RTC period coefficients, etc. if RTC RAM doesn't contain valid values. time.time() then will return number of seconds since power-on, unless set to different timebase. This reuses MEM_MAGIC for the purpose beyond its initial purpose (but the whole modpybrtc.c need to be eventually reworked completely anyway). --- esp8266/esp_mphal.c | 1 + 1 file changed, 1 insertion(+) (limited to 'esp8266/esp_mphal.c') diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index f5e9468e5..1a46c5f24 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -37,6 +37,7 @@ extern void ets_delay_us(); void mp_hal_init(void) { ets_wdt_disable(); // it's a pain while developing + mp_hal_rtc_init(); uart_init(UART_BIT_RATE_115200, UART_BIT_RATE_115200); } -- cgit v1.2.3