Skip to content

Commit

Permalink
Minor bug fix for palette label in UI. A few more palette files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Bordens authored and Jake Bordens committed Dec 18, 2016
1 parent 2b11646 commit 9424a13
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
7 changes: 1 addition & 6 deletions colormodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ void palette_anims() {

// Send current palette name to the UI.
String name = getPaletteNameWithIndex(currentPaletteIndex);
// name.insert(0, "p");
//DBG_OUTPUT_PORT.println("p"+name);
webSocket.broadcastTXT("p"+name);
}
}
Expand All @@ -230,10 +228,7 @@ void palette_anims() {

// Send current palette name to the UI.
String name = getPaletteNameWithIndex(currentPaletteIndex);
//name.insert(0, "p");
//DBG_OUTPUT_PORT.println("p"+name);
webSocket.broadcastTXT("p"+name);

webSocket.broadcastTXT("p"+name);
FillLEDsFromPaletteColors(targetPalette,startIndex);
} else {
FillLEDsFromPaletteColors(targetPalette,startIndex, wipePos);
Expand Down
Binary file added data/palettes/Green_White_Red.bin
Binary file not shown.
Binary file added data/palettes/bhw1_greenie.bin
Binary file not shown.
Binary file added data/palettes/bhw2_xmas.bin
Binary file not shown.
12 changes: 9 additions & 3 deletions request_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,16 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length
if (settings.palette_ndx >= numberOfPalettes) {
settings.palette_ndx = 0;
}
currentPaletteIndex = settings.palette_ndx;
DBG_OUTPUT_PORT.printf("Next palette: %d\n", settings.palette_ndx);

targetPaletteIndex = settings.palette_ndx;
loadPaletteFromFile(settings.palette_ndx, &targetPalette);
currentPalette = targetPalette;

if (settings.glitter_wipe_on) {
wipeInProgress = true;
}

DBG_OUTPUT_PORT.printf("Next palette: %d\n", settings.palette_ndx);

} else if (payload[1] == 'r') {
DBG_OUTPUT_PORT.printf("Randomize palette.\n");
settings.palette_ndx = -1;
Expand Down

0 comments on commit 9424a13

Please sign in to comment.