From ee5a468417fb6810a5bbe4d46617618a9ddb588a Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Thu, 7 May 2009 10:07:49 +0200 Subject: * digital/avr/modules/trace: (See #67) * Adapted the trace module to: * Find the last trace in order to start the new one, trace_i = trace_i-1 + 1 * A quarter of the flash is completely erased on the trace init to be used in the future. * Removed the start code useless from now. * tools/trace: * Update the python scripts to use the new trace implementation. --- digital/avr/modules/flash/flash.h | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'digital/avr/modules/flash/flash.h') diff --git a/digital/avr/modules/flash/flash.h b/digital/avr/modules/flash/flash.h index 9f92259a..d1fec1f0 100644 --- a/digital/avr/modules/flash/flash.h +++ b/digital/avr/modules/flash/flash.h @@ -27,15 +27,12 @@ #include "common.h" #include "io.h" -#define FLASH_ADDRESS_HIGH 0x1FFFFF +#define FLASH_SIZE 0x200000 +#define FLASH_ADDRESS_HIGH (FLASH_SIZE - 1) #define FLASH_ADDRESS_ERROR 0xFFFFFF #define FLASH_ADDRESS_INC(val) \ ((val) + 1) & FLASH_ADDRESS_HIGH -#define FLASH_PAGE_SIZE 0x1000 -#define FLASH_PAGE_MASK (FLASH_ADDRESS_HIGH & ~(FLASH_PAGE_SIZE-1)) -#define FLASH_PAGE(val) ((val) & FLASH_PAGE_MASK) - #define FLASH_ERASE_FULL 0x60 #define FLASH_ERASE_4K 0x20 #define FLASH_ERASE_32K 0x52 @@ -53,9 +50,6 @@ #define FLASH_TBP_US 10 -#define FLASH_LOG_CODE 0xF33FF22F -#define FLASH_LOG_CODE_READ 0x2FF23FF3 - enum { FLASH_CMD_INIT, @@ -114,13 +108,6 @@ flash_status_aai (void) uint8_t flash_init (void); -/** Find the first writable sector. - * \param addr the address to start the research. - * \return the address of the next sector. - */ -uint32_t -flash_first_sector (void); - /** Write in the flash byte provided in parameter. * \param data the buffer to store the data. */ @@ -154,9 +141,12 @@ flash_write_array (uint32_t addr, uint8_t *data, uint32_t length); /** Process the logs * \param size the number of arguments. * \param an array of arguments. - * \return true on success. + * \return - 0 on success, + * - 1 flash not initialised + * - 2 flash read error. + * - 3 command not found. */ -uint8_t +int8_t flash_log (uint8_t size, uint8_t *args); #endif /* flash_h */ -- cgit v1.2.3