summaryrefslogtreecommitdiff
path: root/protocol/usb_hid/override_wiring.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocol/usb_hid/override_wiring.c')
-rw-r--r--protocol/usb_hid/override_wiring.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/protocol/usb_hid/override_wiring.c b/protocol/usb_hid/override_wiring.c
new file mode 100644
index 0000000000..3b3f5e3028
--- /dev/null
+++ b/protocol/usb_hid/override_wiring.c
@@ -0,0 +1,28 @@
+/*
+ * To keep Timer0 for common/timer.c override arduino/wiring.c.
+ */
+#include <util/delay.h>
+#include "common/timer.h"
+#include "Arduino.h"
+
+
+unsigned long millis()
+{
+ return timer_read32();
+}
+unsigned long micros()
+{
+ return timer_read32() * 1000UL;
+}
+void delay(unsigned long ms)
+{
+ _delay_ms(ms);
+}
+void delayMicroseconds(unsigned int us)
+{
+ _delay_us(us);
+}
+void init()
+{
+ timer_init();
+}