From aa642cf55c43188e9a21198d828d7ea90ff54280 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Aug 2011 05:42:05 -0700 Subject: [PATCH] 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 --- src/ao_companion.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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"); } -- 2.30.2