Merge with master, reformat

This commit is contained in:
Tobias Blum
2018-01-21 00:25:50 +01:00
parent 92a654b845
commit 1380fe8cac
5 changed files with 14 additions and 21 deletions
+6 -7
View File
@@ -1,7 +1,6 @@
// ***************************************************************************
// Request handlers
// ***************************************************************************
void getArgs() {
if (server.arg("rgb") != "") {
uint32_t rgb = (uint32_t) strtol(server.arg("rgb").c_str(), NULL, 16);
@@ -124,10 +123,10 @@ void handleSetDifferentColors(uint8_t * mypayload) {
void handleRangeDifferentColors(uint8_t * mypayload) {
uint8_t* nextCommand = 0;
nextCommand = (uint8_t*) strtok((char*) mypayload, "R");
//While there is a range to process R0110<00ff00>
// While there is a range to process R0110<00ff00>
while (nextCommand) {
//Loop for each LED.
// Loop for each LED.
char startled[3] = { 0, 0, 0 };
char endled[3] = { 0, 0, 0 };
char colorval[7] = { 0, 0, 0, 0, 0, 0, 0 };
@@ -141,19 +140,19 @@ void handleRangeDifferentColors(uint8_t * mypayload) {
while ( rangebegin <= rangeend ) {
char rangeData[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
if ( rangebegin < 10 ) {
//Create the valid 'nextCommand' structure
// Create the valid 'nextCommand' structure
sprintf(rangeData, "0%d%s", rangebegin, colorval);
}
if ( rangebegin >= 10 ) {
//Create the valid 'nextCommand' structure
// Create the valid 'nextCommand' structure
sprintf(rangeData, "%d%s", rangebegin, colorval);
}
//Set one LED
// Set one LED
handleSetSingleLED((uint8_t*) rangeData, 0);
rangebegin++;
}
//Next Range at R
// Next Range at R
nextCommand = (uint8_t*) strtok(NULL, "R");
}
}