- add eepromdata.h
[moodlight.git] / main.c
diff --git a/main.c b/main.c
index 8f6f34fe01dbbab7cc9269fe1aae3f68c79f7200..3e66f1a5c5532373de52eb35575138d6d2b907e5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.6 2010/07/10 07:32:08 simimeie Exp $
+/* $Id: main.c,v 1.7 2010/07/24 20:55:48 simimeie Exp $
  * Main file for the HaWo moodlight.
  * This is the main file that glues it all together. It also contains all
  * functionality that is too small to require an extra file.
 #include "ledpwm.h"
 #include "ircontrol.h"
 #include "timers.h"
-/* #include "eepromdata.h" */
-
-uint8_t mcusr_mirror __attribute__ ((section (".noinit")));
-
-/* This is needed to recover from a watchdog reset, as the watchdog
- * stays active after the reset.
- * The variable is just to make the reason of the last reset accessible
- * later. */
-void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));
-void get_mcusr(void) {
-  mcusr_mirror = MCUSR;
-  MCUSR = 0;
-  wdt_disable();
-}
+#include "ledframing.h"
+#include "rfm12.h"
+#include "eepromdata.h"
 
 #define IRSTATE_RED       1
 #define IRSTATE_GREEN     2
@@ -44,15 +33,15 @@ int main(void)
   uint8_t irstate = 0;
   
   /* Load settings from EEPROM */
-#if 0
-  something = eeprom_read_byte(&ee_something);
-#endif /* LEDMODULE */
+  ledpwm_bri = eeprom_read_byte(&ee_defledbrightness);
 
   /* Initialize stuff */
   console_init();
   timers_init();
   ledpwm_init();
+  ledframing_init();
   ircontrol_init();
+  rfm12_init();
   
   wdt_enable(WDTO_2S);
 
@@ -63,13 +52,6 @@ int main(void)
   /* All set up, enable interrupts and go. */
   sei();
   
-  if (mcusr_mirror & _BV(WDRF)) {
-    console_printpgm_P(PSTR("NOTE: last reset was from Watchdog Timer."));
-  }
-  if (mcusr_mirror & _BV(BORF)) {
-    console_printpgm_P(PSTR("NOTE: last reset was from Brownout."));
-  }
-  
   while (1) { /* We should never exit */
     wdt_reset();
     uint8_t k = ircontrol_getlastcommand();
This page took 0.056946 seconds and 4 git commands to generate.