Skip to content

Commit eed66e7

Browse files
committed
Fix prototypes to strictly match Arduino API
See arduino/Arduino#4525
1 parent 9944119 commit eed66e7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cores/arduino/wiring.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
extern "C" {
2323
#endif
2424

25-
uint32_t millis( void )
25+
unsigned long millis( void )
2626
{
2727
// todo: ensure no interrupts
2828
return GetTickCount() ;
@@ -32,7 +32,7 @@ uint32_t millis( void )
3232
// Theory: repeatedly take readings of SysTick counter, millis counter and SysTick interrupt pending flag.
3333
// When it appears that millis counter and pending is stable and SysTick hasn't rolled over, use these
3434
// values to calculate micros. If there is a pending SysTick, add one to the millis counter in the calculation.
35-
uint32_t micros( void )
35+
unsigned long micros( void )
3636
{
3737
uint32_t ticks, ticks2;
3838
uint32_t pend, pend2;
@@ -72,7 +72,7 @@ uint32_t micros( void )
7272
// }
7373

7474

75-
void delay( uint32_t ms )
75+
void delay( unsigned long ms )
7676
{
7777
if (ms == 0)
7878
return;

cores/arduino/wiring.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern void init( void ) ;
3737
*
3838
* \return Number of milliseconds since the program started (uint32_t)
3939
*/
40-
extern uint32_t millis( void ) ;
40+
extern unsigned long millis( void ) ;
4141

4242
/**
4343
* \brief Returns the number of microseconds since the Arduino board began running the current program.
@@ -49,23 +49,23 @@ extern uint32_t millis( void ) ;
4949
*
5050
* \note There are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second.
5151
*/
52-
extern uint32_t micros( void ) ;
52+
extern unsigned long micros( void ) ;
5353

5454
/**
5555
* \brief Pauses the program for the amount of time (in miliseconds) specified as parameter.
5656
* (There are 1000 milliseconds in a second.)
5757
*
58-
* \param dwMs the number of milliseconds to pause (uint32_t)
58+
* \param ms the number of milliseconds to pause (unsigned long)
5959
*/
60-
extern void delay( uint32_t dwMs ) ;
60+
extern void delay( unsigned long ms ) ;
6161

6262
/**
6363
* \brief Pauses the program for the amount of time (in microseconds) specified as parameter.
6464
*
65-
* \param dwUs the number of microseconds to pause (uint32_t)
65+
* \param dwUs the number of microseconds to pause (unsigned long)
6666
*/
67-
static inline void delayMicroseconds(uint32_t) __attribute__((always_inline, unused));
68-
static inline void delayMicroseconds(uint32_t usec){
67+
static inline void delayMicroseconds(unsigned int) __attribute__((always_inline, unused));
68+
static inline void delayMicroseconds(unsigned int usec){
6969
/*
7070
* Based on Paul Stoffregen's implementation
7171
* for Teensy 3.0 (http://www.pjrc.com/)

0 commit comments

Comments
 (0)