mirror of https://github.com/ARMmbed/mbed-os.git
TDBStore: remove get_flash_bounds input constraint
Handle the case where the entirety of flash (size = 0) is required for a flash memory starting at address 0, instead of erroring out.pull/11629/head
parent
9d414316da
commit
0002830c03
|
@ -1504,8 +1504,8 @@ int TDBStore::get_flash_bounds_from_config(bd_addr_t *start_address, bd_size_t *
|
|||
|
||||
if (*start_address == 0) {
|
||||
if (*size == 0) {
|
||||
flash.deinit();
|
||||
return MBED_ERROR_INVALID_ARGUMENT;
|
||||
//The block device will have all space from start address to the end of the flash
|
||||
*size = flash.get_flash_size();
|
||||
}
|
||||
|
||||
*start_address = flash_end_address - *size;
|
||||
|
|
|
@ -301,10 +301,9 @@ public:
|
|||
|
||||
/**
|
||||
* @brief Get the TDBStore flash bounds from the configured start address and size.
|
||||
* Configured start address/size must not both be 0.
|
||||
*
|
||||
* @param[inout] start_address Configured TDBStore start address in flash.
|
||||
* @param[inout] size Configured TDBStore size.
|
||||
* @param[inout] size Configured TDBStore size. If 0, the size will be from the start address to the end of flash
|
||||
*
|
||||
* @returns MBED_SUCCESS Success.
|
||||
* MBED_ERROR_INVALID_ARGUMENT One of the arguments is NULL or both the configured start address and size are 0.
|
||||
|
|
Loading…
Reference in New Issue