From 0e317c8af502c1348e456977926a44ea80fb814d Mon Sep 17 00:00:00 2001 From: bg Date: Sat, 19 Oct 2013 05:58:04 +0200 Subject: [PATCH] minor optimiztion --- firmware/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/firmware/main.c b/firmware/main.c index f0fd1bf..54476a0 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -279,6 +279,7 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) } if ((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_VENDOR) { current_command = rq->bRequest; + usbMsgPtr = uni_buffer.w8; switch(rq->bRequest) { case CUSTOM_RQ_SET_SECRET: @@ -298,7 +299,6 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) #else uni_buffer.w32[0] = percnt_get(0); #endif - usbMsgPtr = (usbMsgPtr_t)uni_buffer.w32; return 4; case CUSTOM_RQ_RESET_COUNTER: counter_reset(); @@ -306,7 +306,6 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) 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) { @@ -318,13 +317,11 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) 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; @@ -346,7 +343,6 @@ usbMsgLen_t usbFunctionSetup(uchar data[8]) break; case CUSTOM_RQ_READ_BUTTON: uni_buffer.w8[0] = button_get_debounced(25); - usbMsgPtr = uni_buffer.w8; return 1; } } -- 2.39.5