new mixed mode

This commit is contained in:
CrazyRedMachine
2020-08-14 13:32:56 +02:00
parent bc47b562ff
commit a94218da01
6 changed files with 45 additions and 22 deletions
+8 -3
View File
@@ -286,6 +286,7 @@ static const byte PROGMEM _hidReportPOPN[] = {
if (requestType == REQUEST_HOSTTODEVICE_CLASS_INTERFACE) {
if (request == HID_SET_REPORT) {
if(setup.wValueH == HID_REPORT_TYPE_OUTPUT && setup.wLength == 5){
lastHidUpdate = millis();
USB_RecvControl(led_data, 5);
return true;
}
@@ -309,9 +310,13 @@ static const byte PROGMEM _hidReportPOPN[] = {
uint8_t POPNHID_::getLightMode(){
return lightMode;
}
unsigned long POPNHID_::getLastHidUpdate(){
return lastHidUpdate;
}
void POPNHID_::setLightMode(uint8_t mode){
if ((mode > 3) || (mode < 0)) {
if ((mode > 4) || (mode < 0)) {
lightMode = 2;
return;
}
@@ -355,4 +360,4 @@ static const byte PROGMEM _hidReportPOPN[] = {
data[1] = (uint8_t) (buttonsState & 0xFF);
data[2] = (uint8_t) (buttonsState >> 8) & 0xFF;
return USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, 3);
}
}