Skip to content

Commit

Permalink
Merge pull request #49 from Legion2/dev
Browse files Browse the repository at this point in the history
Version 0.6.2
  • Loading branch information
Legion2 authored Oct 20, 2019
2 parents 83d3259 + 64cbe6d commit 2749402
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions examples/HoodLoader2CLPBridge/CLPUSBSerialBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ void CLPUSBSerialBridge::sendError() {
}

void CLPUSBSerialBridge::sendResponse() {
#ifdef DEBUG
Serial.print(F("R"));
Serial.println(rawHIDAndSerialBuffer[0], HEX);
#endif // DEBUG
RawHID.write(rawHIDAndSerialBuffer, sizeof(rawHIDAndSerialBuffer));
// free the shared buffer to receive new data
RawHID.enable();
Expand All @@ -58,7 +62,14 @@ void CLPUSBSerialBridge::sendResponse() {
void CLPUSBSerialBridge::handleHID()
{
if (RawHID.available()) {
#ifdef DEBUG
Serial.print(F("C"));
Serial.println(rawHIDAndSerialBuffer[0], HEX);
#endif // DEBUG
if (!waitForSynchronization()) {
#ifdef DEBUG
Serial.println(F("S"));
#endif // DEBUG
sendError();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void setup() {
YOU MUST NOT USE Serial!
Serial is used by CorsairLightingProtocolSerial!
*/
cLPS.setup();
FastLED.addLeds<NEOPIXEL, DATA_PIN_CHANNEL_1>(ledsChannel1, CHANNEL_LED_COUNT);
FastLED.addLeds<NEOPIXEL, DATA_PIN_CHANNEL_2>(ledsChannel2, CHANNEL_LED_COUNT);
ledController.addLeds(0, ledsChannel1);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Corsair Lighting Protocol
version=0.6.1
version=0.6.2
author=Leon Kiefer
maintainer=Leon Kiefer
sentence=Allows iCUE to control RGB LEDs.
Expand Down
4 changes: 3 additions & 1 deletion src/CorsairLightingProtocolSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/
#include "CorsairLightingProtocolSerial.h"

CorsairLightingProtocolSerial::CorsairLightingProtocolSerial(CorsairLightingProtocol* cLP) : cLP(cLP)
CorsairLightingProtocolSerial::CorsairLightingProtocolSerial(CorsairLightingProtocol* cLP) : cLP(cLP){}

void CorsairLightingProtocolSerial::setup()
{
Serial.begin(SERIAL_BAUD);
Serial.setTimeout(SERIAL_TIMEOUT);
Expand Down
1 change: 1 addition & 0 deletions src/CorsairLightingProtocolSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
class CorsairLightingProtocolSerial : CorsairLightingProtocolResponse {
public:
CorsairLightingProtocolSerial(CorsairLightingProtocol* cLP);
void setup();
void update();
private:
byte rawCommand[COMMAND_SIZE];
Expand Down

0 comments on commit 2749402

Please sign in to comment.