Naze32 clone with Frysky receiver
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }