Skip to content

Commit 7db8f70

Browse files
committed
change return type of micros() and millis()
Fixes: espressif#384
1 parent 21ff3d0 commit 7db8f70

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎cores/esp32/esp32-hal-misc.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ void yield()
3030

3131
portMUX_TYPEmicrosMux=portMUX_INITIALIZER_UNLOCKED;
3232

33-
uint32_tIRAM_ATTRmicros()
33+
unsigned longIRAM_ATTRmicros()
3434
{
35-
staticuint32_tlccount=0;
36-
staticuint32_toverflow=0;
37-
uint32_tccount;
35+
staticunsigned longlccount=0;
36+
staticunsigned longoverflow=0;
37+
unsigned longccount;
3838
portENTER_CRITICAL_ISR(&microsMux);
3939
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
4040
if(ccount<lccount){
@@ -45,7 +45,7 @@ uint32_t IRAM_ATTR micros()
4545
returnoverflow+ (ccount / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ);
4646
}
4747

48-
uint32_tIRAM_ATTRmillis()
48+
unsigned longIRAM_ATTRmillis()
4949
{
5050
returnxTaskGetTickCount() *portTICK_PERIOD_MS;
5151
}

‎cores/esp32/esp32-hal.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ void yield(void);
6161
#include"esp32-hal-bt.h"
6262
#include"esp_system.h"
6363

64-
uint32_tmicros();
65-
uint32_tmillis();
64+
unsigned longmicros();
65+
unsigned longmillis();
6666
voiddelay(uint32_t);
6767
voiddelayMicroseconds(uint32_tus);
6868

0 commit comments

Comments
(0)