]> cvs.zerfleddert.de Git - rsbs2/blame - bmc/bmc.c
supermicro-kvm: handle redirects to https
[rsbs2] / bmc / bmc.c
CommitLineData
d6f38d0d 1#include <avr/io.h>
99e4226b 2#include <avr/interrupt.h>
f9d5c6e0 3#include <avr/sleep.h>
da7751cb 4#include <string.h>
d6f38d0d
MG
5#include <stdio.h>
6#include "usart.h"
99e4226b 7#include "i2c.h"
da7751cb
MG
8#include "ipmb.h"
9#include "chassis.h"
77ad1a84
MG
10#include "bmc.h"
11
18037a5a 12#undef SLEEP_MODE
8efcc40e 13
d6f38d0d
MG
14int main(void)
15{
45320371 16 unsigned char buf[24];
da7751cb 17 unsigned int len;
d6f38d0d 18
8efcc40e
MG
19 set_sleep_mode(SLEEP_MODE_IDLE);
20
038e5194
MG
21 chassis_init();
22 usart_init();
99e4226b 23 sei();
038e5194 24 i2c_init();
d6f38d0d 25
d6f38d0d 26 while(1) {
da7751cb 27 cli();
8efcc40e 28 while (i2c_done) {
da7751cb
MG
29 len = i2c_len;
30 memcpy(buf, (unsigned char*)i2c_databuf, len);
31 i2c_done = 0x00;
8efcc40e 32 sei();
da7751cb
MG
33
34 decode_ipmb_pkt(buf, len);
8efcc40e
MG
35
36 cli();
da7751cb 37 }
8efcc40e
MG
38
39#ifdef SLEEP_MODE
40 sleep_enable();
41#endif
42 sei();
43#ifdef SLEEP_MODE
44 sleep_cpu();
45 sleep_disable();
46#endif
d6f38d0d
MG
47 }
48
49 return 0;
50}
Impressum, Datenschutz