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

12345678910111213141516171819202122232425262728293031
  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 "cppm.h"
  9. #include "rx.h"
  10. void watchdogBoot(void) __attribute__((naked)) __attribute__((section(".init3")));
  11. void watchdogBoot(void) {
  12. MCUSR = 0;
  13. wdt_disable();
  14. }
  15. void main(void) {
  16. cppmInit();
  17. timerInit();
  18. sei(); // Enable interrupts (required for timer)
  19. wdt_enable(WDTO_120MS); // Trigger Watchdog after 120ms
  20. spiInit();
  21. rxInit();
  22. for(;;) { }
  23. }