Naze32 clone with Frysky receiver
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.

main.c 471B

12345678910111213141516171819202122232425262728
  1. /*
  2. * main() method
  3. */
  4. #include <avr/interrupt.h>
  5. #include <avr/wdt.h>
  6. #include "spi.h"
  7. #include "timer.h"
  8. #include "rx.h"
  9. void watchdogBoot(void) __attribute__((naked)) __attribute__((section(".init3")));
  10. void watchdogBoot(void) {
  11. MCUSR = 0;
  12. wdt_disable();
  13. }
  14. void main(void) {
  15. timerInit();
  16. sei(); // Enable interrupts (required for timer)
  17. spiInit();
  18. wdt_enable(WDTO_120MS); // Trigger Watchdog after 120ms
  19. rxInit();
  20. for(;;) { }
  21. }