summaryrefslogtreecommitdiff
path: root/src/product/ao_flash_task.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-06-24 14:23:53 -0700
committerKeith Packard <keithp@keithp.com>2013-06-24 14:30:22 -0700
commit0dd148e388944d8d265da51d62806c4a00b2c13d (patch)
treee1212b3cbc0d5a77d0fe1d676e07f86fef91a52f /src/product/ao_flash_task.c
parent2568b36ae9d38ae1607ec08b84b06e0fe84bd3ba (diff)
altos/lpc: Add boot loader
Support the USB boot loader, add USB pull-up support. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/product/ao_flash_task.c')
-rw-r--r--src/product/ao_flash_task.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/product/ao_flash_task.c b/src/product/ao_flash_task.c
index fdc4d0aa..4cfbf75f 100644
--- a/src/product/ao_flash_task.c
+++ b/src/product/ao_flash_task.c
@@ -73,7 +73,7 @@ static void
ao_block_erase(void)
{
uint32_t addr = ao_get_hex32();
- uint32_t *p = (uint32_t *) addr;
+ void *p = (void *) addr;
ao_flash_erase_page(p);
}
@@ -82,11 +82,8 @@ static void
ao_block_write(void)
{
uint32_t addr = ao_get_hex32();
- uint32_t *p = (uint32_t *) addr;
- union {
- uint8_t data8[256];
- uint32_t data32[64];
- } u;
+ void *p = (void *) addr;
+ uint8_t data[256];
uint16_t i;
if (addr < (uint32_t) AO_BOOT_APPLICATION_BASE) {
@@ -94,8 +91,8 @@ ao_block_write(void)
return;
}
for (i = 0; i < 256; i++)
- u.data8[i] = ao_usb_getchar();
- ao_flash_page(p, u.data32);
+ data[i] = ao_usb_getchar();
+ ao_flash_page(p, (void *) data);
}
static void