Skip to content

Commit 04d7559

Browse files
committed
Add millis() and fix warnings
1 parent d8aa726 commit 04d7559

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

cores/arduino/Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ inline void NVIC_SystemReset() {}
3030
#define Stream MbedStream
3131
#include "mbed.h"
3232
#undef PinMode
33-
#undef String
33+
#undef Stream
3434
#endif
3535

3636
#define PinMode ArduinoPinMode

cores/arduino/api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/home/martino/ArduinoCore-API/api
1+
/home/martino/Arduino/hardware/arduino-git/ArduinoCore-API/api/

cores/arduino/wiring.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222

2323
#include "wiring_private.h"
2424

25-
unsigned long millis()
25+
inline unsigned long millis()
2626
{
27+
return us_ticker_read() / 1000L;
2728
}
2829

29-
unsigned long micros() {
30+
inline unsigned long micros() {
31+
return us_ticker_read();
3032
}
3133

3234
void delay(unsigned long ms)

cores/arduino/wiring_digital.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ void pinMode(uint8_t pin, PinMode mode)
3939
case INPUT_PULLUP:
4040
gpio_init_inout(&gpio[pin], (PinName)pin, PIN_INPUT, PullUp, 0);
4141
break;
42+
case INPUT_PULLDOWN:
43+
gpio_init_inout(&gpio[pin], (PinName)pin, PIN_INPUT, PullDown, 0);
44+
break;
4245
}
4346
}
4447

0 commit comments

Comments
 (0)