From 03deeba18703fcaaf3ed34849f400a6ca9499ae1 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 16 May 2016 14:47:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9492 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/lib/peripherals/flash/hal_flash.h | 16 ++++++++-------- os/hal/lib/peripherals/flash/hal_jesd216_flash.h | 10 +++++++--- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'os/hal/lib') diff --git a/os/hal/lib/peripherals/flash/hal_flash.h b/os/hal/lib/peripherals/flash/hal_flash.h index 52011a765..b15c18b25 100644 --- a/os/hal/lib/peripherals/flash/hal_flash.h +++ b/os/hal/lib/peripherals/flash/hal_flash.h @@ -184,7 +184,7 @@ struct BaseFlashVMT { */ typedef struct { /** @brief Virtual Methods Table.*/ - const struct BaseFlashVMT *vmt_baseflash; + const struct BaseFlashVMT *vmt; _base_flash_data } BaseFlash; @@ -205,7 +205,7 @@ typedef struct { * @api */ #define flashGetDescriptor(ip) \ - (ip)->vmt_baseflash->get_descriptor(ip) + (ip)->vmt->get_descriptor(ip) /** * @brief Read operation. @@ -222,7 +222,7 @@ typedef struct { * @api */ #define flashRead(ip, addr, rp, n) \ - (ip)->vmt_baseflash->read(ip, addr, rp, n) + (ip)->vmt->read(ip, addr, rp, n) /** * @brief Program operation. @@ -239,7 +239,7 @@ typedef struct { * @api */ #define flashProgram(ip, addr, pp, n) \ - (ip)->vmt_baseflash->program(ip, addr, pp, n) + (ip)->vmt->program(ip, addr, pp, n) /** * @brief Starts a whole-device erase operation. @@ -252,7 +252,7 @@ typedef struct { * @api */ #define flashStartEraseAll(ip) \ - (ip)->vmt_baseflash->start_erase_all(ip) + (ip)->vmt->start_erase_all(ip) /** * @brief Starts an sector erase operation. @@ -266,7 +266,7 @@ typedef struct { * @api */ #define flashStartEraseSector(ip, sector) \ - (ip)->vmt_baseflash->start_erase_sector(ip, sector) + (ip)->vmt->start_erase_sector(ip, sector) /** * @brief Queries the driver for erase operation progress. @@ -282,7 +282,7 @@ typedef struct { * @api */ #define flashQueryErase(ip, msec) \ - (ip)->vmt_baseflash->query_erase(ip, msec) + (ip)->vmt->query_erase(ip, msec) /** * @brief Returns the erase state of a sector. @@ -297,7 +297,7 @@ typedef struct { * @api */ #define flashVerifyErase(ip, sector) \ - (ip)->vmt_baseflash->verify_erase(ip, sector) + (ip)->vmt->verify_erase(ip, sector) /** @} */ /*===========================================================================*/ diff --git a/os/hal/lib/peripherals/flash/hal_jesd216_flash.h b/os/hal/lib/peripherals/flash/hal_jesd216_flash.h index 0c7d1bef6..8e46f71e8 100644 --- a/os/hal/lib/peripherals/flash/hal_jesd216_flash.h +++ b/os/hal/lib/peripherals/flash/hal_jesd216_flash.h @@ -25,6 +25,8 @@ #ifndef HAL_JESD216_FLASH_H #define HAL_JESD216_FLASH_H +#include "hal_flash.h" + /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ @@ -66,12 +68,13 @@ */ #define _jesd216_flash_methods_alone \ /* Read SFDP.*/ \ - void (*read_id)(void *instance, uint8_t *rp, size_t max); + flash_error_t (*read_id)(void *instance, uint8_t *rp, size_t max); /** * @brief @p JESD215Flash specific methods with inherited ones. */ #define _jesd216_flash_methods \ + _base_flash_methods \ _jesd216_flash_methods_alone /** @@ -84,14 +87,15 @@ struct JESD215FlashVMT { /** * @brief @p JESD215Flash specific data. */ -#define _jesd216_flash_data +#define _jesd216_flash_data \ + _base_flash_data /** * @brief Base flash class. */ typedef struct { /** @brief Virtual Methods Table.*/ - const struct JESD215FlashVMT *vmt_jesd216flash; + const struct JESD215FlashVMT *vmt; _jesd216_flash_data } JESD215Flash; -- cgit v1.2.3