From b8a4c26a9cab50e5a845d0033665a4d74b17444b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 25 Nov 2018 12:02:19 +0000 Subject: Persistent storage for STM32 RTCV1 driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12438 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/hal/include/hal_persistent.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'os/hal/include/hal_persistent.h') diff --git a/os/hal/include/hal_persistent.h b/os/hal/include/hal_persistent.h index f0aed89b9..f6ba14e82 100644 --- a/os/hal/include/hal_persistent.h +++ b/os/hal/include/hal_persistent.h @@ -118,6 +118,17 @@ typedef struct { */ #define getBasePersistentStorage(ip) ((BasePersistentStorage *)&(ip)->vmt) +/** + * @brief Get storage size. + * + * @param[in] ip pointer to a @p BasePersistentStorage or derived class + * @return The storage size in bytes. + * + * @api + */ +#define psGetStorageSize(ip) \ + (ip)->vmt->getsize(ip) + /** * @brief Read operation. * @@ -140,7 +151,7 @@ typedef struct { * * @param[in] ip pointer to a @p BasePersistentStorage or derived class * @param[in] offset persistent storage offset - * @param[in] n number of bytes to be programmed + * @param[in] n number of bytes to be written * @param[in] wp pointer to the data buffer * @return An error code. * @retval PS_NO_ERROR if there is no erase operation in progress. -- cgit v1.2.3