aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/lib
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-05-16 14:47:50 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-05-16 14:47:50 +0000
commit03deeba18703fcaaf3ed34849f400a6ca9499ae1 (patch)
treeb6a41d249213064a26ae3ff2cf0c22ad5138e664 /os/hal/lib
parent9e255c330daa07b7aa067735e93ddc6c2562ca98 (diff)
downloadChibiOS-03deeba18703fcaaf3ed34849f400a6ca9499ae1.tar.gz
ChibiOS-03deeba18703fcaaf3ed34849f400a6ca9499ae1.tar.bz2
ChibiOS-03deeba18703fcaaf3ed34849f400a6ca9499ae1.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9492 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/lib')
-rw-r--r--os/hal/lib/peripherals/flash/hal_flash.h16
-rw-r--r--os/hal/lib/peripherals/flash/hal_jesd216_flash.h10
2 files changed, 15 insertions, 11 deletions
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;