[FL-1338] Initialize USB as soon as possible, fix usb stack lockup #525
This commit is contained in:
		
							parent
							
								
									c54653223e
								
							
						
					
					
						commit
						045cb94eec
					
				| @ -27,7 +27,11 @@ int main(void) { | ||||
|     // Initialize FURI layer
 | ||||
|     furi_init(); | ||||
| 
 | ||||
|     // Initialize ST HAL hardware
 | ||||
|     // USB must be initialized as soon as possible
 | ||||
|     MX_USB_Device_Init(); | ||||
|     FURI_LOG_I("HAL", "USB OK"); | ||||
| 
 | ||||
|     // Initialise the rest of HAL
 | ||||
|     HAL_Init(); | ||||
|     SystemClock_Config(); | ||||
|     MX_USART1_UART_Init(); | ||||
| @ -42,8 +46,6 @@ int main(void) { | ||||
|     FURI_LOG_I("HAL", "SPI1 OK"); | ||||
|     MX_SPI2_Init(); | ||||
|     FURI_LOG_I("HAL", "SPI2 OK"); | ||||
|     MX_USB_Device_Init(); | ||||
|     FURI_LOG_I("HAL", "USB OK"); | ||||
|     MX_TIM1_Init(); | ||||
|     FURI_LOG_I("HAL", "TIM1 OK"); | ||||
|     MX_TIM2_Init(); | ||||
|  | ||||
| @ -30,6 +30,12 @@ int main(void) { | ||||
|     // Initialize ST HAL hardware
 | ||||
|     HAL_Init(); | ||||
|     SystemClock_Config(); | ||||
| 
 | ||||
|     // USB must be initialized as soon as possible
 | ||||
|     MX_USB_Device_Init(); | ||||
|     FURI_LOG_I("HAL", "USB OK"); | ||||
| 
 | ||||
|     // Initialise the rest of HAL
 | ||||
|     MX_USART1_UART_Init(); | ||||
|     FURI_LOG_I("HAL", "USART OK"); | ||||
|     MX_RTC_Init(); | ||||
| @ -42,8 +48,6 @@ int main(void) { | ||||
|     FURI_LOG_I("HAL", "SPI1 OK"); | ||||
|     MX_SPI2_Init(); | ||||
|     FURI_LOG_I("HAL", "SPI2 OK"); | ||||
|     MX_USB_Device_Init(); | ||||
|     FURI_LOG_I("HAL", "USB OK"); | ||||
|     MX_TIM1_Init(); | ||||
|     FURI_LOG_I("HAL", "TIM1 OK"); | ||||
|     MX_TIM2_Init(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 あく
						あく