Skip to content

Fix prototypes to strictly match Arduino API #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cores/arduino/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern "C" {
/** Tick Counter united by ms */
static volatile uint32_t _ulTickCount=0 ;

uint32_t millis( void )
unsigned long millis( void )
{
// todo: ensure no interrupts
return _ulTickCount ;
Expand All @@ -36,7 +36,7 @@ uint32_t millis( void )
// Theory: repeatedly take readings of SysTick counter, millis counter and SysTick interrupt pending flag.
// When it appears that millis counter and pending is stable and SysTick hasn't rolled over, use these
// values to calculate micros. If there is a pending SysTick, add one to the millis counter in the calculation.
uint32_t micros( void )
unsigned long micros( void )
{
uint32_t ticks, ticks2;
uint32_t pend, pend2;
Expand All @@ -61,7 +61,7 @@ uint32_t micros( void )
// a runtime multiplication and shift, saving a few cycles
}

void delay( uint32_t ms )
void delay( unsigned long ms )
{
if ( ms == 0 )
{
Expand Down
10 changes: 5 additions & 5 deletions cores/arduino/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
*
* \return Number of milliseconds since the program started (uint32_t)
*/
extern uint32_t millis( void ) ;
extern unsigned long millis( void ) ;

/**
* \brief Returns the number of microseconds since the Arduino board began running the current program.
Expand All @@ -45,23 +45,23 @@ extern uint32_t millis( void ) ;
*
* \note There are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second.
*/
extern uint32_t micros( void ) ;
extern unsigned long micros( void ) ;

/**
* \brief Pauses the program for the amount of time (in miliseconds) specified as parameter.
* (There are 1000 milliseconds in a second.)
*
* \param dwMs the number of milliseconds to pause (uint32_t)
*/
extern void delay( uint32_t dwMs ) ;
extern void delay( unsigned long dwMs ) ;

/**
* \brief Pauses the program for the amount of time (in microseconds) specified as parameter.
*
* \param dwUs the number of microseconds to pause (uint32_t)
*/
static __inline__ void delayMicroseconds( uint32_t ) __attribute__((always_inline, unused)) ;
static __inline__ void delayMicroseconds( uint32_t usec )
static __inline__ void delayMicroseconds( unsigned int ) __attribute__((always_inline, unused)) ;
static __inline__ void delayMicroseconds( unsigned int usec )
{
if ( usec == 0 )
{
Expand Down