减少sfud对任务栈的占用

用全局空间换栈空间,当多个任务需要使用sfud时,可以节省内存
例如多个任务需要使用文件系统,任务栈可以减少
This commit is contained in:
HubretXie 2018-12-17 18:09:02 +08:00 committed by GitHub
parent 9e990be572
commit 716823bfec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -603,7 +603,8 @@ static sfud_err page256_or_1_byte_write(const sfud_flash *flash, uint32_t addr,
const uint8_t *data) {
sfud_err result = SFUD_SUCCESS;
const sfud_spi *spi = &flash->spi;
uint8_t cmd_data[5 + SFUD_WRITE_MAX_PAGE_SIZE], cmd_size;
static uint8_t cmd_data[5 + SFUD_WRITE_MAX_PAGE_SIZE];
uint8_t cmd_size;
size_t data_size;
SFUD_ASSERT(flash);