README.md
1## System Notes
2
3### Timekeeping
4
5The following are the timekeeping mechanisms available and their differences:
6
71. System time (`esp_system_get_time`)
8
9Time with the origin at `g_startup_time`. The implementation is not handled by `esp_system`,
10but it does provide a default implementation using RTC timer. Currently, `esp_timer`
11provides system time, since the hardware timers are under the control of that
12component. However, no matter the underlying timer, the system time provider
13should maintain the definition of having the origin point at `g_startup_time`.
14
152. `esp_timer` time (`esp_timer_get_time`)
16
17This is the time read from an underlying hardware timer, controlled through config. Origin
18is at the point where the underlying timer starts counting.
19
203. `newlib` time (`gettimeofday`)
21
22Timekeeping function in standard library. Can be set (`settimeofday`) or moved forward/backward (`adjtime`);
23with the possibility of the changes being made persistent through config.
24Currently implemented in terms of system time, as the point of origin is fixed.
25If persistence is enabled, RTC time is also used in conjuction with system time.
26
274. RTC time (`esp_rtc_get_time_us`)
28
29Time read from RTC timer.
30
31### Brownout
32
33on some boards, we name BOD1 as ana_bod, to unify the usage, using BOD1 in following passage.
34
35BOD1 will be a little faster then BOD0, but BOD0 can be widely used(can reset rf, flash, or using interrupt, etc.) So, in IDF code, we use BOD1 in bootloader and BOD0 in the app.
36