]> cvs.zerfleddert.de Git - rsbs2/blame - bmc/bmc.c
ipmb messages from RSBS2 card
[rsbs2] / bmc / bmc.c
CommitLineData
d6f38d0d 1#include <avr/io.h>
7f52e040 2#include <avr/sleep.h>
99e4226b 3#include <avr/interrupt.h>
d6f38d0d
MG
4#include <stdio.h>
5#include "usart.h"
99e4226b 6#include "i2c.h"
77ad1a84
MG
7#include "bmc.h"
8
9void decode_bmc_cmd(unsigned char *buf, int len)
10{
11 int i;
12
13 for(i = 0; i < len; i++) {
14 printf("0x%02x ", buf[i]);
15 }
16
17 printf("\n");
18}
d6f38d0d
MG
19
20int main(void)
21{
d6f38d0d 22 DDRB = 0xff;
7f52e040 23 PORTB = 0xff;
d6f38d0d
MG
24
25 usart_init();
7f52e040
MG
26 printf("\n");
27
99e4226b
MG
28 i2c_init();
29
7f52e040
MG
30 printf("Waiting for I2C...\n");
31
99e4226b 32 sei();
d6f38d0d 33
d6f38d0d 34 while(1) {
7f52e040
MG
35#if 1
36 sleep_mode();
37#endif
d6f38d0d
MG
38 }
39
40 return 0;
41}
Impressum, Datenschutz