From 17cd185559320a20f09ccb3cd7743b96b79dcc4c Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 4 Apr 2008 20:29:50 +0200 Subject: * digital/io/src, host/inter: - added host support to io. --- digital/io/src/main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'digital/io/src/main.c') diff --git a/digital/io/src/main.c b/digital/io/src/main.c index 7f0fc6eb..bab667e4 100644 --- a/digital/io/src/main.c +++ b/digital/io/src/main.c @@ -31,13 +31,17 @@ /* AVR include, non HOST */ #ifndef HOST # include "main_timer.avr.h" +# include "switch.h" /* Manage switches (jack, color selector) */ #endif /* HOST */ +#include "simu.host.h" + #include "asserv.h" /* Functions to control the asserv board */ -#include "switch.h" /* Manage switches (jack, color selector) */ #include "eeprom.h" /* Parameters loaded/stored in the EEPROM */ #include "trap.h" /* Trap module (trap_* functions) */ +#include "io.h" + /** * Initialize the main and all its subsystems. */ @@ -135,6 +139,12 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) * - 1b: pwm high time value (position). */ servo_set_high_time (args[0], args[1]); + break; + + case c ('S', 0): + /* Report switch states. */ + proto_send1b ('S', switch_get_color () << 1 | switch_get_jack ()); + break; /* EEPROM command */ case c ('e', 1): @@ -165,6 +175,8 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) int main (int argc, char **argv) { + avr_init (argc, argv); + /* Initialize the main and its subsystems */ main_init (); -- cgit v1.2.3