From 34764c3924c79a1af978ee38a15d92d56035677e Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Fri, 28 Nov 2008 21:47:34 +0100 Subject: digital/avr/modules/flash: Fix the macros to compute the actual page size. --- digital/avr/modules/flash/test/test-flash.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'digital/avr/modules/flash/test') diff --git a/digital/avr/modules/flash/test/test-flash.c b/digital/avr/modules/flash/test/test-flash.c index 5ccd3b39..a504d6c1 100644 --- a/digital/avr/modules/flash/test/test-flash.c +++ b/digital/avr/modules/flash/test/test-flash.c @@ -86,12 +86,16 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) * - 1b: byte. */ flash_write (addr, args[3]); break; - case c ('p', 3): - /* Find the next page to write. - * - 3b: the start address. */ - addr = flash_sector_next (addr); + case c ('p', 0): + /* Find the next page to write. */ + addr = flash_first_sector (); proto_send3b ('p', addr >> 16, addr >> 8, addr); break; + case c ('c', 3): + /* Compute the next page. */ + addr = FLASH_PAGE (addr); + proto_send3b ('c', addr >> 16, addr >> 8, addr); + break; default: if (cmd == 'w' && size > 4) { -- cgit v1.2.3