File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,17 +227,17 @@ void init_usb(void) {
227227}
228228
229229static bool cdc_enabled (void ) {
230- if (mp_cdc_enabled ) {
231- return true;
232- }
233230 if (!cdcdf_acm_is_enabled ()) {
231+ mp_cdc_enabled = false;
234232 return false;
235233 }
236- cdcdf_acm_register_callback (CDCDF_ACM_CB_READ , (FUNC_PTR )read_complete );
237- cdcdf_acm_register_callback (CDCDF_ACM_CB_WRITE , (FUNC_PTR )write_complete );
238- cdcdf_acm_register_callback (CDCDF_ACM_CB_STATE_C , (FUNC_PTR )usb_device_cb_state_c );
239- cdcdf_acm_register_callback (CDCDF_ACM_CB_LINE_CODING_C , (FUNC_PTR )usb_device_cb_line_coding_c );
240- mp_cdc_enabled = true;
234+ if (!mp_cdc_enabled ) {
235+ cdcdf_acm_register_callback (CDCDF_ACM_CB_READ , (FUNC_PTR )read_complete );
236+ cdcdf_acm_register_callback (CDCDF_ACM_CB_WRITE , (FUNC_PTR )write_complete );
237+ cdcdf_acm_register_callback (CDCDF_ACM_CB_STATE_C , (FUNC_PTR )usb_device_cb_state_c );
238+ cdcdf_acm_register_callback (CDCDF_ACM_CB_LINE_CODING_C , (FUNC_PTR )usb_device_cb_line_coding_c );
239+ mp_cdc_enabled = true;
240+ }
241241
242242 return true;
243243}
You can’t perform that action at this time.
0 commit comments