Merge pull request #8 from UniversalTimeCodeGit/master

Implement Heatmap Reset Method
pull/389/head
Gergely Nagy 7 years ago committed by GitHub
commit 40ba21df0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -111,6 +111,18 @@ void Heatmap::shiftStats(void) {
highest_ = highest_ >> 1;
}
void Heatmap::resetMap(void) {
// this method can be used as a way to work around an existing bug with a single key
// getting special attention or if the user just wants a button to reset the map
for (uint8_t r = 0; r < ROWS; r++) {
for (uint8_t c = 0; c < COLS; c++) {
heatmap_[r][c] = 0;
}
}
highest_ = 1;
}
void Heatmap::setup(void) {
Kaleidoscope.useEventHandlerHook(eventHook);
Kaleidoscope.useLoopHook(loopHook);

@ -29,6 +29,7 @@ class Heatmap : public LEDMode {
static uint16_t update_delay;
static const cRGB *heat_colors;
static uint8_t heat_colors_length;
void resetMap(void);
protected:
void setup(void) final;

Loading…
Cancel
Save