Merge pull request #12116 from maribu/arduino-millis
sys/arduino: Added millis()
This commit is contained in:
commit
f421cb7d9d
@ -59,7 +59,7 @@ int digitalRead(int pin)
|
|||||||
|
|
||||||
void delay(unsigned long msec)
|
void delay(unsigned long msec)
|
||||||
{
|
{
|
||||||
xtimer_usleep(1000 * msec);
|
xtimer_usleep(msec * US_PER_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void delayMicroseconds(unsigned long usec)
|
void delayMicroseconds(unsigned long usec)
|
||||||
@ -72,6 +72,11 @@ unsigned long micros()
|
|||||||
return xtimer_now_usec();
|
return xtimer_now_usec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long millis()
|
||||||
|
{
|
||||||
|
return xtimer_now_usec() / US_PER_MS;
|
||||||
|
}
|
||||||
|
|
||||||
int analogRead(int arduino_pin)
|
int analogRead(int arduino_pin)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -103,6 +103,13 @@ void delayMicroseconds(unsigned long usec);
|
|||||||
*/
|
*/
|
||||||
unsigned long micros();
|
unsigned long micros();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the number of milliseconds since start
|
||||||
|
*
|
||||||
|
* @return value of milliseconds since start
|
||||||
|
*/
|
||||||
|
unsigned long millis();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read the current value of the given analog pin
|
* @brief Read the current value of the given analog pin
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user