updated cdc_enabled; now more dynamic status return
This commit is contained in:
parent
8c9cc6b7c0
commit
6205ed9a0c
@ -227,17 +227,17 @@ void init_usb(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool cdc_enabled(void) {
|
static bool cdc_enabled(void) {
|
||||||
if (mp_cdc_enabled) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!cdcdf_acm_is_enabled()) {
|
if (!cdcdf_acm_is_enabled()) {
|
||||||
|
mp_cdc_enabled = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cdcdf_acm_register_callback(CDCDF_ACM_CB_READ, (FUNC_PTR)read_complete);
|
if (!mp_cdc_enabled) {
|
||||||
cdcdf_acm_register_callback(CDCDF_ACM_CB_WRITE, (FUNC_PTR)write_complete);
|
cdcdf_acm_register_callback(CDCDF_ACM_CB_READ, (FUNC_PTR)read_complete);
|
||||||
cdcdf_acm_register_callback(CDCDF_ACM_CB_STATE_C, (FUNC_PTR)usb_device_cb_state_c);
|
cdcdf_acm_register_callback(CDCDF_ACM_CB_WRITE, (FUNC_PTR)write_complete);
|
||||||
cdcdf_acm_register_callback(CDCDF_ACM_CB_LINE_CODING_C, (FUNC_PTR)usb_device_cb_line_coding_c);
|
cdcdf_acm_register_callback(CDCDF_ACM_CB_STATE_C, (FUNC_PTR)usb_device_cb_state_c);
|
||||||
mp_cdc_enabled = true;
|
cdcdf_acm_register_callback(CDCDF_ACM_CB_LINE_CODING_C, (FUNC_PTR)usb_device_cb_line_coding_c);
|
||||||
|
mp_cdc_enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user