]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'feature/time_syscalls' into 'master'
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 3 Nov 2016 10:02:58 +0000 (18:02 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 3 Nov 2016 10:02:58 +0000 (18:02 +0800)
implement time syscalls

This change adds optional support for libc time functions.
New menuconfig option allows selecting FRC1,  RTC, both, or none to be used for timekeeping.

- If only FRC1 timer is used, gettimeofday will provide time at
  microsecond resolution. Time will not be preserved when going
  into deep sleep mode.
- If both FRC1 and RTC timers are used, timekeeping will
  continue in deep sleep. Time will be reported at 1 microsecond
  resolution.
- If only RTC timer is used, timekeeping will continue in
  deep sleep, but time will be measured at 6.(6) microsecond
  resolution. Also the gettimeofday function itself may take
  longer to run.
- If no timers are used, gettimeofday function will return -1 and
  set errno to ENOSYS.

`times` function returns time derived from FreeRTOS ticks. It reports all as 'system' time, 'user' time is reported as zero.

`settimeofday` function may be used to set current time.

LwIP SNTP module is hooked up into the system through `settimeofday`/`gettimeofday`.

Example demonstrating this functionality is also added.

ref. TW6415

See merge request !168


Trivial merge