sysparam: always create the semaphore on init.
Otherwise when initialization was not successful it may fail with an assertion in FreeRTOS rather than returning SYSPARAM_ERR_NOINIT.
This commit is contained in:
		
							parent
							
								
									93d43d7825
								
							
						
					
					
						commit
						090db8da5e
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -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; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue