From d32e50b442424aa8c8618763d9f9851527a8555a Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Tue, 21 Oct 2008 22:49:47 +0200 Subject: avr/module/flash: Tested the find next sector. closes #36 * removed the define to increment the addr. * Update the test. --- digital/avr/modules/flash/test/test-flash.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'digital/avr/modules/flash/test/test-flash.c') diff --git a/digital/avr/modules/flash/test/test-flash.c b/digital/avr/modules/flash/test/test-flash.c index 5d1ba0f6..5ccd3b39 100644 --- a/digital/avr/modules/flash/test/test-flash.c +++ b/digital/avr/modules/flash/test/test-flash.c @@ -86,9 +86,10 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) * - 1b: byte. */ flash_write (addr, args[3]); break; - case c ('p', 0): - /* Find the next page to write. */ - addr = flash_sector_next (0); + case c ('p', 3): + /* Find the next page to write. + * - 3b: the start address. */ + addr = flash_sector_next (addr); proto_send3b ('p', addr >> 16, addr >> 8, addr); break; default: @@ -114,11 +115,12 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) int main (void) { + uint8_t status; uart0_init (); proto_send0 ('z'); proto_send0 ('c'); - flash_init (); - proto_send0 ('f'); + status = flash_init (); + proto_send1b ('f', status); while (1) proto_accept (uart0_getc ()); -- cgit v1.2.3