From 3541c176f24f8daee3b0bc35f71e1521daa7137a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 8 Jan 2016 20:48:26 +0100 Subject: use global defines for usb control commands --- firmware/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'firmware') diff --git a/firmware/main.c b/firmware/main.c index db5bf25..0410134 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -37,16 +37,16 @@ usbRequest_t *rq = (void *)data; static uchar replyBuf[2]; usbMsgPtr = replyBuf; - if(rq->bRequest == 0) { /* ECHO */ + if(rq->bRequest == USBCMD_ECHO) { /* ECHO */ replyBuf[0] = rq->wValue.bytes[0]; replyBuf[1] = rq->wValue.bytes[1]; return 2; } - if(rq->bRequest == 1) { /* GET_STATUS -> result = 1 bytes */ + if(rq->bRequest == USBCMD_GETPORT) { /* GET_STATUS -> result = 1 bytes */ replyBuf[0] = PINB; return 1; } - if(rq->bRequest == 2) { /* SET_STATUS. Payload byte is output. */ + if(rq->bRequest == USBCMD_SETPORT) { /* SET_STATUS. Payload byte is output. */ DDRB = ~(rq->wIndex.bytes[0]); } return 0; -- cgit v1.2.3