Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7db8f70

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

File tree

Expand file treeCollapse file tree

2 files changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-7
lines changed

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

Copy file name to clipboardExpand all lines: cores/esp32/esp32-hal-misc.c
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ void yield()
3030

3131
portMUX_TYPE microsMux = portMUX_INITIALIZER_UNLOCKED;
3232

33-
uint32_t IRAM_ATTR micros()
33+
unsigned long IRAM_ATTR micros()
3434
{
35-
static uint32_t lccount = 0;
36-
static uint32_t overflow = 0;
37-
uint32_t ccount;
35+
static unsigned long lccount = 0;
36+
static unsigned long overflow = 0;
37+
unsigned long ccount;
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
return overflow + (ccount / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ);
4646
}
4747

48-
uint32_t IRAM_ATTR millis()
48+
unsigned long IRAM_ATTR millis()
4949
{
5050
return xTaskGetTickCount() * portTICK_PERIOD_MS;
5151
}

‎cores/esp32/esp32-hal.h

Copy file name to clipboardExpand all lines: cores/esp32/esp32-hal.h
+2-2Lines 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_t micros();
65-
uint32_t millis();
64+
unsigned long micros();
65+
unsigned long millis();
6666
void delay(uint32_t);
6767
void delayMicroseconds(uint32_t us);
6868

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.