@ -975,6 +975,35 @@ void send_consumer(uint16_t data) {
# endif
# endif
}
}
void send_programmable_button ( uint32_t data ) {
# ifdef PROGRAMMABLE_BUTTON_ENABLE
osalSysLock ( ) ;
if ( usbGetDriverStateI ( & USB_DRIVER ) ! = USB_ACTIVE ) {
osalSysUnlock ( ) ;
return ;
}
if ( usbGetTransmitStatusI ( & USB_DRIVER , SHARED_IN_EPNUM ) ) {
/* Need to either suspend, or loop and call unlock/lock during
* every iteration - otherwise the system will remain locked ,
* no interrupts served , so USB not going through as well .
* Note : for suspend , need USB_USE_WAIT = = TRUE in halconf . h */
if ( osalThreadSuspendTimeoutS ( & ( & USB_DRIVER ) - > epc [ SHARED_IN_EPNUM ] - > in_state - > thread , TIME_MS2I ( 10 ) ) = = MSG_TIMEOUT ) {
osalSysUnlock ( ) ;
return ;
}
}
static report_programmable_button_t report = {
. report_id = REPORT_ID_PROGRAMMABLE_BUTTON ,
} ;
report . usage = data ;
usbStartTransmitI ( & USB_DRIVER , SHARED_IN_EPNUM , ( uint8_t * ) & report , sizeof ( report ) ) ;
osalSysUnlock ( ) ;
# endif
}
void send_digitizer ( report_digitizer_t * report ) {
void send_digitizer ( report_digitizer_t * report ) {
# ifdef DIGITIZER_ENABLE
# ifdef DIGITIZER_ENABLE
# ifdef DIGITIZER_SHARED_EP
# ifdef DIGITIZER_SHARED_EP