]> cvs.zerfleddert.de Git - rsbs2/blobdiff - bmc/bmc.c
beginning i2c
[rsbs2] / bmc / bmc.c
index 06a38290da134ec7f51e1ff00f3ec14a090f1a2d..c786032e092d235dec4240be704dae4eda4c34b6 100644 (file)
--- a/bmc/bmc.c
+++ b/bmc/bmc.c
@@ -1,24 +1,33 @@
-#define F_CPU 1000000UL\r
-\r
-#include <avr/io.h>\r
-\r
-int main(void)\r
-{\r
-       uint8_t pb = 0x00;\r
-       int8_t dir = 1;\r
-       volatile uint16_t i;\r
-\r
-       DDRB = 0xff;\r
-\r
-       while(1) {\r
-               pb += dir;\r
-               PORTB = pb;\r
-\r
-               for (i = 0; i < (pb<<5); i++) {}\r
-\r
-               if ((pb == 0) || (pb == 0xff))\r
-                       dir = -dir;\r
-       }\r
-\r
-       return 0;\r
-}\r
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <stdio.h>
+#include "usart.h"
+#include "i2c.h"
+
+int main(void)
+{
+       uint8_t pb = 0x00;
+       int8_t dir = 1;
+       volatile uint16_t i;
+
+       DDRB = 0xff;
+
+       usart_init();
+       i2c_init();
+
+       sei();
+
+       printf("Hallo!\n");
+
+       while(1) {
+               pb += dir;
+               PORTB = pb;
+
+               for (i = 0; i < (pb<<5); i++) {}
+
+               if ((pb == 0) || (pb == 0xff))
+                       dir = -dir;
+       }
+
+       return 0;
+}
Impressum, Datenschutz