Merge pull request #634 from ourairquality/sysparam-init-sem

sysparam: always create the semaphore on init.
This commit is contained in:
Ruslan V. Uss 2018-06-05 20:05:39 +05:00 committed by GitHub
commit eed96df5dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -505,6 +505,8 @@ sysparam_status_t sysparam_init(uint32_t base_addr, uint32_t top_addr) {
struct sysparam_context ctx;
uint16_t num_sectors;
_sysparam_info.sem = xSemaphoreCreateMutex();
// Make sure we're starting at the beginning of the sector
base_addr -= (base_addr % sdk_flashchip.sector_size);
@ -584,8 +586,6 @@ sysparam_status_t sysparam_init(uint32_t base_addr, uint32_t top_addr) {
_sysparam_info.end_addr = ctx.addr;
}
_sysparam_info.sem = xSemaphoreCreateMutex();
return SYSPARAM_OK;
}