From d97818faedcd4d5015ca58fc900afec2d9e0ec53 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 25 Oct 2018 16:38:24 +0700 Subject: [PATCH] minor clean up --- cores/nRF5/flash/flash_nrf5x.h | 6 ++++++ cores/nRF5/flash/flash_qspi.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/cores/nRF5/flash/flash_nrf5x.h b/cores/nRF5/flash/flash_nrf5x.h index 0b240bdf..be907fb8 100644 --- a/cores/nRF5/flash/flash_nrf5x.h +++ b/cores/nRF5/flash/flash_nrf5x.h @@ -51,6 +51,9 @@ bool flash_nrf5x_erase(uint32_t addr); uint32_t flash_nrf5x_write (uint32_t dst, void const * src, uint32_t len); uint32_t flash_nrf5x_read (void* dst, uint32_t src, uint32_t len); +//--------------------------------------------------------------------+ +// Write helper +//--------------------------------------------------------------------+ static inline uint32_t flash_nrf5x_write8 (uint32_t dst, uint8_t num) { flash_nrf5x_write(dst, &num, sizeof(num)); @@ -68,6 +71,9 @@ static inline uint32_t flash_nrf5x_write32 (uint32_t dst, uint8_t num) return sizeof(num); } +//--------------------------------------------------------------------+ +// Read helper +//--------------------------------------------------------------------+ static inline uint8_t flash_nrf5x_read8 (uint32_t src) { uint8_t num; diff --git a/cores/nRF5/flash/flash_qspi.h b/cores/nRF5/flash/flash_qspi.h index d6bac6a3..606bda5f 100644 --- a/cores/nRF5/flash/flash_qspi.h +++ b/cores/nRF5/flash/flash_qspi.h @@ -53,6 +53,9 @@ uint32_t flash_qspi_size (void); uint32_t flash_qspi_write (uint32_t dst, void const * src, uint32_t len); uint32_t flash_qspi_read (void* dst, uint32_t src, uint32_t len); +//--------------------------------------------------------------------+ +// Write helper +//--------------------------------------------------------------------+ static inline uint32_t flash_qspi_write8 (uint32_t dst, uint8_t num) { flash_qspi_write(dst, &num, sizeof(num)); @@ -70,6 +73,9 @@ static inline uint32_t flash_qspi_write32 (uint32_t dst, uint8_t num) return sizeof(num); } +//--------------------------------------------------------------------+ +// Read helper +//--------------------------------------------------------------------+ static inline uint8_t flash_qspi_read8 (uint32_t src) { uint8_t num;