nuttx
nuttx copied to clipboard
driver/note: To support clock_gettime for CPU sleep scenario
Note: Please adhere to Contributing Guidelines.
Summary
In the current code, the note module gets the time from perf_gettime(). When encountering instructions such as idle WFI, the CPU cycle will not continue to grow, resulting in time distortion. Support note to obtain time from clock_gettime() to support scenarios when the CPUis sleeping.
Impact
The note module obtains time from perf_gettime() by default. Add configuration to support obtaining time from clock_gettime().
Testing
Test environment
- CPU: X280 (RISCV)
- Compiler: gcc
- Target: When encountering WFI instruction CPU sleep, note can get the correct time