Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: set config to 0 on bus reset and exit

Change-Id: I4ee0e33f031388d17b30bbe591fe9b7d6386e940

mojyack 6db1e937 03fbd278

+3 -18
+3 -18
firmware/usbstack/usb_core.c
··· 312 312 static volatile bool control_write_data_done = false; 313 313 #endif 314 314 315 + static int usb_core_do_set_config(uint8_t new_config); 315 316 static void usb_core_control_request_handler(struct usb_ctrlrequest* req, void* reqdata); 316 317 317 318 static unsigned char response_data[256] USB_DEVBSS_ATTR; ··· 496 497 497 498 void usb_core_exit(void) 498 499 { 499 - if(usb_config != 0) { 500 - for(int i = 0; i < USB_NUM_DRIVERS; i++) { 501 - if(is_active(drivers[i]) && drivers[i].disconnect != NULL) { 502 - drivers[i].disconnect(); 503 - drivers[i].enabled = false; 504 - } 505 - } 506 - } 507 - 500 + usb_core_do_set_config(0); 508 501 if(initialized) { 509 502 usb_drv_exit(); 510 503 initialized = false; ··· 1105 1098 void usb_core_bus_reset(void) 1106 1099 { 1107 1100 logf("usb_core: bus reset"); 1101 + usb_core_do_set_config(0); 1108 1102 usb_address = 0; 1109 1103 usb_state = DEFAULT; 1110 - if(usb_config != 0) { 1111 - for(int i = 0; i < USB_NUM_DRIVERS; i++) { 1112 - if(is_active(drivers[i]) && drivers[i].disconnect != NULL) { 1113 - drivers[i].disconnect(); 1114 - } 1115 - } 1116 - init_deinit_endpoints(usb_config - 1, false); 1117 - usb_config = 0; 1118 - } 1119 1104 #ifdef HAVE_USB_CHARGING_ENABLE 1120 1105 #ifdef HAVE_USB_CHARGING_IN_THREAD 1121 1106 /* On some targets usb_charging_maxcurrent_change() cannot be called