OVMS3-idf/components/esp32
Ivan Grokhotkov 8ccb2a4990 esp32: make time monotonic across resets
Small changes to clock calibration value will cause increasing errors
the longer the device runs. Consider the case of deep sleep, assuming
that RTC counter is used for timekeeping:
- before sleep:
   time_before = rtc_counter * calibration_val
- after sleep:
   time_after = (rtc_counter + sleep_count) * (calibration_val + epsilon)
where 'epsilon' is a small estimation error of 'calibration_val'.
The apparent sleep duration thus will be:
time_after - time_before = sleep_count * (calibration_val + epsilon)
                           + rtc_counter * epsilon

Second term on the right hand side is the error in time difference
estimation, it is proportional to the total system runtime (rtc_counter).

To avoid this issue, this change makes RTC_SLOW_CLK calibration value
persistent across restarts. This allows the calibration value update to
be preformed, while keeping time after update same as before the update.
2017-06-16 12:06:04 +08:00
..
hwcrypto component/soc : move dport access header files to soc 2017-05-09 18:06:00 +08:00
include esp32: make time monotonic across resets 2017-06-16 12:06:04 +08:00
ld fix bug that files missing commit in MR 773 2017-05-31 19:37:39 +08:00
lib@8047d46d83 Add dport protect in libphy.a 2017-06-01 19:43:55 +08:00
test component/soc : move dport access header files to soc 2017-05-09 18:06:00 +08:00
app_trace.c component/soc : move dport access header files to soc 2017-05-09 18:06:00 +08:00
cache_err_int.c component/soc : move dport access header files to soc 2017-05-09 18:06:00 +08:00
clk.c esp32: make time monotonic across resets 2017-06-16 12:06:04 +08:00
component.mk component/esp32 : fix dualcore bug 2017-05-08 21:53:43 +08:00
core_dump.c esp32: Core dump sanity checks were added 2017-04-26 21:13:02 +03:00
cpu_start.c bugfix:Fix bug that wdt reset information for CPU1 was not correct 2017-06-05 18:26:14 +08:00
crosscore_int.c component/soc : move dport access header files to soc 2017-05-09 18:06:00 +08:00
deep_sleep.c component/soc : move dport access header files to soc 2017-05-09 18:06:00 +08:00
dport_access.c fix bug that files missing commit in MR 773 2017-05-31 19:37:39 +08:00
event_default_handlers.c wifi event_default_handlers/tcpip_adapter: Support disabling WiFi, keeping Ethernet 2017-02-24 14:46:23 +11:00
event_loop.c components/esp32: fix renaming of esp_event_set_cb, minor clean up 2016-09-26 12:35:09 +08:00
freertos_hooks.c Add comments/headers according to merge request comments 2016-11-15 12:10:02 +08:00
gdbstub.c Fix small bug in gdbstub where it sometimes would not return a valid stop reason, timing out gdb. Also clean up the code a bit. 2016-12-02 17:42:11 +08:00
heap_alloc_caps.c MR things 2017-03-09 19:59:09 +08:00
hw_random.c esp_random: XOR the RNG register value several times before returning it 2017-01-04 17:07:12 +11:00
int_wdt.c driver: timer 2016-11-23 17:23:21 +08:00
intr_alloc.c esp32: Fixes watchdog problem when printing core dump to uart 2017-02-01 18:39:28 +03:00
ipc.c components/esp32: add inter-processor call API and implement spi_flash through it 2016-09-12 18:54:45 +08:00
Kconfig sdkconfig: set CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 by default 2017-05-25 10:51:39 +08:00
lib_printf.c uart_tx_wait_idle: fix issue with last character not transmitted 2016-12-08 01:42:37 +08:00
libhal.a Initial public version 2016-08-17 23:08:22 +08:00
Makefile.projbuild phy init data: Read PHY init data partition offset from menuconfig 2016-11-18 20:11:16 +08:00
panic.c Print the name of the task that hit the stack watchpoint 2017-05-17 11:36:13 +10:00
phy.h soc: add source code of rtc_clk, rtc_pm 2017-04-11 15:45:54 +08:00
phy_init.c Merge branch 'feature/base_mac_address' into 'master' 2017-05-11 12:01:51 +08:00
phy_init_data.h phy init data update 2016-12-19 14:23:39 +08:00
spiram.h Initial public version 2016-08-17 23:08:22 +08:00
system_api.c Merge branch 'feature/get_chip_ver' into 'master' 2017-05-11 12:05:55 +08:00
task_wdt.c Add interrupt allocation scheme / interrupt sharing. Also modifies drivers and examples. Also allows interrupts 2016-12-08 12:39:33 +08:00