File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -227,17 +227,17 @@ void init_usb(void) {
227
227
}
228
228
229
229
static bool cdc_enabled (void ) {
230
- if (mp_cdc_enabled ) {
231
- return true;
232
- }
233
230
if (!cdcdf_acm_is_enabled ()) {
231
+ mp_cdc_enabled = false;
234
232
return false;
235
233
}
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
+ }
241
241
242
242
return true;
243
243
}
You can’t perform that action at this time.
0 commit comments