@@ -202,8 +202,9 @@ namespace klib::usb::device {
202202 data_updating = true ;
203203
204204 // send the report to the host
205- Usb::write (hid_callback<Usb>, config.endpoint .bEndpointAddress & 0x0f ,
206- usb::endpoint_mode::in,
205+ Usb::write (hid_callback<Usb>,
206+ usb::get_endpoint (config.endpoint .bEndpointAddress ),
207+ usb::get_endpoint_mode (config.endpoint .bEndpointAddress ),
207208 {reinterpret_cast <const uint8_t *>(&report_data), sizeof (report_data)}
208209 );
209210
@@ -421,8 +422,8 @@ namespace klib::usb::device {
421422 if (packet.wValue == config.configuration .bConfigurationValue ) {
422423 // configure the endpoint for our report data
423424 Usb::configure (
424- config.endpoint .bEndpointAddress & 0x0f ,
425- usb::endpoint_mode::in ,
425+ usb::get_endpoint ( config.endpoint .bEndpointAddress ) ,
426+ usb::get_endpoint_mode (config. endpoint . bEndpointAddress ) ,
426427 usb::get_transfer_type (config.endpoint .bmAttributes ),
427428 sizeof (report_data)
428429 );
@@ -437,9 +438,10 @@ namespace klib::usb::device {
437438 report_data = {};
438439
439440 // write the inital report
440- if (Usb::write (hid_callback<Usb>, config.endpoint .bEndpointAddress & 0x0f ,
441- usb::endpoint_mode::in, {reinterpret_cast <const uint8_t *>(&report_data),
442- sizeof (report_data)}))
441+ if (Usb::write (hid_callback<Usb>,
442+ usb::get_endpoint (config.endpoint .bEndpointAddress ),
443+ usb::get_endpoint_mode (config.endpoint .bEndpointAddress ),
444+ {reinterpret_cast <const uint8_t *>(&report_data), sizeof (report_data)}))
443445 {
444446 // no issue for now ack
445447 return usb::handshake::ack;
@@ -456,7 +458,10 @@ namespace klib::usb::device {
456458 // reset the used endpoint if we have one
457459 if (configuration) {
458460 // reset the endpoint
459- Usb::reset (config.endpoint .bEndpointAddress & 0x0f , usb::endpoint_mode::in);
461+ Usb::reset (
462+ usb::get_endpoint (config.endpoint .bEndpointAddress ),
463+ usb::get_endpoint_mode (config.endpoint .bEndpointAddress )
464+ );
460465 }
461466
462467 // clear the configuration value
0 commit comments