We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef87cc3 commit d8bb2d7Copy full SHA for d8bb2d7
ports/esp32s2/supervisor/port.c
@@ -118,11 +118,12 @@ uint32_t port_get_saved_word(void) {
118
uint64_t port_get_raw_ticks(uint8_t* subticks) {
119
struct timeval tv_now;
120
gettimeofday(&tv_now, NULL);
121
- uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 32768;
+ // convert usec back to ticks
122
+ uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 1024;
123
if (subticks != NULL) {
124
*subticks = all_subticks % 32;
125
}
- return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32;
126
+ return (uint64_t)tv_now.tv_sec * 1024L + all_subticks;
127
128
129
// Enable 1/1024 second tick.
0 commit comments