diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -40,9 +40,10 @@ static Pin pwm_outputs[] = {PC6, PC7, PC8, PC9}; auto dev_desc = device_desc(0x200, 0, 0, 0, 64, 0x1234, 0x5678, 0, 0, 0, 0, 1); auto conf_desc = configuration_desc(3, 1, 0, 0xc0, 0, - interface_desc(0, 0, 2, 0xff, 0x00, 0x00, 0, + interface_desc(0, 0, 3, 0xff, 0x00, 0x00, 0, endpoint_desc(0x01, 0x02, 64, 0), // OUT - endpoint_desc(0x81, 0x02, 64, 0) // IN + endpoint_desc(0x81, 0x02, 64, 0), // IN + endpoint_desc(0x82, 0x01, 64, 1) // IN ISO ) ); @@ -148,8 +149,9 @@ class USB_TM : public USB_class_driver { protected: virtual void handle_set_configuration(uint8_t configuration) { if(configuration) { - usb.hw_conf_ep(0x81, EPType::Bulk, 64); usb.hw_conf_ep(0x01, EPType::Bulk, 64); + usb.hw_conf_ep(0x81, EPType::Bulk, 64); + usb.hw_conf_ep(0x82, EPType::Isochronous, 64); usb.register_out_handler(this, 1); } } @@ -297,8 +299,10 @@ int main() { magn.z, }; - if(usb.ep_ready(1)) { - usb.write(1, (uint32_t*)buf, sizeof(buf)); + if(usb.ep_ready(2)) { + usb.write(2, (uint32_t*)buf, sizeof(buf)); + } else { + usb_rblog.log("Busy."); } } } |