]> git.zerfleddert.de Git - rsbs2/blob - bmc/chassis.c
remove DEBUG printouts from non-debug build
[rsbs2] / bmc / chassis.c
1 #include <avr/io.h>
2 #include <stdio.h>
3
4 #include "chassis.h"
5
6 void chassis_init()
7 {
8 DDRB = 0xff;
9 PORTB = 0xff;
10 }
11
12 void chassis_control(unsigned char action)
13 {
14 #ifdef DEBUG
15 printf("Chassis control 0x%02x\n", action);
16 #endif
17
18 switch(action) {
19 case CHASSIS_ACTION_POWER_DOWN:
20 PORTB=0xff;
21 break;
22
23 case CHASSIS_ACTION_POWER_UP:
24 PORTB=0x00;
25 break;
26
27 case CHASSIS_ACTION_HARD_RESET:
28 PORTB=0x55;
29 break;
30
31 default:
32 #ifdef DEBUG
33 printf("Unimplemented chassis action 0x%02x\n", action);
34 #endif
35 break;
36 }
37 }
Impressum, Datenschutz