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.
2 parents 0ba541d + ec7a3fe commit 9b8d648Copy full SHA for 9b8d648
ports/esp32s2/supervisor/port.c
@@ -118,7 +118,8 @@ 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 * 2) / 71;
123
if (subticks != NULL) {
124
*subticks = all_subticks % 32;
125
}
0 commit comments