* the GNU General Public License.
*
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2000 Bernardo Innocenti <bernie@codewiz.org>
+ * Copyright 2000 Bernie Innocenti <bernie@codewiz.org>
*
* -->
*
* \author Daniele Basile <asterix@develer.com>
*/
-#include <mware/xmodem.h>
+#include <net/xmodem.h>
#include <cfg/compiler.h>
#include <cfg/debug.h>
#include <cfg/macros.h> /* BV() */
#include <drv/flash_avr.h>
#include "hw/hw_boot.h"
+#include "cfg/cfg_boot.h"
#include <string.h>
int main(void)
{
- KFile fd;
+ FlashAvrKFile flash;
+ SerialKFile ser;
// Set up flash programming functions.
- flash_avr_init(&fd);
+ flash_avr_init(&flash);
IRQ_ENABLE;
kdbg_init();
timer_init();
- kprintf("Bertuccia");
+
+
/* Open the main communication port */
- Serial *host_port = ser_open(CONFIG_SER_HOSTPORT);
- ser_setbaudrate(host_port, CONFIG_SER_HOSTPORTBAUDRATE);
- xmodem_recv(host_port, &fd);
- fd.close(&fd);
+ ser_init(&ser, CONFIG_SER_HOSTPORT);
+ ser_setbaudrate(&ser, CONFIG_SER_HOSTPORTBAUDRATE);
+
+ xmodem_recv(&ser, &flash.fd);
+ kfile_close(&flash.fd);
+ kfile_close(&ser.fd);
IRQ_DISABLE;
BOOT_END;
START_APP();
+
}
+