1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #10150 from fedepell/arduino_2

sys/arduino: add arduino time functions micros() and delayMicroseconds()
This commit is contained in:
Kevin "Bear Puncher" Weiss 2018-10-16 08:46:10 +02:00 committed by GitHub
commit f376b46691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -62,6 +62,16 @@ void delay(unsigned long msec)
xtimer_usleep(1000 * msec);
}
void delayMicroseconds(unsigned long usec)
{
xtimer_usleep(usec);
}
unsigned long micros()
{
return xtimer_now_usec();
}
/*
* Bitfield for the state of the ADC-channels.
* 0: Not initialized

View File

@ -89,6 +89,20 @@ int digitalRead(int pin);
*/
void delay(unsigned long msec);
/**
* @brief Sleep for a given amount of time [microseconds]
*
* @param[in] usec number of microseconds to sleep
*/
void delayMicroseconds(unsigned long usec);
/**
* @brief Returns the number of microseconds since start
*
* @return value of microseconds since start
*/
unsigned long micros();
/**
* @brief Read the current value of the given analog pin
*