From: asterix Date: Thu, 2 Apr 2009 08:11:20 +0000 (+0000) Subject: Some fix and paste. Use putchar instead a write in protocol module. X-Git-Tag: 2.1.0~220 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ee3a4e534d8c013ef12d932e5325f62d128d00d8;p=bertos.git Some fix and paste. Use putchar instead a write in protocol module. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2462 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/sipo.c b/bertos/drv/sipo.c index cb821692..44bbffe5 100644 --- a/bertos/drv/sipo.c +++ b/bertos/drv/sipo.c @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2008 Develer S.r.l. (http://www.develer.com/) + * Copyright 2009 Develer S.r.l. (http://www.develer.com/) * * --> * @@ -34,10 +34,11 @@ * * \brief SIPO Module * - * The SIPO module trasform a serial input in + * The SIPO module transforms a serial input in * a parallel output. Please check hw_sipo.h - * file to customize hardware relative parameters. + * file to customize hardware related parameters. * + * \author Andrea Grandi * \author Daniele Basile */ @@ -68,8 +69,7 @@ INLINE void sipo_putchar(uint8_t c) } /** - * Write a buffer into sipo register and when finish to - * we load it. + * Write a buffer into the sipo register and, when finished, give a load pulse. */ static size_t sipo_write(UNUSED_ARG(struct KFile *, fd), const void *_buf, size_t size) { @@ -77,11 +77,11 @@ INLINE void sipo_putchar(uint8_t c) size_t write_len = size; ASSERT(buf); - // Load into shift register all byte in buffer + // Load into the shift register all the buffer bytes while(size--) sipo_putchar(*buf++); - // We finsh to load bytes into shift register, load it. + // We have just finished to shift the bytes into the register, now load them. SIPO_LOAD(); return write_len; @@ -96,10 +96,10 @@ void sipo_init(Sipo *fd) memset(fd, 0, sizeof(Sipo)); - //Set kfile struct type as a generic kfile structure. + //Set kfile struct type as a Sipo structure. DB(fd->fd._type = KFT_SIPO); - // Set up data flash programming functions. + // Set up SIPO writing functions. fd->fd.write = sipo_write; SIPO_INIT_PIN(); diff --git a/bertos/drv/sipo.h b/bertos/drv/sipo.h index ab5100f4..165c21ed 100644 --- a/bertos/drv/sipo.h +++ b/bertos/drv/sipo.h @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2008 Develer S.r.l. (http://www.develer.com/) + * Copyright 2009 Develer S.r.l. (http://www.develer.com/) * * --> * @@ -35,6 +35,7 @@ * * \version $Id$ * + * \author Andrea Grandi * \author Daniele Basile */ diff --git a/bertos/hw/hw_sipo.h b/bertos/hw/hw_sipo.h index 0ac56ba7..82dce488 100644 --- a/bertos/hw/hw_sipo.h +++ b/bertos/hw/hw_sipo.h @@ -26,8 +26,8 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2006, 2008 Develer S.r.l. (http://www.develer.com/) - * Copyright 2000 Bernardo Innocenti + * Copyright 2003, 2004, 2006, 2008, 2009 Develer S.r.l. (http://www.develer.com/) + * Copyright 2000 Bernie Innocenti * All Rights Reserved. * --> * @@ -36,6 +36,7 @@ * * \version $Id$ * + * \author Andrea Grandi * \author Daniele Basile */ @@ -46,8 +47,8 @@ /** - * Define the procedure to set one bit low/hight to - * serial input in sipo device. + * Define the macros needed to set the serial input bit of SIPO device + * low or high. */ #define SIPO_SI_HIGH()/* Implement me! */ #define SIPO_SI_LOW() /* Implement me! */ @@ -70,7 +71,7 @@ /** - * Do anything that needed to init sipo pins. + * Do everything needed in order to init the SIPO pins. */ #define SIPO_INIT_PIN() \ do { \ diff --git a/examples/triface/hw/hw_sipo.h b/examples/triface/hw/hw_sipo.h index 70136b52..f31497f2 100644 --- a/examples/triface/hw/hw_sipo.h +++ b/examples/triface/hw/hw_sipo.h @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/) + * Copyright 2003, 2004, 2006, 2009 Develer S.r.l. (http://www.develer.com/) * Copyright 2000 Bernie Innocenti * * --> @@ -36,6 +36,7 @@ * * \version $Id$ * + * \author Andrea Grandi * \author Daniele Basile */ @@ -62,8 +63,8 @@ #define OE_LOW (PORTG &= BV(PG3)) /** - * Define the procedure to set one bit low/hight to - * serial input in sipo device. + * Define the macros needed to set the serial input bit of SIPO device + * low or high. */ #define SIPO_SI_HIGH() SOUT_OUT_HIGH #define SIPO_SI_LOW() SOUT_OUT_LOW @@ -94,7 +95,7 @@ /** - * Do anything that needed to init sipo pins. + * Do everything needed in order to init the SIPO pins. */ #define SIPO_INIT_PIN() \ do { \ diff --git a/examples/triface/protocol.c b/examples/triface/protocol.c index 156a414b..397e8d0b 100644 --- a/examples/triface/protocol.c +++ b/examples/triface/protocol.c @@ -283,7 +283,7 @@ MAKE_CMD(ping, "", "", /* Dout */ MAKE_CMD(dout, "d", "", ({ - kfile_write(&fd_sipo.fd, (uint8_t *)&args[1].l, 1); + kfile_putc((uint8_t)&args[1].l, &fd_sipo.fd); //Store status of dout ports. reg_status_dout = (uint8_t)args[1].l;