nicer (?) parameter names
This commit is contained in:
parent
620dd1b42c
commit
38639e8877
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue