1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

atusb/fw/usb/: adapted DFU engine to current stack and abstracted Flash ops

- dfu.c: updated includes
- dfu.c (device_descriptor): renamed USB IDs from USB_VENDOR/PRODUCT to
  DFU_USB_VENDOR/PRODUCT to allow differentiation
- dfu.c: changed all __bit to "int"
- dfu.c: removed all __xdata and __reentrant
- dfu.c: changed "ep0" to "eps[0]"
- dfu.c (payload, flash_erase_page, flash_write_byte, block_write,
  block_receive, block_transmit, my_setup): abstracted Flash interface
  and removed target-specific operations
- dfu.h: added prototypes for target-specific Flash operations
- dfu,c (my_setup, my_descr): removed SDCC-specific hacks
- dfu.c (my_reset): commented out - did we actually use this ?
This commit is contained in:
Werner Almesberger
2011-03-08 19:10:58 -03:00
parent fb2204ad84
commit f91738c306
2 changed files with 40 additions and 83 deletions

View File

@@ -1,8 +1,8 @@
/*
* boot/dfu.h - DFU protocol constants and data structures
*
* Written 2008 by Werner Almesberger
* Copyright 2008 Werner Almesberger
* Written 2008, 2011 by Werner Almesberger
* Copyright 2008, 2011 Werner Almesberger
*
* 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
@@ -81,6 +81,12 @@ struct dfu {
extern struct dfu dfu;
void flash_start(void);
int flash_can_write(uint16_t size);
void flash_write(const uint8_t *buf, uint16_t size);
uint16_t flash_read(uint8_t *buf, uint16_t size);
void dfu_init(void);
#endif /* !DFU_H */