]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blobdiff - rpp-test-sw/commands/cmd_lout.c
Update library
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / commands / cmd_lout.c
index 4509b66fc32d33044ba4c2949a9c1a19862d03c1..c884b04ab4da0fb408f1c28bb5c4784dcc637c31 100644 (file)
@@ -6,23 +6,15 @@
  * Authors:
  *     - Michal Horn
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
  *
  * File : cmd_lout.c
  *
  * Abstract:
- *     This file contains commands for testing LOUT (8x100mA Digital output).
+ *      This file contains commands for testing LOUT (8x100mA Digital output).
  *
  */
 
@@ -34,7 +26,6 @@
 
 #include "rpp/rpp.h"
 #include "cmdproc_utils.h"
-#include "drv/drv.h"
 
 /**
  * @brief Set digital value to LOUT pin
  * @param[in]  param   Parameters of command
  * @return 0 when OK or error code lower than 0
  */
-int cmd_do_lout_set(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_lout_set(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int pin;
-       char *p=param[1];
+       char *p = param[1];
        char spareParams;
        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.");
@@ -76,15 +67,15 @@ int cmd_do_lout_set(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
  * @param[in]  param   Parameters of command
  * @return 0 when OK or error code lower than 0
  */
-int cmd_do_lout_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_lout_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int pin;
-       char *p=param[1];
+       char *p = param[1];
        char spareParams;
        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.");
@@ -101,10 +92,10 @@ int cmd_do_lout_diag(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
        return 0;
 }
 
-#endif /* DOCGEN */
+#endif  /* DOCGEN */
 
 /** Command descriptor for lout set port value */
-cmd_des_t const cmd_des_lout_set={
+cmd_des_t const cmd_des_lout_set = {
        0, 0,
        "loutset*","Set a value of the LOUT pin",
        "### Command syntax ###\n"
@@ -132,7 +123,7 @@ cmd_des_t const cmd_des_lout_set={
 };
 
 /** Command descriptor for lout get pin diag value */
-cmd_des_t const cmd_des_lout_diag={
+cmd_des_t const cmd_des_lout_diag = {
        0, 0,
        "loutdiag*","Read a diagnostic value from an LOUT pin",
        "### Command syntax ###\n"
@@ -155,8 +146,8 @@ cmd_des_t const cmd_des_lout_diag={
 
 
 /** List of commands for hout, defined as external */
-cmd_des_t const *cmd_list_lout[]={
-  &cmd_des_lout_set,
-  &cmd_des_lout_diag,
-  NULL
+cmd_des_t const *cmd_list_lout[] = {
+       &cmd_des_lout_set,
+       &cmd_des_lout_diag,
+       NULL
 };