Skip to content

Commit fee85f6

Browse files
fix(misc): Use 64 bit return value for micros()
1 parent 57eb645 commit fee85f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cores/esp32/esp32-hal-misc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ BaseType_t xTaskCreateUniversal(
191191
#endif
192192
}
193193

194-
unsigned long ARDUINO_ISR_ATTR micros() {
195-
return (unsigned long)(esp_timer_get_time());
194+
unsigned long long ARDUINO_ISR_ATTR micros() {
195+
return (unsigned long long)(esp_timer_get_time());
196196
}
197197

198198
unsigned long ARDUINO_ISR_ATTR millis() {

cores/esp32/esp32-hal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ BaseType_t xTaskCreateUniversal(
121121
TaskHandle_t *const pxCreatedTask, const BaseType_t xCoreID
122122
);
123123

124-
unsigned long micros();
124+
unsigned long long micros();
125125
unsigned long millis();
126126
void delay(uint32_t);
127127
void delayMicroseconds(uint32_t us);

0 commit comments

Comments
 (0)