+ case CUSTOM_RQ_SET_SECRET:
+ secret_length_b = rq->wValue.word;
+ if (secret_length_b > 256) {
+ secret_length_b = 256;
+ }
+ uni_buffer.w8[0] = 0;
+ return USB_NO_MSG;
+ case CUSTOM_RQ_INC_COUNTER:
+ percnt_inc(0);
+ return 0;
+ case CUSTOM_RQ_GET_COUNTER:
+ uni_buffer.w32[0] = percnt_get(0);
+ usbMsgPtr = (usbMsgPtr_t)uni_buffer.w32;
+ return 4;
+ case CUSTOM_RQ_RESET_COUNTER:
+ counter_reset();
+ return 0;
+ case CUSTOM_RQ_GET_RESET_COUNTER:
+ eeprom_busy_wait();
+ uni_buffer.w8[0] = eeprom_read_byte(&reset_counter_ee);
+ usbMsgPtr = uni_buffer.w8;
+ return 1;
+ case CUSTOM_RQ_SET_DIGITS:
+ if (rq->wValue.bytes[0] > 9) {
+ rq->wValue.bytes[0] = 9;
+ }
+ eeprom_busy_wait();
+ eeprom_write_byte(&digits_ee, rq->wValue.bytes[0]);
+ return 0;
+ case CUSTOM_RQ_GET_DIGITS:
+ eeprom_busy_wait();
+ uni_buffer.w8[0] = eeprom_read_byte(&digits_ee);
+ usbMsgPtr = uni_buffer.w8;
+ return 1;
+ case CUSTOM_RQ_GET_TOKEN:
+ token_generate();
+ usbMsgPtr = (usbMsgPtr_t)token;
+ return strlen(token);
+
+ case CUSTOM_RQ_PRESS_BUTTON:
+ key_state = STATE_SEND_KEY;
+ return 0;
+ case CUSTOM_RQ_CLR_DBG:
+ memset(dbg_buffer, 0, sizeof(dbg_buffer));
+ return 0;
+ case CUSTOM_RQ_SET_DBG: