From 38639e8877d658a73ea6e7b403fecf3c9bab37b1 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 19 Oct 2022 10:25:02 -0400 Subject: [PATCH] nicer (?) parameter names --- firmware/hw_layer/flash_int.h | 10 +++++----- firmware/hw_layer/ports/cypress/flash_int.cpp | 4 ++-- firmware/hw_layer/ports/kinetis/flash_int.cpp | 4 ++-- firmware/hw_layer/ports/stm32/flash_int.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/firmware/hw_layer/flash_int.h b/firmware/hw_layer/flash_int.h index d69031a2c7..a8071bf0e7 100644 --- a/firmware/hw_layer/flash_int.h +++ b/firmware/hw_layer/flash_int.h @@ -146,14 +146,14 @@ bool intFlashIsErased(flashaddr_t address, size_t size); bool intFlashCompare(flashaddr_t address, const char* buffer, size_t size); /** - * @brief Copy data from the flash memory to a @p buffer. - * @warning The @p buffer must be at least @p size bytes long. - * @param address First address of the flash memory to be copied. - * @param buffer Buffer to copy to. + * @brief Copy data from the flash memory to a @p destination. + * @warning The @p destination must be at least @p size bytes long. + * @param source First address of the flash memory to be copied. + * @param destination Buffer to copy to. * @param size Size of the data to be copied in bytes. * @return FLASH_RETURN_SUCCESS if successfully copied. */ -int intFlashRead(flashaddr_t address, char* buffer, size_t size); +int intFlashRead(flashaddr_t source, char* destination, size_t size); /** * @brief Copy data from a @p buffer to the flash memory. diff --git a/firmware/hw_layer/ports/cypress/flash_int.cpp b/firmware/hw_layer/ports/cypress/flash_int.cpp index f7231da5b8..9d8e332ca2 100644 --- a/firmware/hw_layer/ports/cypress/flash_int.cpp +++ b/firmware/hw_layer/ports/cypress/flash_int.cpp @@ -127,8 +127,8 @@ bool intFlashCompare(flashaddr_t address, const char* buffer, size_t size) { return TRUE; } -int intFlashRead(flashaddr_t address, char* buffer, size_t size) { - memcpy(buffer, (char*) address, size); +int intFlashRead(flashaddr_t source, char* destination, size_t size) { + memcpy(destination, (char*) source, size); return FLASH_RETURN_SUCCESS; } diff --git a/firmware/hw_layer/ports/kinetis/flash_int.cpp b/firmware/hw_layer/ports/kinetis/flash_int.cpp index ac29ab2c9b..642aaf5f3e 100644 --- a/firmware/hw_layer/ports/kinetis/flash_int.cpp +++ b/firmware/hw_layer/ports/kinetis/flash_int.cpp @@ -197,8 +197,8 @@ bool intFlashCompare(flashaddr_t address, const char* buffer, size_t size) { return TRUE; } -int intFlashRead(flashaddr_t address, char* buffer, size_t size) { - memcpy(buffer, (char*) address, size); +int intFlashRead(flashaddr_t source, char* destination, size_t size) { + memcpy(destination, (char*) source, size); return FLASH_RETURN_SUCCESS; } diff --git a/firmware/hw_layer/ports/stm32/flash_int.cpp b/firmware/hw_layer/ports/stm32/flash_int.cpp index 04a37e08d8..c8f9f58fb2 100644 --- a/firmware/hw_layer/ports/stm32/flash_int.cpp +++ b/firmware/hw_layer/ports/stm32/flash_int.cpp @@ -263,14 +263,14 @@ bool intFlashCompare(flashaddr_t address, const char* buffer, size_t size) { return TRUE; } -int intFlashRead(flashaddr_t address, char* buffer, size_t size) { +int intFlashRead(flashaddr_t source, char* destination, size_t size) { #if CORTEX_MODEL == 7 // If we have a cache, invalidate the relevant cache lines. // They may still contain old data, leading us to read invalid data. - SCB_InvalidateDCache_by_Addr((uint32_t*)address, size); + SCB_InvalidateDCache_by_Addr((uint32_t*)source, size); #endif - memcpy(buffer, (char*) address, size); + memcpy(destination, (char*) source, size); return FLASH_RETURN_SUCCESS; }