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 448B

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