From: Keith Packard Date: Fri, 12 Aug 2011 12:42:05 +0000 (-0700) Subject: altos: add the 'L' command to show the status of a linked companion board X-Git-Tag: 0.9.6.0~15 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=aa642cf55c43188e9a21198d828d7ea90ff54280 altos: add the 'L' command to show the status of a linked companion board This prints out whether there is a board connected, along with the various values fetched from it. Signed-off-by: Keith Packard --- diff --git a/src/ao_companion.c b/src/ao_companion.c index e2e6d05a..b424dd89 100644 --- a/src/ao_companion.c +++ b/src/ao_companion.c @@ -85,6 +85,15 @@ ao_companion(void) void ao_companion_status(void) __reentrant { + uint8_t i; + printf("Companion running: %d\n", ao_companion_running); + printf("device: %d\n", ao_companion_setup.board_id); + printf("update period: %d\n", ao_companion_setup.update_period); + printf("channels: %d\n", ao_companion_setup.channels); + printf("data:"); + for(i = 0; i < ao_companion_setup.channels; i++) + printf(" %5u", ao_companion_data[i]); + printf("\n"); } __code struct ao_cmds ao_companion_cmds[] = { @@ -102,6 +111,5 @@ ao_companion_init(void) COMPANION_CS_SEL &= ~COMPANION_CS_MASK; /* set CS pins as GPIO */ ao_cmd_register(&ao_companion_cmds[0]); - ao_add_task(&ao_companion_task, ao_companion, "companion"); }