IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2011-03-11 21:40:51 (13 years 16 days ago) |
---|---|
Author: | Werner Almesberger |
Commit: | c265151d2b24c011fde22d92154ddcb4aa42d318 |
Message: | atusb/fw: introduced function flash_end_write to properly finish
flashing - dfu.h (flash_end_write), flash.c (flash_end_write): write any incomplete buffer - flash.c (flash_write, flash_end_write): call boot_rww_enable only at the very end, it won't erase our buffer in mid-page - usb/dfu.c (my_setup): call flash_end_write at the end of a download |
Files: |
atusb/fw/flash.c (1 diff) atusb/fw/usb/dfu.c (1 diff) atusb/fw/usb/dfu.h (1 diff) |
Change Details
atusb/fw/flash.c | ||
---|---|---|
57 | 57 | boot_spm_busy_wait(); |
58 | 58 | } |
59 | 59 | } |
60 | } | |
61 | ||
60 | 62 | |
63 | void flash_end_write(void) | |
64 | { | |
65 | if (payload & (SPM_PAGESIZE-1)) { | |
66 | boot_page_write(payload & ~(SPM_PAGESIZE-1)); | |
67 | boot_spm_busy_wait(); | |
68 | } | |
61 | 69 | boot_rww_enable(); |
62 | 70 | } |
63 | 71 |
atusb/fw/usb/dfu.c | ||
---|---|---|
192 | 192 | } |
193 | 193 | if (!setup->wLength) { |
194 | 194 | debug("DONE\n"); |
195 | flash_end_write(); | |
195 | 196 | dfu.state = dfuIDLE; |
196 | 197 | did_download = 1; |
197 | 198 | return 1; |
atusb/fw/usb/dfu.h | ||
---|---|---|
84 | 84 | void flash_start(void); |
85 | 85 | int flash_can_write(uint16_t size); |
86 | 86 | void flash_write(const uint8_t *buf, uint16_t size); |
87 | void flash_end_write(void); | |
87 | 88 | uint16_t flash_read(uint8_t *buf, uint16_t size); |
88 | 89 | |
89 | 90 |