diff --git a/right/src/usb_protocol_handler.c b/right/src/usb_protocol_handler.c index f36b323..2801e21 100644 --- a/right/src/usb_protocol_handler.c +++ b/right/src/usb_protocol_handler.c @@ -21,7 +21,7 @@ void setError(uint8_t error) { void setGenericError(void) { - setError(PROTOCOL_RESPONSE_GENERIC_ERROR); + setError(UsbResponse_GenericError); } // Set a single byte as the response. @@ -92,7 +92,7 @@ void readEeprom(void) // I2cWrite(I2C_EEPROM_BUS_BASEADDR, I2C_ADDRESS_EEPROM, GenericHidInBuffer+2, 2); // I2cRead(I2C_EEPROM_BUS_BASEADDR, I2C_ADDRESS_EEPROM, GenericHidOutBuffer+1, i2cPayloadSize); - GenericHidOutBuffer[0] = PROTOCOL_RESPONSE_SUCCESS; + GenericHidOutBuffer[0] = UsbResponse_Success; } void readMergeSensor(void) diff --git a/right/src/usb_protocol_handler.h b/right/src/usb_protocol_handler.h index 26808c5..e5632bb 100644 --- a/right/src/usb_protocol_handler.h +++ b/right/src/usb_protocol_handler.h @@ -7,8 +7,6 @@ // Macros: - #define PROTOCOL_RESPONSE_SUCCESS 0 - #define PROTOCOL_RESPONSE_GENERIC_ERROR 1 #define WRITE_LED_DRIVER_RESPONSE_INVALID_ADDRESS 1 #define WRITE_LED_DRIVER_RESPONSE_INVALID_PAYLOAD_SIZE 2 @@ -39,6 +37,11 @@ SystemProperty_FirmwareVersionId = 3, } system_property_t; + typedef enum { + UsbResponse_Success = 0, + UsbResponse_GenericError = 1, + } usb_response_t; + // Functions: extern void usbProtocolHandler();