Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

override_wiring.c 406B

12345678910111213141516171819202122232425262728
  1. /*
  2. * To keep Timer0 for common/timer.c override arduino/wiring.c.
  3. */
  4. #include <util/delay.h>
  5. #include "common/timer.h"
  6. #include "Arduino.h"
  7. unsigned long millis()
  8. {
  9. return timer_read();
  10. }
  11. unsigned long micros()
  12. {
  13. return timer_read() * 1000UL;
  14. }
  15. void delay(unsigned long ms)
  16. {
  17. _delay_ms(ms);
  18. }
  19. void delayMicroseconds(unsigned int us)
  20. {
  21. _delay_us(us);
  22. }
  23. void init()
  24. {
  25. timer_init();
  26. }