settings fcb: Increase buffer for mcu with large write block size

Devices with write block size greater than 16 could not use settings_fcb
due to small buffer size.
Update value in test as well.

Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
This commit is contained in:
Nicolas VINCENT 2022-07-11 15:16:33 +02:00 committed by Stephanos Ioannidis
parent 18e2f44555
commit 06d53b1343
2 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ int settings_line_write(const char *name, const char *value, size_t val_len,
size_t w_size, rem, add;
bool done;
char w_buf[16]; /* write buff, must be aligned either to minimal */
char w_buf[32]; /* write buff, must be aligned either to minimal */
/* base64 encoding size and write-block-size */
int rc;
uint8_t wbs = settings_io_cb.rwbs;
@ -174,7 +174,7 @@ static int settings_line_raw_read_until(off_t seek, char *out, size_t len_req,
void *cb_arg)
{
size_t rem_size, len;
char temp_buf[16]; /* buffer for fit read-block-size requirements */
char temp_buf[32]; /* buffer for fit read-block-size requirements */
size_t exp_size, read_size;
uint8_t rbs = settings_io_cb.rwbs;
off_t off;

View file

@ -354,7 +354,7 @@ void *settings_config_fcb_setup(void)
zassume_true(rc == 0, "Can't open storage flash area");
wbs = flash_area_align(fap);
zassume_true(wbs <= 16,
zassume_true(wbs <= 32,
"Flash driver is not compatible with the settings fcb-backend");
return NULL;
}