From 459a5ed6343d981705f2038fbbc110641452ca63 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 7 Aug 2013 16:34:31 +0200 Subject: [PATCH] Clarify the documentation of dinget and dinwatch commands - document what 0 and 1 means. --- commands/cmd_din.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/commands/cmd_din.c b/commands/cmd_din.c index 80425db..d9f616e 100644 --- a/commands/cmd_din.c +++ b/commands/cmd_din.c @@ -252,22 +252,26 @@ cmd_des_t const cmd_des_din_setup={ /** Command descriptor for din state command */ cmd_des_t const cmd_des_din_get={ 0, 0, - "dinget*","Read a value from DIN pin (with the default treshold)", /* TODO add a command for reading with a treshold */ + "dinget*","Read the open/close status of a DIN pin (with the default treshold)", /* TODO add a command for reading with a treshold */ "=== Command syntax ===\n" "\n" " dinget\n" + "\n" "where PIN is a number in range 0-15\n" "\n" "=== Description ===\n" "\n" - "The command reads and prints a logical value (0 or 1) from a DIN pin.\n" + "The command reads and prints the status of the DIN pin. Value 0 means\n" + "switch is open, value 1 means switch is closed. The mapping between\n" + "the DIN voltage and the open/close status depends on the setup of the\n" + "pin (see dinsetup command).\n" "\n" "=== Example ===\n" "\n" " --> dinget1\n" " dinget1 =0\n" "\n" - "Prints the value of the DIN1 pin.\n", + "DIN1 is in open state.\n", CMD_HANDLER(cmd_do_din_get), (void *)&cmd_list_din }; @@ -298,19 +302,30 @@ cmd_des_t const cmd_des_din_diag={ /** Command descriptor for din state command */ cmd_des_t const cmd_des_din_watch={ 0, 0, - "dinwatch","Watch values from DIN pins", + "dinwatch","Watch status of all DIN pins", "=== Command syntax ===\n" "\n" " dinwatch\n" "\n" "=== Description ===\n" "\n" - "The command reads and prints the values of DIN pins every 100\n" - "milliseconds. Press any key to end this command.\n" + "The command reads and prints the status of DIN pins every 100\n" + "milliseconds. Columns 0-15 correspond to open/close status of DIN pins\n" + "with the default threshold of 4 V, columns A-H represent the logical\n" + "values of pins DIN8-15 when read with programmable threshold.\n" + "Pin status (open=0, close=1) depends on the pin setup that can be\n" + "changed with dinsetup command, programmable threshold can be set with\n" + "TODO command.\n" + "\n" + "Press any key to end this command.\n" "\n" "=== Example ===\n" "\n" - " --> dinwatch\n", + " --> dinwatch\n" + " Digital Inputs Test [0-15]:\n" + " ===========================================================\n" + " 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A B C D E F G H\n" + " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1\n", CMD_HANDLER(cmd_do_din_watch), (void *)&cmd_list_din }; -- 2.39.2