X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-test-sw.git/blobdiff_plain/2f8a0b6c77bad54eb2b02c987d9e05e457ff73d8..8c589d92ba6980eef06751c8be24fe70c28cbc45:/rpp-test-sw/commands/cmd_lout.c diff --git a/rpp-test-sw/commands/cmd_lout.c b/rpp-test-sw/commands/cmd_lout.c index 6922fea..de452e0 100644 --- a/rpp-test-sw/commands/cmd_lout.c +++ b/rpp-test-sw/commands/cmd_lout.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Czech Technical University in Prague + * Copyright (C) 2012-2013, 2016 Czech Technical University in Prague * * Created on: 28.2.2013 * @@ -26,7 +26,6 @@ #include "rpp/rpp.h" #include "cmdproc_utils.h" -#include "drv/drv.h" /** * @brief Set digital value to LOUT pin @@ -40,20 +39,20 @@ int cmd_do_lout_set(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) { int pin; char *p = param[1]; - char spareParams; + char spareParams[2]; int val; int ret; - if (sscanf(p, "%d %d %1s", &pin, &val, &spareParams) != 2) + if (sscanf(p, "%d %d %1s", &pin, &val, spareParams) != 2) return -CMDERR_BADPAR; ret = rpp_lout_set(pin, val); if (ret == -1) { - rpp_sci_printf("Pin out of range."); + rpp_sci_printf("Pin out of range.\n"); return -CMDERR_BADPAR; } if (rpp_lout_update() == FAILURE) { - rpp_sci_printf("LOUT update failed."); + rpp_sci_printf("LOUT update failed.\n"); return -CMDERR_EIO; } @@ -72,20 +71,20 @@ int cmd_do_lout_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) { int pin; char *p = param[1]; - char spareParams; + char spareParams[2]; int ret; - if (sscanf(p, "%d %1s", &pin, &spareParams) != 1) + if (sscanf(p, "%d %1s", &pin, spareParams) != 1) return -CMDERR_BADPAR; if (rpp_lout_update() == FAILURE) { - rpp_sci_printf("LOUT update failed."); + rpp_sci_printf("LOUT update failed.\n"); return -CMDERR_EIO; } ret = rpp_lout_diag(pin); if (ret == -1) { - rpp_sci_printf("Pin out of range."); + rpp_sci_printf("Pin out of range.\n"); return -CMDERR_BADPAR; } @@ -114,10 +113,12 @@ cmd_des_t const cmd_des_lout_set = { "### Example ###\n" "\n" " --> loutset1 1\n" + " loutset1 =1\n" "\n" "Sets LOUT1 to 1.\n" "\n" " --> loutset2 0\n" + " loutset2 =0\n" "\n" "Sets LOUT2 to 0.\n", CMD_HANDLER(cmd_do_lout_set), (void *)&cmd_list_lout