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

atusb/fw/: flash a boot loader instead of the application (in progress)

- boot.c: basic boot loader that runs DFU for 2 s, then starts the payload
- board.h (DFU_USB_VENDOR, DFU_USB_PRODUCT): added USB IDs for DFU
- flash.c: stubs for board-specific Flash functions
- Makefile: build boot.hex for the boot loader
- Makefile (prog): load the boot loader at its rightful place
- Makefile (prog): also set hfuse and the lock fuse
This commit is contained in:
Werner Almesberger
2011-03-09 00:41:32 -03:00
parent f91738c306
commit e8bed1f3c1
4 changed files with 141 additions and 7 deletions

46
atusb/fw/flash.c Normal file
View File

@@ -0,0 +1,46 @@
/*
* fw/flash.c - Board-specific flash functions
*
* Written 2011 by Werner Almesberger
* Copyright 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <stdint.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 8000000UL
#include <util/delay.h>
#include "dfu.h"
#include "board.h"
void flash_start(void)
{
}
int flash_can_write(uint16_t size)
{
return 0;
}
void flash_write(const uint8_t *buf, uint16_t size)
{
}
uint16_t flash_read(uint8_t *buf, uint16_t size)
{
return 0;
}