Fix spacing.
[bertos.git] / mware / xmodem.c
index 9041b4cc29ed6bec7b6166a50eecd6a7c891744b..559a0c5df331609be6287dd13209f008450ca802 100755 (executable)
  * \author Bernardo Innocenti <bernie@develer.com>
  */
 
-/*
- * $Log$
- * Revision 1.6  2004/08/15 05:31:46  bernie
- * Add an #error to spread some FUD about the quality of this module;
- * Add a few TODOs from Rasky's review;
- * Update to the new drv/ser.c API;
- * Move FlushSerial() to drv/ser.c and generalize.
- *
- * Revision 1.5  2004/08/12 23:46:21  bernie
- * Remove extra indentation level in switch statements.
- *
- * Revision 1.4  2004/08/12 23:35:50  bernie
- * Replace a handmade loop with memset().
- *
- * Revision 1.3  2004/08/12 23:34:36  bernie
- * Replace if/else with continue to reduce indentation level.
- *
- * Revision 1.2  2004/08/12 23:24:07  bernie
- * Rename UPDCRC() to UPDCRC16().
- *
- * Revision 1.1  2004/08/11 19:54:22  bernie
- * Import XModem protocol into DevLib.
- *
- */
+/*#*
+ *#* $Log$
+ *#* Revision 1.8  2004/08/25 14:12:09  rasky
+ *#* Aggiornato il comment block dei log RCS
+ *#*
+ *#* Revision 1.7  2004/08/15 06:30:06  bernie
+ *#* Make the buffer a local variable, as documented.
+ *#*
+ *#* Revision 1.6  2004/08/15 05:31:46  bernie
+ *#* Add an #error to spread some FUD about the quality of this module;
+ *#* Add a few TODOs from Rasky's review;
+ *#* Update to the new drv/ser.c API;
+ *#* Move FlushSerial() to drv/ser.c and generalize.
+ *#*
+ *#* Revision 1.5  2004/08/12 23:46:21  bernie
+ *#* Remove extra indentation level in switch statements.
+ *#*
+ *#* Revision 1.4  2004/08/12 23:35:50  bernie
+ *#* Replace a handmade loop with memset().
+ *#*
+ *#* Revision 1.3  2004/08/12 23:34:36  bernie
+ *#* Replace if/else with continue to reduce indentation level.
+ *#*
+ *#* Revision 1.2  2004/08/12 23:24:07  bernie
+ *#* Rename UPDCRC() to UPDCRC16().
+ *#*
+ *#* Revision 1.1  2004/08/11 19:54:22  bernie
+ *#* Import XModem protocol into DevLib.
+ *#*
+ *#*/
 
 #include "xmodem.h"
 
 #endif /* ARCH_BOOT */
 
 
-/*! Buffer to hold a block of data */
-static char block_buffer[XM_BUFSIZE];
-
-
 /*!
  * Decode serial driver errors and print them on the display.
  */
@@ -125,6 +127,7 @@ static void print_serial_error(struct Serial *port, int retries)
        }
 }
 
+
 /*!
  * \brief Receive a file using the XModem protocol.
  *
@@ -135,6 +138,7 @@ static void print_serial_error(struct Serial *port, int retries)
  */
 bool xmodem_recv(struct Serial *port, KFile *fd)
 {
+       char block_buffer[XM_BUFSIZE]; /* Buffer to hold a block of data */
        int c, i, blocksize;
        int blocknr = 0, last_block_done = 0, retries = 0;
        char *buf;
@@ -351,6 +355,7 @@ bool xmodem_recv(struct Serial *port, KFile *fd)
  */
 bool xmodem_send(struct Serial *port, KFile *fd)
 {
+       char block_buffer[XM_BUFSIZE]; /* Buffer to hold a block of data */
        size_t size = -1;
        int blocknr = 1, retries = 0, c, i;
        bool proceed, usecrc = false;