* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
* Copyright 1999, 2001 Bernardo Innocenti <bernie@develer.com>
- * This file is part of DevLib - See devlib/README for information.
+ * This file is part of DevLib - See README.devlib for information.
* -->
* \brief X-Modem serial transmission protocol (implementation)
*
* \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.9 2005/11/04 16:20:02 bernie
+ *#* Fix reference to README.devlib in header.
+ *#*
+ *#* 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.
*/
}
}
+
/*!
* \brief Receive a file using the XModem protocol.
*
*/
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;
*/
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;