]> cvs.zerfleddert.de Git - rsbs2/blobdiff - bmc/bmc.c
working i2c connection to RSBS2-card
[rsbs2] / bmc / bmc.c
index c786032e092d235dec4240be704dae4eda4c34b6..d7c5cdc95ec4d1c4028112f188b6547e7320b081 100644 (file)
--- a/bmc/bmc.c
+++ b/bmc/bmc.c
@@ -1,4 +1,5 @@
 #include <avr/io.h>
+#include <avr/sleep.h>
 #include <avr/interrupt.h>
 #include <stdio.h>
 #include "usart.h"
@@ -6,27 +7,24 @@
 
 int main(void)
 {
-       uint8_t pb = 0x00;
-       int8_t dir = 1;
-       volatile uint16_t i;
-
        DDRB = 0xff;
+       PORTB = 0xff;
 
        usart_init();
+       printf("\n");
+
        i2c_init();
 
+       printf("Waiting for I2C...\n");
+
        sei();
 
-       printf("Hallo!\n");
+       PORTB = 0xff;
 
        while(1) {
-               pb += dir;
-               PORTB = pb;
-
-               for (i = 0; i < (pb<<5); i++) {}
-
-               if ((pb == 0) || (pb == 0xff))
-                       dir = -dir;
+#if 1
+               sleep_mode();
+#endif
        }
 
        return 0;
Impressum, Datenschutz