1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include "bootapp.h"
- #include <avr/pgmspace.h>
- #include <avr/wdt.h>
- #include <avr/interrupt.h>
- void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size)
- {
- cli();
- boot_app_magic = BOOT_APP_MAGIC;
- boot_app_flags |= BOOT_APP_FLG_COPY;
- boot_app_flags |= BOOT_APP_FLG_ERASE;
- boot_copy_size = (uint16_t)size;
- boot_src_addr = (uint32_t)rptr;
- boot_dst_addr = (uint32_t)fptr;
- wdt_enable(WDTO_15MS);
- while(1);
- }
- void bootapp_reboot_user0(uint8_t reserved)
- {
- cli();
- boot_app_magic = BOOT_APP_MAGIC;
- boot_app_flags = BOOT_APP_FLG_USER0;
- boot_reserved = reserved;
- wdt_enable(WDTO_15MS);
- while(1);
- }
|