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 d8bb2d7 commit ec7a3feCopy full SHA for ec7a3fe
ports/esp32s2/supervisor/port.c
@@ -119,11 +119,11 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) {
119
struct timeval tv_now;
120
gettimeofday(&tv_now, NULL);
121
// convert usec back to ticks
122
- uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 1024;
+ uint64_t all_subticks = (uint64_t)(tv_now.tv_usec * 2) / 71;
123
if (subticks != NULL) {
124
*subticks = all_subticks % 32;
125
}
126
- return (uint64_t)tv_now.tv_sec * 1024L + all_subticks;
+ return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32;
127
128
129
// Enable 1/1024 second tick.
0 commit comments