From: Michael Gernoth Date: Mon, 23 Aug 2010 10:19:05 +0000 (+0200) Subject: start implementing power/reset handling as needed on PCs X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rsbs2/commitdiff_plain/19d56e392f87341e7abb26639e9b257aa78d4c92?ds=sidebyside start implementing power/reset handling as needed on PCs --- diff --git a/bmc/chassis.c b/bmc/chassis.c index fd48866..1b6822e 100644 --- a/bmc/chassis.c +++ b/bmc/chassis.c @@ -3,10 +3,66 @@ #include "chassis.h" +#ifdef __AVR_ATmega16__ +#define CHASSISPORT B +#define POWER_PIN 0 +#define RESET_PIN 1 +#define ACTIVE_LOW +#else +#error "Please add chassis power/reset-PIN information for this chip" +#endif + +#define __CPORT(port) PORT##port +#define _CPORT(port) __CPORT(port) +#define CPORT _CPORT(CHASSISPORT) + +#define __CDDR(port) DDR##port +#define _CDDR(port) __CDDR(port) +#define CDDR _CDDR(CHASSISPORT) + +static void chassis_set_pins(uint8_t pins, uint8_t state); + void chassis_init() { - DDRB = 0xff; - PORTB = 0xff; + chassis_set_pins((1<