From efed360683c8dfe5f39c87ff872076059d675222 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Thu, 13 Feb 2025 11:17:40 +0100 Subject: [PATCH 01/12] Reduce number of flashing patterns to 6, reduce number of colors per mode to 3, reduce number of modes to 3 --- Helios/HeliosConfig.h | 4 +- Helios/Patterns.cpp | 101 ------------------------------------------ 2 files changed, 2 insertions(+), 103 deletions(-) diff --git a/Helios/HeliosConfig.h b/Helios/HeliosConfig.h index cda27691..eee05f71 100644 --- a/Helios/HeliosConfig.h +++ b/Helios/HeliosConfig.h @@ -67,12 +67,12 @@ // Max Color Slots // // The number of slots in a colorset -#define NUM_COLOR_SLOTS 6 +#define NUM_COLOR_SLOTS 3 // Mode Slots // // The number of modes on the device -#define NUM_MODE_SLOTS 6 +#define NUM_MODE_SLOTS 3 // Number of Global Brightness Options // diff --git a/Helios/Patterns.cpp b/Helios/Patterns.cpp index c6fa555f..f04aa53f 100644 --- a/Helios/Patterns.cpp +++ b/Helios/Patterns.cpp @@ -9,9 +9,6 @@ static const uint32_t color_codes0[] = {RGB_RED, RGB_ORANGE, RGB_YELLOW, RGB_TURQUOISE, RGB_BLUE, RGB_PINK}; static const uint32_t color_codes1[] = {RGB_RED, RGB_CORAL_ORANGE_SAT_MEDIUM, RGB_ORANGE, RGB_YELLOW_SAT_LOW}; static const uint32_t color_codes2[] = {RGB_PURPLE_BRI_LOWEST, RGB_MAGENTA, RGB_HOT_PINK_SAT_MEDIUM, RGB_PINK_SAT_LOWEST}; -static const uint32_t color_codes3[] = {RGB_WHITE, RGB_BLUE_BRI_LOWEST, RGB_BLUE_BRI_LOWEST, RGB_BLUE_BRI_LOWEST, RGB_BLUE_BRI_LOWEST, RGB_BLUE_BRI_LOWEST}; -static const uint32_t color_codes4[] = {RGB_MAGENTA_BRI_LOWEST, RGB_ROYAL_BLUE_BRI_LOW, RGB_TURQUOISE, RGB_ROYAL_BLUE_BRI_LOW, RGB_MAGENTA_BRI_LOWEST, RGB_OFF}; -static const uint32_t color_codes5[] = {RGB_RED, RGB_HOT_PINK, RGB_ROYAL_BLUE, RGB_BLUE, RGB_GREEN, RGB_YELLOW}; // Define Colorset configurations for each slot struct default_colorset { @@ -25,9 +22,6 @@ static const default_colorset default_colorsets[] = { { 6, color_codes0 }, // 0 Lightside { 4, color_codes1 }, // 1 Sauna { 4, color_codes2 }, // 2 Butterfly - { 6, color_codes3 }, // 3 Freezer Burn - { 6, color_codes4 }, // 4 Ice Blade - { 6, color_codes5 }, // 5 Rainbow Glitter }; void Patterns::make_default(uint8_t index, Pattern &pat) @@ -51,20 +45,6 @@ void Patterns::make_default(uint8_t index, Pattern &pat) args.gap_dur = 6; args.dash_dur = 15; break; - case 3: // Freezer Burn - args.on_dur = 1; - args.off_dur = 9; - args.dash_dur = 5; - break; - case 4: // Ice Blade - args.on_dur = 3; - args.off_dur = 1; - args.gap_dur = 30; - break; - case 5: // Rainbow Glitter - args.on_dur = 1; - args.off_dur = 50; - break; } // assign default args pat.setArgs(args); @@ -80,16 +60,6 @@ void Patterns::make_pattern(PatternID id, Pattern &pat) switch (id) { default: - - case PATTERN_RIBBON: - args.on_dur = 9; // 10 for flashing pattern circles - break; - - case PATTERN_ULTRA_DOPS: - args.on_dur = 1; - args.off_dur = 3; - break; - case PATTERN_DOPS: args.on_dur = 1; args.off_dur = 9; @@ -110,22 +80,6 @@ void Patterns::make_pattern(PatternID id, Pattern &pat) args.off_dur = 23; // 21 for flashing pattern circles break; - case PATTERN_RAZOR: - args.on_dur = 3; - args.off_dur = 1; - args.gap_dur = 30; // 29 for flashing pattern circles - break; - - case PATTERN_FLARE: - args.on_dur = 2; - args.off_dur = 30; // 28 for flashing pattern circles - break; - - case PATTERN_BURST: - args.on_dur = 3; - args.off_dur = 40; // 37 for flashing pattern circles - break; - case PATTERN_GLOW: args.on_dur = 2; args.gap_dur = 40; // 39 for flashing pattern circles @@ -135,61 +89,6 @@ void Patterns::make_pattern(PatternID id, Pattern &pat) args.on_dur = 1; args.off_dur = 50; // 44 for flashing pattern circles break; - - case PATTERN_FLASH: - args.on_dur = 10; - args.off_dur = 250; // 120 for flashing pattern circles - break; - - case PATTERN_MORPH: - args.on_dur = 9; - args.blend_speed = 5; // 14 for flashing pattern circles - break; - - case PATTERN_MORPH_STROBE: - args.on_dur = 5; - args.off_dur = 8; - args.blend_speed = 10; // 19 for flashing pattern circles - break; - - case PATTERN_MORPH_STROBIE: - args.on_dur = 3; - args.off_dur = 23; - args.blend_speed = 10; // 35 for flashing pattern circles - break; - - case PATTERN_MORPH_GLOW: - args.on_dur = 1; - args.off_dur = 3; - args.gap_dur = 40; // 36 for flashing pattern circles - args.blend_speed = 30; - break; - - case PATTERN_DASH_DOPS: - args.on_dur = 1; - args.off_dur = 9; - args.gap_dur = 6; - args.dash_dur = 15; // 17 for flashing pattern circles - break; - - case PATTERN_DASH_DOT: - args.on_dur = 2; - args.off_dur = 3; - args.dash_dur = 24; // 22 for flashing pattern circles - break; - - case PATTERN_WAVE_PARTICLE: - args.on_dur = 1; - args.off_dur = 9; - args.dash_dur = 5; // 10 for flashing pattern circles - break; - - case PATTERN_LIGHTSPEED: - args.on_dur = 2; - args.off_dur = 3; - args.dash_dur = 24; // 23 for flashing pattern circles - args.blend_speed = 10; - break; } pat.setArgs(args); From 314624598395f567d5d0efb6a653dc6390dfa8c8 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Thu, 13 Feb 2025 11:47:34 +0100 Subject: [PATCH 02/12] Remove Global Brightness, Remove Glow Lock, Remove Shift Mode, Remove Randomizer --- Helios/Helios.cpp | 98 +---------------------------------------------- Helios/Helios.h | 7 ---- 2 files changed, 1 insertion(+), 104 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index f01c18b0..556fa8c4 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -269,21 +269,9 @@ void Helios::handle_state() case STATE_TOGGLE_CONJURE: handle_state_toggle_flag(FLAG_CONJURE); break; - case STATE_TOGGLE_LOCK: - handle_state_toggle_flag(FLAG_LOCKED); - break; case STATE_SET_DEFAULTS: handle_state_set_defaults(); break; - case STATE_SET_GLOBAL_BRIGHTNESS: - handle_state_set_global_brightness(); - break; - case STATE_SHIFT_MODE: - handle_state_shift_mode(); - break; - case STATE_RANDOMIZE: - handle_state_randomize(); - break; #ifdef HELIOS_CLI case STATE_SLEEP: // simulate sleep in helios CLI @@ -337,8 +325,6 @@ void Helios::handle_state_modes() case 1: Led::set(0, 0x3c, 0x31); break; // Color Selection case 2: Led::set(0x3c, 0, 0x0e); break; // Pattern Selection case 3: Led::set(0x3c, 0x1c, 0); break; // Conjure Mode - case 4: Led::set(0x3c, 0x3c, 0x3c); break; // Shift Mode - case 5: Led::set(HSVColor(Time::getCurtime(), 255, 100)); break; // Randomizer } } else { if (has_flag(FLAG_LOCKED)) { @@ -351,9 +337,7 @@ void Helios::handle_state_modes() switch (magnitude) { default: case 0: Led::clear(); break; // nothing - case 1: Led::set(0x3c, 0, 0); break; // Enter Glow Lock - case 2: Led::set(0, 0x3c, 0); break; // Global Brightness - case 3: Led::set(0, 0, 0x3c); break; // Master Reset + case 1: Led::set(0, 0, 0x3c); break; // Master Reset } } } @@ -391,13 +375,6 @@ void Helios::handle_off_menu(uint8_t mag, bool past) // otherwise if not locked handle the off menu switch (mag) { case 1: // red lock - cur_state = STATE_TOGGLE_LOCK; - Led::clear(); - return; // RETURN HERE - case 2: // green global brightness - cur_state = STATE_SET_GLOBAL_BRIGHTNESS; - return; // RETURN HERE - case 3: // blue reset defaults cur_state = STATE_SET_DEFAULTS; return; //RETURN HERE default: @@ -437,12 +414,6 @@ void Helios::handle_on_menu(uint8_t mag, bool past) cur_state = STATE_TOGGLE_CONJURE; Led::clear(); break; - case 4: // shift mode down - cur_state = STATE_SHIFT_MODE; - break; - case 5: // randomizer - cur_state = STATE_RANDOMIZE; - break; default: // hold past break; } @@ -756,73 +727,6 @@ void Helios::factory_reset() load_cur_mode(); } -void Helios::handle_state_set_global_brightness() -{ - if (Button::onShortClick()) { - menu_selection = (menu_selection + 1) % NUM_BRIGHTNESS_OPTIONS; - } - // show different levels of green for each selection - uint8_t col = 0; - uint8_t brightness = 0; - switch (menu_selection) { - case 0: - col = 0xFF; - brightness = BRIGHTNESS_HIGH; - break; - case 1: - col = 0x78; - brightness = BRIGHTNESS_MEDIUM; - break; - case 2: - col = 0x3c; - brightness = BRIGHTNESS_LOW; - break; - case 3: - col = 0x28; - brightness = BRIGHTNESS_LOWEST; - break; - } - Led::set(0, col, 0); - // when the user long clicks a selection - if (Button::onLongClick()) { - // set the brightness based on the selection - Led::setBrightness(brightness); - Storage::write_brightness(brightness); - cur_state = STATE_MODES; - } - show_selection(RGB_WHITE_BRI_LOW); -} - -void Helios::handle_state_shift_mode() -{ - uint8_t new_mode = (cur_mode > 0) ? (uint8_t)(cur_mode - 1) : (uint8_t)(NUM_MODE_SLOTS - 1); - // copy the storage from the new position into our current position - Storage::copy_slot(new_mode, cur_mode); - // point at the new position - cur_mode = new_mode; - // write out the current mode to the newly updated position - save_cur_mode(); - cur_state = STATE_MODES; -} - -void Helios::handle_state_randomize() -{ - if (Button::onShortClick()) { - Colorset &cur_set = pat.colorset(); - Random ctx(pat.crc32()); - uint8_t randVal = ctx.next8(); - cur_set.randomizeColors(ctx, (randVal + 1) % NUM_COLOR_SLOTS, Colorset::COLOR_MODE_RANDOMLY_PICK); - Patterns::make_pattern((PatternID)(randVal % PATTERN_COUNT), pat); - pat.init(); - } - if (Button::onLongClick()) { - save_cur_mode(); - cur_state = STATE_MODES; - } - pat.play(); - show_selection(RGB_WHITE_BRI_LOW); -} - void Helios::show_selection(RGBColor color) { // only show selection while pressing the button diff --git a/Helios/Helios.h b/Helios/Helios.h index 4ed325ea..47380648 100644 --- a/Helios/Helios.h +++ b/Helios/Helios.h @@ -65,9 +65,6 @@ class Helios static void handle_state_pat_select(); static void handle_state_toggle_flag(Flags flag); static void handle_state_set_defaults(); - static void handle_state_set_global_brightness(); - static void handle_state_shift_mode(); - static void handle_state_randomize(); static void show_selection(RGBColor color); static void factory_reset(); @@ -80,11 +77,7 @@ class Helios STATE_COLOR_SELECT_VAL, STATE_PATTERN_SELECT, STATE_TOGGLE_CONJURE, - STATE_TOGGLE_LOCK, STATE_SET_DEFAULTS, - STATE_SET_GLOBAL_BRIGHTNESS, - STATE_SHIFT_MODE, - STATE_RANDOMIZE, #ifdef HELIOS_CLI STATE_SLEEP, #endif From fd7ca0f051263fb617b236c850caa98821decec0 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Thu, 13 Feb 2025 22:52:03 +0100 Subject: [PATCH 03/12] Update color constants and pattern configurations - Add new color constants: RGB_AMBER and RGB_CHARTREUSE - Modify default color sets and pattern configurations - Update Makefile for macOS programmer settings --- Helios/ColorConstants.h | 3 +++ Helios/Patterns.cpp | 24 +++++++++++------------- HeliosEmbedded/Makefile | 4 ++-- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Helios/ColorConstants.h b/Helios/ColorConstants.h index 8801d4ac..5116b49b 100644 --- a/Helios/ColorConstants.h +++ b/Helios/ColorConstants.h @@ -36,6 +36,8 @@ #define RGB_CORAL_ORANGE (uint32_t)0xFF1E00 // 255, 30, 0 #define RGB_ORANGE (uint32_t)0xFF3C00 // 255, 60, 0 #define RGB_YELLOW (uint32_t)0xFF7800 // 255, 120, 0 +#define RGB_AMBER (uint32_t)0xFF9D00 // 255, 157, 0 +#define RGB_CHARTREUSE (uint32_t)0xC4FF00 // 196, 255, 0 #define RGB_LIME_GREEN (uint32_t)0x59FF00 // 89, 255, 0 #define RGB_GREEN (uint32_t)0x00FF00 // 0, 255, 0 #define RGB_SEAFOAM (uint32_t)0x00FF3C // 0, 255, 60 @@ -49,6 +51,7 @@ #define RGB_HOT_PINK (uint32_t)0xFF00B4 // 255, 0, 180 #define RGB_MAGENTA (uint32_t)0xFF003C // 255, 0, 60 + // Helios Medium Brightness Colors #define RGB_WHITE_BRI_MEDIUM (uint32_t)0x787878 // 120 120 120 #define RGB_RED_BRI_MEDIUM (uint32_t)0x780000 // 120, 0, 0 diff --git a/Helios/Patterns.cpp b/Helios/Patterns.cpp index f04aa53f..70e24c23 100644 --- a/Helios/Patterns.cpp +++ b/Helios/Patterns.cpp @@ -6,9 +6,9 @@ // define arrays of colors, you can reuse these if you have multiple // modes that use the same colorset -- these demonstrate the max amount // of colors in each set but you can absolutely list a lesser amount -static const uint32_t color_codes0[] = {RGB_RED, RGB_ORANGE, RGB_YELLOW, RGB_TURQUOISE, RGB_BLUE, RGB_PINK}; -static const uint32_t color_codes1[] = {RGB_RED, RGB_CORAL_ORANGE_SAT_MEDIUM, RGB_ORANGE, RGB_YELLOW_SAT_LOW}; -static const uint32_t color_codes2[] = {RGB_PURPLE_BRI_LOWEST, RGB_MAGENTA, RGB_HOT_PINK_SAT_MEDIUM, RGB_PINK_SAT_LOWEST}; +static const uint32_t color_codes0[] = {RGB_RED, RGB_ORANGE, RGB_WHITE}; +static const uint32_t color_codes1[] = {RGB_TURQUOISE, RGB_WHITE, RGB_BLUE}; +static const uint32_t color_codes2[] = {RGB_MAGENTA, RGB_ICE_BLUE, RGB_YELLOW}; // Define Colorset configurations for each slot struct default_colorset { @@ -19,9 +19,9 @@ struct default_colorset { // the array of colorset entries, make sure the number on the left reflects // the number of colors in the array on the right static const default_colorset default_colorsets[] = { - { 6, color_codes0 }, // 0 Lightside - { 4, color_codes1 }, // 1 Sauna - { 4, color_codes2 }, // 2 Butterfly + { 3, color_codes0 }, // 0 Fire ball + { 3, color_codes1 }, // 1 Chilly + { 3, color_codes2 }, // 2 Printer Ink }; void Patterns::make_default(uint8_t index, Pattern &pat) @@ -31,19 +31,17 @@ void Patterns::make_default(uint8_t index, Pattern &pat) } PatternArgs args; switch (index) { - case 0: // Lightside + case 0: // Fire ball args.on_dur = 2; args.gap_dur = 40; break; - case 1: // Sauna + case 1: // Chilly args.on_dur = 1; args.off_dur = 9; break; - case 2: // Butterfly - args.on_dur = 1; - args.off_dur = 9; - args.gap_dur = 6; - args.dash_dur = 15; + case 2: // Printer Ink + args.on_dur = 3; + args.off_dur = 23; break; } // assign default args diff --git a/HeliosEmbedded/Makefile b/HeliosEmbedded/Makefile index 41308e34..30c38184 100644 --- a/HeliosEmbedded/Makefile +++ b/HeliosEmbedded/Makefile @@ -56,9 +56,9 @@ ifeq ($(OS),Windows_NT) # Windows AVRDUDE_BAUDRATE = 115200 AVRDUDE_PORT = usb else ifeq ($(OS),Darwin) - AVRDUDE_PROGRAMMER = usbtiny + AVRDUDE_PROGRAMMER = stk500v1 AVRDUDE_BAUDRATE = 19200 - AVRDUDE_PORT = usb + AVRDUDE_PORT = /dev/tty.usbmodem21401 endif AVRDUDE_FLAGS = -C$(AVRDUDE_CONF) \ From 485fcb9fe2a01519cd34161bcdf6e7dd722d5c29 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Thu, 13 Feb 2025 23:10:26 +0100 Subject: [PATCH 04/12] Getting close on the Color selection, it saves the first color and exists early --- Helios/Helios.cpp | 300 ++++++++-------------------------------------- Helios/Helios.h | 29 ++--- 2 files changed, 61 insertions(+), 268 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 556fa8c4..9dc59f3c 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -256,12 +256,8 @@ void Helios::handle_state() case STATE_MODES: handle_state_modes(); break; - case STATE_COLOR_SELECT_SLOT: - case STATE_COLOR_SELECT_QUADRANT: - case STATE_COLOR_SELECT_HUE: - case STATE_COLOR_SELECT_SAT: - case STATE_COLOR_SELECT_VAL: - handle_state_col_select(); + case STATE_COLOR_SELECT: + handle_state_color_select(); break; case STATE_PATTERN_SELECT: handle_state_pat_select(); @@ -357,21 +353,6 @@ void Helios::handle_state_modes() void Helios::handle_off_menu(uint8_t mag, bool past) { - // if still locked then handle the unlocking menu which is just if mag == 5 - if (has_flag(FLAG_LOCKED)) { - switch (mag) { - case TIME_TILL_GLOW_LOCK_UNLOCK: // red lock - cur_state = STATE_TOGGLE_LOCK; - break; - default: - // just go back to sleep in hold-past off menu - enter_sleep(); - // ALWAYS RETURN AFTER SLEEP! WE WILL WAKE HERE! - } - // in this case we return either way, since we're locked - return; - } - // otherwise if not locked handle the off menu switch (mag) { case 1: // red lock @@ -397,7 +378,7 @@ void Helios::handle_on_menu(uint8_t mag, bool past) } break; case 1: // color select - cur_state = STATE_COLOR_SELECT_SLOT; + cur_state = STATE_COLOR_SELECT; // reset the menu selection menu_selection = 0; #if ALTERNATIVE_HSV_RGB == 1 @@ -419,247 +400,72 @@ void Helios::handle_on_menu(uint8_t mag, bool past) } } -void Helios::handle_state_col_select() -{ - ColorSelectOption slot_option = OPTION_NONE; - switch (cur_state) { - case STATE_COLOR_SELECT_SLOT: - // pick the target colorset slot - handle_state_col_select_slot(slot_option); - break; - case STATE_COLOR_SELECT_QUADRANT: - // pick the hue quadrant - handle_state_col_select_quadrant(); - break; - case STATE_COLOR_SELECT_HUE: - case STATE_COLOR_SELECT_SAT: - case STATE_COLOR_SELECT_VAL: - default: - // pick the hue sat or val - handle_state_col_select_hue_sat_val(); - break; - } - // get the current color - RGBColor cur = Led::get(); - cur.red /= 2; - cur.green /= 2; - cur.blue /= 2; - // this is a stupid override for when we're exiting color select - // show a white selection instead - if (slot_option != OPTION_NONE) { - cur = RGB_WHITE_BRI_LOW; - } - // show selection in all of these menus - show_selection(cur); -} - -void Helios::handle_state_col_select_slot(ColorSelectOption &out_option) +void Helios::handle_state_color_select() { Colorset &set = pat.colorset(); uint8_t num_cols = set.numColors(); - if (Button::onShortClick()) { - // the number of menus in slot selection = all colors + exit - uint8_t num_menus = num_cols + 1; - // except if the number of colors is less than total color slots - if (num_cols < NUM_COLOR_SLOTS) { - // then we have another menu: add color - num_menus++; - } - menu_selection = (menu_selection + 1) % num_menus; - } - - bool long_click = Button::onLongClick(); - - // Reset the color selection variables, these are the hue/sat/val that have been selected - // in the following menus, this is a weird place to reset these but it ends up being the only - // place where it can be written once and still handle all the possible cases it needs to run - selected_sat = 255; - selected_val = 255; - - if (num_cols < NUM_COLOR_SLOTS && menu_selection == num_cols) { - // add color - out_option = SELECTED_ADD; - Led::strobe(100, 100, RGB_WHITE_BRI_LOW, RGB_OFF); - if (long_click) { - selected_slot = menu_selection; - } - } else if (menu_selection == num_cols + 1 || (num_cols == NUM_COLOR_SLOTS && menu_selection == num_cols)) { - // exit - out_option = SELECTED_EXIT; - Led::strobe(60, 40, RGB_RED_BRI_LOW, RGB_OFF); - if (long_click) { -#if ALTERNATIVE_HSV_RGB == 1 - // restore hsv to rgb algorithm type, done color selection - g_hsv_rgb_alg = HSV_TO_RGB_GENERIC; -#endif - save_cur_mode(); - cur_state = STATE_MODES; - return; - } - } else { - out_option = SELECTED_SLOT; - selected_slot = menu_selection; - // render current selection - RGBColor col = set.get(selected_slot); - if (col.empty()) { - Led::strobe(1, 30, RGB_OFF, RGB_WHITE_BRI_LOW); - } else { - Led::strobe(3, 30, RGB_OFF, col); - } - if (Button::holdPressing()) { - // flash red - Led::strobe(150, 150, RGB_RED_BRI_LOW, col); - } - if (Button::onHoldClick()){ - set.removeColor(selected_slot); - return; - } - } - if (long_click) { - cur_state = (State)(cur_state + 1); - // reset the menu selection - menu_selection = 0; - } -} + // Array of predefined colors for the menu + static const uint32_t color_menu[NUM_COLORS] = { + RGB_OFF, + RGB_WHITE, + RGB_RED, + RGB_CORAL_ORANGE, + RGB_ORANGE, + RGB_YELLOW, + RGB_AMBER, + RGB_CHARTREUSE, + RGB_LIME_GREEN, + RGB_GREEN, + RGB_SEAFOAM, + RGB_TURQUOISE, + RGB_ICE_BLUE, + RGB_LIGHT_BLUE, + RGB_BLUE, + RGB_ROYAL_BLUE, + RGB_PURPLE, + RGB_PINK, + RGB_HOT_PINK, + RGB_MAGENTA, + }; -struct ColorsMenuData { - uint8_t hues[4]; -}; -// array of hues for selection -static const ColorsMenuData color_menu_data[4] = { - // hue0 hue1 hue2 hue3 - // ================================================================================== - { HUE_RED, HUE_CORAL_ORANGE, HUE_ORANGE, HUE_YELLOW }, - { HUE_LIME_GREEN, HUE_GREEN, HUE_SEAFOAM, HUE_TURQUOISE }, - { HUE_ICE_BLUE, HUE_LIGHT_BLUE, HUE_BLUE, HUE_ROYAL_BLUE }, - { HUE_PURPLE, HUE_PINK, HUE_HOT_PINK, HUE_MAGENTA }, -}; - -void Helios::handle_state_col_select_quadrant() -{ if (Button::onShortClick()) { - menu_selection = (menu_selection + 1) % NUM_MENUS_QUADRANT; + menu_selection = (menu_selection + 1) % NUM_COLORS; } - uint8_t hue_quad = (menu_selection - 2) % 4; - if (menu_selection > 5) { - menu_selection = 0; + // Show the current color + RGBColor current_color = color_menu[menu_selection]; + if (menu_selection == 0) { // Blank + Led::strobe(1, 30, RGB_OFF, RGB_WHITE_BRI_LOW); + } else { + Led::set(current_color); } if (Button::onLongClick()) { - // select hue/sat/val - switch (menu_selection) { - case 0: // selected blank - // add blank to set - pat.colorset().set(selected_slot, RGB_OFF); - // Return to the slot you were editing - menu_selection = selected_slot; - // go to slot selection - 1 because we will increment outside here - cur_state = STATE_COLOR_SELECT_SLOT; - // RETURN HERE - return; - case 1: // selected white - // adds white, skip hue/sat to brightness - selected_sat = 0; - menu_selection = 0; - cur_state = STATE_COLOR_SELECT_VAL; - // RETURN HERE - return; - default: // 2-5 - selected_base_quad = hue_quad; - break; + if (menu_selection == 0) { + pat.colorset().set(selected_slot, RGB_OFF); + } else { + // Add the selected color to the colorset + pat.colorset().set(selected_slot, current_color); } - } - - // default col1/col2 to off and white for the first two options - RGBColor col1 = RGB_OFF; - RGBColor col2; - uint16_t on_dur, off_dur; - switch (menu_selection) { - case 0: // Blank Option - col2 = RGB_WHITE_BRI_LOW; - on_dur = 1; - off_dur = 30; - break; - case 1: // White Option - col2 = RGB_WHITE; - on_dur = 9; - off_dur = 0; - break; - default: // Color options - col1 = HSVColor(color_menu_data[hue_quad].hues[0], 255, 255); - col2 = HSVColor(color_menu_data[hue_quad].hues[2], 255, 255); - on_dur = 500; - off_dur = 500; - break; - } - Led::strobe(on_dur, off_dur, col1, col2); - // show a white flash for the first two menus - if (menu_selection <= 1) { - show_selection(RGB_WHITE_BRI_LOW); - } else { - // dim the color for the quad menus - RGBColor cur = Led::get(); - cur.red /= 2; - cur.green /= 2; - cur.blue /= 2; - show_selection(RGB_WHITE_BRI_LOW); - } - if (Button::onLongClick()) { - cur_state = (State)(cur_state + 1); - // reset the menu selection + // Reset menu selection to start for next color menu_selection = 0; - } -} -void Helios::handle_state_col_select_hue_sat_val() -{ - // handle iterating to the next option - if (Button::onShortClick()) { - menu_selection = (menu_selection + 1) % NUM_MENUS_HUE_SAT_VAL; - } - // in the sat/val selection a longclick is next and hold is save but in - // the final val selection a longclick is save and there's no next - bool gotoNextMenu = Button::onLongClick(); - bool saveAndFinish = Button::onHoldClick(); - switch (cur_state) { - default: - case STATE_COLOR_SELECT_HUE: - selected_hue = color_menu_data[selected_base_quad].hues[menu_selection]; - break; - case STATE_COLOR_SELECT_SAT: - static const uint8_t saturation_values[4] = {HSV_SAT_HIGH, HSV_SAT_MEDIUM, HSV_SAT_LOW, HSV_SAT_LOWEST}; - selected_sat = saturation_values[menu_selection]; - break; - case STATE_COLOR_SELECT_VAL: - static const uint8_t hsv_values[4] = {HSV_VAL_HIGH, HSV_VAL_MEDIUM, HSV_VAL_LOW, HSV_VAL_LOWEST}; - selected_val = hsv_values[menu_selection]; - // longclick becomes save and there is no next - saveAndFinish = gotoNextMenu; - break; - } - // render current selection - Led::set(HSVColor(selected_hue, selected_sat, selected_val)); - // show the long selection flash - if (Button::holdPressing()) { - Led::strobe(150, 150, RGB_CORAL_ORANGE_SAT_LOWEST, Led::get()); - } - // check to see if we are holding to save and skip - if (saveAndFinish) { - cur_state = STATE_COLOR_SELECT_SLOT; - pat.updateColor(selected_slot, HSVColor(selected_hue, selected_sat, selected_val)); - save_cur_mode(); - // Return to the slot you were editing - menu_selection = selected_slot; - return; - } - if (gotoNextMenu) { - cur_state = (State)(cur_state + 1); - // reset the menu selection - menu_selection = 0; + // If we've selected 3 colors, save and exit + if (num_cols + 1 >= NUM_COLOR_SLOTS) { + save_cur_mode(); + cur_state = STATE_MODES; + } + else { + // Reset menu selection to start for next color + menu_selection = 0; + selected_slot = (selected_slot + 1) % NUM_COLOR_SLOTS; + } } + + // Show selection indicator + show_selection(RGB_WHITE_BRI_LOW); } void Helios::handle_state_pat_select() diff --git a/Helios/Helios.h b/Helios/Helios.h index 47380648..1f37fd88 100644 --- a/Helios/Helios.h +++ b/Helios/Helios.h @@ -46,35 +46,19 @@ class Helios static void handle_state(); static void handle_state_modes(); - - // the slot selection returns this info for internal menu logic - enum ColorSelectOption { - OPTION_NONE = 0, - - SELECTED_ADD, - SELECTED_EXIT, - SELECTED_SLOT - }; - - static void handle_off_menu(uint8_t mag, bool past); - static void handle_on_menu(uint8_t mag, bool past); - static void handle_state_col_select(); - static void handle_state_col_select_slot(ColorSelectOption &out_option); - static void handle_state_col_select_quadrant(); - static void handle_state_col_select_hue_sat_val(); + static void handle_state_color_select(); static void handle_state_pat_select(); static void handle_state_toggle_flag(Flags flag); static void handle_state_set_defaults(); static void show_selection(RGBColor color); static void factory_reset(); + static void handle_off_menu(uint8_t mag, bool past); + static void handle_on_menu(uint8_t mag, bool past); + enum State : uint8_t { STATE_MODES, - STATE_COLOR_SELECT_SLOT, - STATE_COLOR_SELECT_QUADRANT, - STATE_COLOR_SELECT_HUE, - STATE_COLOR_SELECT_SAT, - STATE_COLOR_SELECT_VAL, + STATE_COLOR_SELECT, STATE_PATTERN_SELECT, STATE_TOGGLE_CONJURE, STATE_SET_DEFAULTS, @@ -83,6 +67,9 @@ class Helios #endif }; + // Number of colors in the simplified color menu + static const uint8_t NUM_COLORS = 20; + // the current state of the system static State cur_state; // global flags for the entire system From 7f02bcfddcd37c2ab3cdf1067b334b7baca75789 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 16:24:30 +0100 Subject: [PATCH 05/12] Got the color selection to allow you to select 3 colors and then exit --- Helios/Helios.cpp | 58 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 9dc59f3c..617236c8 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -441,31 +441,65 @@ void Helios::handle_state_color_select() Led::set(current_color); } - if (Button::onLongClick()) { + bool saveAtGoToNextColor = Button::onLongClick(); + bool saveAndFinish = Button::onHoldClick(); + if (saveAtGoToNextColor) { if (menu_selection == 0) { pat.colorset().set(selected_slot, RGB_OFF); } else { // Add the selected color to the colorset pat.colorset().set(selected_slot, current_color); } - - // Reset menu selection to start for next color + // Increment the selected slot for next color + selected_slot++; + + // // Get updated color count after adding new color + // num_cols = set.numColors(); + // if (num_cols >= NUM_COLOR_SLOTS) { + // save_cur_mode(); + // cur_state = STATE_MODES; + // } menu_selection = 0; - // If we've selected 3 colors, save and exit - if (num_cols + 1 >= NUM_COLOR_SLOTS) { + if (selected_slot >= NUM_COLOR_SLOTS) { save_cur_mode(); cur_state = STATE_MODES; - } - else { - // Reset menu selection to start for next color menu_selection = 0; - selected_slot = (selected_slot + 1) % NUM_COLOR_SLOTS; + selected_slot = 0; } - } - // Show selection indicator - show_selection(RGB_WHITE_BRI_LOW); + } + // if (saveAndFinish) { + // save_cur_mode(); + // cur_state = STATE_MODES; + // } + + // // Increment the selected slot for next color + // selected_slot = (selected_slot + 1) % NUM_COLOR_SLOTS; + + // // Get updated color count after adding new color + // num_cols = set.numColors(); + + // // If we've filled all slots, save and exit + // if (num_cols >= NUM_COLOR_SLOTS) { + // save_cur_mode(); + // cur_state = STATE_MODES; + // } + + // // Reset menu selection to start for next color + // menu_selection = 0; + // } + + // // Show selection indicator + // show_selection(RGB_WHITE_BRI_LOW); + // if (saveAndFinish) { + // cur_state = STATE_MODES; + // pat.updateColor(selected_slot, current_color); + // save_cur_mode(); + // // Return to the slot you were editing + // menu_selection = selected_slot; + // return; + // } } void Helios::handle_state_pat_select() From efb59e9bbb4ce19447f36c2bdd35d22d0926854e Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 16:43:20 +0100 Subject: [PATCH 06/12] So I was able to make it exit early and save the first color but now I need to make it exit early while clearing the previous color --- Helios/Helios.cpp | 60 ++++++++++++----------------------------------- 1 file changed, 15 insertions(+), 45 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 617236c8..36b61683 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -402,9 +402,6 @@ void Helios::handle_on_menu(uint8_t mag, bool past) void Helios::handle_state_color_select() { - Colorset &set = pat.colorset(); - uint8_t num_cols = set.numColors(); - // Array of predefined colors for the menu static const uint32_t color_menu[NUM_COLORS] = { RGB_OFF, @@ -441,9 +438,7 @@ void Helios::handle_state_color_select() Led::set(current_color); } - bool saveAtGoToNextColor = Button::onLongClick(); - bool saveAndFinish = Button::onHoldClick(); - if (saveAtGoToNextColor) { + if (Button::onLongClick()) { if (menu_selection == 0) { pat.colorset().set(selected_slot, RGB_OFF); } else { @@ -452,54 +447,29 @@ void Helios::handle_state_color_select() } // Increment the selected slot for next color selected_slot++; - - // // Get updated color count after adding new color - // num_cols = set.numColors(); - // if (num_cols >= NUM_COLOR_SLOTS) { - // save_cur_mode(); - // cur_state = STATE_MODES; - // } + current_color.red /= 2; + current_color.green /= 2; + current_color.blue /= 2; + show_selection(current_color); menu_selection = 0; if (selected_slot >= NUM_COLOR_SLOTS) { save_cur_mode(); cur_state = STATE_MODES; - menu_selection = 0; selected_slot = 0; } } - // if (saveAndFinish) { - // save_cur_mode(); - // cur_state = STATE_MODES; - // } - - // // Increment the selected slot for next color - // selected_slot = (selected_slot + 1) % NUM_COLOR_SLOTS; - - // // Get updated color count after adding new color - // num_cols = set.numColors(); - - // // If we've filled all slots, save and exit - // if (num_cols >= NUM_COLOR_SLOTS) { - // save_cur_mode(); - // cur_state = STATE_MODES; - // } - - // // Reset menu selection to start for next color - // menu_selection = 0; - // } - - // // Show selection indicator - // show_selection(RGB_WHITE_BRI_LOW); - // if (saveAndFinish) { - // cur_state = STATE_MODES; - // pat.updateColor(selected_slot, current_color); - // save_cur_mode(); - // // Return to the slot you were editing - // menu_selection = selected_slot; - // return; - // } + if (Button::holdPressing()) { + // flash red + Led::strobe(150, 150, RGB_RED_BRI_LOW, current_color); + + } + if (Button::onHoldClick()) { + pat.colorset().set(selected_slot, current_color); + save_cur_mode(); + cur_state = STATE_MODES; + } } void Helios::handle_state_pat_select() From 32bf656a9f44c98ee9a8b7d07d2e30d9e042a7db Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 16:58:50 +0100 Subject: [PATCH 07/12] Improve color selection with persistent color set storage - Add `current_color_set` to track selected colors during color selection - Modify color selection logic to use `current_color_set` for storing and saving colors - Ensure all selected colors are saved when exiting color selection mode --- Helios/Helios.cpp | 22 +++++++++++++++------- Helios/Helios.h | 4 +--- Helios/HeliosConfig.h | 5 +++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 36b61683..9ddd4e7f 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -37,6 +37,7 @@ uint8_t Helios::selected_base_quad; uint8_t Helios::selected_hue; uint8_t Helios::selected_sat; uint8_t Helios::selected_val; +RGBColor Helios::current_color_set[NUM_COLOR_SLOTS]; Pattern Helios::pat; bool Helios::keepgoing; @@ -440,20 +441,25 @@ void Helios::handle_state_color_select() if (Button::onLongClick()) { if (menu_selection == 0) { - pat.colorset().set(selected_slot, RGB_OFF); + // Add the selected color to the colorset + current_color_set[selected_slot] = RGB_OFF; } else { // Add the selected color to the colorset - pat.colorset().set(selected_slot, current_color); + current_color_set[selected_slot] = current_color; } // Increment the selected slot for next color selected_slot++; - current_color.red /= 2; - current_color.green /= 2; - current_color.blue /= 2; - show_selection(current_color); + RGBColor cur = Led::get(); + cur.red /= 2; + cur.green /= 2; + cur.blue /= 2; + show_selection(cur); menu_selection = 0; if (selected_slot >= NUM_COLOR_SLOTS) { + for (uint8_t i = 0; i < NUM_COLOR_SLOTS; i++) { + pat.colorset().set(i, current_color_set[i]); + } save_cur_mode(); cur_state = STATE_MODES; selected_slot = 0; @@ -466,7 +472,9 @@ void Helios::handle_state_color_select() } if (Button::onHoldClick()) { - pat.colorset().set(selected_slot, current_color); + for (uint8_t i = 0; i < selected_slot + 1; i++) { + pat.colorset().set(i, current_color_set[i]); + } save_cur_mode(); cur_state = STATE_MODES; } diff --git a/Helios/Helios.h b/Helios/Helios.h index 1f37fd88..6bdf7570 100644 --- a/Helios/Helios.h +++ b/Helios/Helios.h @@ -67,9 +67,6 @@ class Helios #endif }; - // Number of colors in the simplified color menu - static const uint8_t NUM_COLORS = 20; - // the current state of the system static State cur_state; // global flags for the entire system @@ -82,6 +79,7 @@ class Helios static uint8_t selected_hue; static uint8_t selected_sat; static uint8_t selected_val; + static RGBColor current_color_set[NUM_COLOR_SLOTS]; static PatternArgs default_args[6]; static Colorset default_colorsets[6]; static Pattern pat; diff --git a/Helios/HeliosConfig.h b/Helios/HeliosConfig.h index eee05f71..3120131c 100644 --- a/Helios/HeliosConfig.h +++ b/Helios/HeliosConfig.h @@ -69,6 +69,11 @@ // The number of slots in a colorset #define NUM_COLOR_SLOTS 3 +// Max Colors +// +// The number of colors in a colorset +#define NUM_COLORS 20 + // Mode Slots // // The number of modes on the device From e90d5c4a29ca7e2721d038c85de33ddf69bac2a1 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 17:13:15 +0100 Subject: [PATCH 08/12] Refactor color selection visual feedback - Move dimmed selection indicator to end of method - Simplify color selection state transition logic - Ensure consistent visual feedback during color selection --- Helios/Helios.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 9ddd4e7f..3ec24cc7 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -449,11 +449,6 @@ void Helios::handle_state_color_select() } // Increment the selected slot for next color selected_slot++; - RGBColor cur = Led::get(); - cur.red /= 2; - cur.green /= 2; - cur.blue /= 2; - show_selection(cur); menu_selection = 0; if (selected_slot >= NUM_COLOR_SLOTS) { @@ -464,8 +459,15 @@ void Helios::handle_state_color_select() cur_state = STATE_MODES; selected_slot = 0; } - } + + // Show dimmed selection indicator while button is pressed + RGBColor cur = Led::get(); + cur.red /= 2; + cur.green /= 2; + cur.blue /= 2; + show_selection(cur); + if (Button::holdPressing()) { // flash red Led::strobe(150, 150, RGB_RED_BRI_LOW, current_color); From 46c4b981bdad2ecdd5b9960ccac7a5d2a23d41b6 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 17:38:38 +0100 Subject: [PATCH 09/12] Got the exit early functionality to work --- Helios/Helios.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index 3ec24cc7..dd890755 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -468,17 +468,25 @@ void Helios::handle_state_color_select() cur.blue /= 2; show_selection(cur); - if (Button::holdPressing()) { - // flash red - Led::strobe(150, 150, RGB_RED_BRI_LOW, current_color); - + // If the user is on the blank option (menu_selection == 0) and holding, flash red to indicate they can save with current colors + if (menu_selection == 0 && Button::holdPressing()) { + // flash red to indicate save action is available + Led::strobe(150, 150, RGB_RED_BRI_LOW, RGB_OFF); } + if (Button::onHoldClick()) { - for (uint8_t i = 0; i < selected_slot + 1; i++) { - pat.colorset().set(i, current_color_set[i]); + // If they're on the blank option and have at least one color selected, save with current colors + if (menu_selection == 0 && selected_slot > 0) { + // First clear any existing colors in the pattern + pat.colorset().clear(); + // Then add only the colors that have been selected + for (uint8_t i = 0; i < selected_slot; i++) { + pat.colorset().set(i, current_color_set[i]); + } + save_cur_mode(); + cur_state = STATE_MODES; + selected_slot = 0; } - save_cur_mode(); - cur_state = STATE_MODES; } } From 82dd9514647e60acdc279452e3ce6de216275057 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 17:48:55 +0100 Subject: [PATCH 10/12] Add setAll method to Colorset for efficient color configuration - Implement `setAll` method in Colorset to replace manual color setting loops - Modify color selection state to use new `setAll` method - Simplify color setting logic in Helios state handling - Improve color configuration efficiency and readability --- Helios/Colorset.cpp | 20 ++++++++++++++------ Helios/Colorset.h | 3 +++ Helios/Helios.cpp | 13 ++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Helios/Colorset.cpp b/Helios/Colorset.cpp index bad37269..c18caf4f 100644 --- a/Helios/Colorset.cpp +++ b/Helios/Colorset.cpp @@ -244,15 +244,23 @@ RGBColor Colorset::get(uint8_t index) const // a slot higher than the number of colors in the colorset void Colorset::set(uint8_t index, RGBColor col) { - // special case for 'setting' a color at the edge of the palette, - // ie adding a new color when you set an index higher than the max - if (index >= m_numColors) { - if (!addColor(col)) { - //ERROR_LOGF("Failed to add new color at index %u", index); - } + if (index >= NUM_COLOR_SLOTS) { return; } m_palette[index] = col; + if (index >= m_numColors) { + m_numColors = index + 1; + } +} + +void Colorset::setAll(const RGBColor* colors, uint8_t num_colors) +{ + // First clear existing colors + clear(); + // Then set new colors up to num_colors + for (uint8_t i = 0; i < num_colors && i < NUM_COLOR_SLOTS; i++) { + set(i, colors[i]); + } } // skip some amount of colors diff --git a/Helios/Colorset.h b/Helios/Colorset.h index 4c6aeafe..6f30e788 100644 --- a/Helios/Colorset.h +++ b/Helios/Colorset.h @@ -99,6 +99,9 @@ class Colorset // a slot higher than the number of colors in the colorset void set(uint8_t index, RGBColor col); + // set all colors from an array up to num_colors + void setAll(const RGBColor* colors, uint8_t num_colors); + // skip some amount of colors void skip(int32_t amount = 1); diff --git a/Helios/Helios.cpp b/Helios/Helios.cpp index dd890755..862b539c 100644 --- a/Helios/Helios.cpp +++ b/Helios/Helios.cpp @@ -452,9 +452,8 @@ void Helios::handle_state_color_select() menu_selection = 0; if (selected_slot >= NUM_COLOR_SLOTS) { - for (uint8_t i = 0; i < NUM_COLOR_SLOTS; i++) { - pat.colorset().set(i, current_color_set[i]); - } + // Set all colors at once using the new method + pat.colorset().setAll(current_color_set, NUM_COLOR_SLOTS); save_cur_mode(); cur_state = STATE_MODES; selected_slot = 0; @@ -477,12 +476,8 @@ void Helios::handle_state_color_select() if (Button::onHoldClick()) { // If they're on the blank option and have at least one color selected, save with current colors if (menu_selection == 0 && selected_slot > 0) { - // First clear any existing colors in the pattern - pat.colorset().clear(); - // Then add only the colors that have been selected - for (uint8_t i = 0; i < selected_slot; i++) { - pat.colorset().set(i, current_color_set[i]); - } + // Set all selected colors at once + pat.colorset().setAll(current_color_set, selected_slot); save_cur_mode(); cur_state = STATE_MODES; selected_slot = 0; From 3757134b2c4976fc2d9fffc8669c179e3ea31cd9 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 17:51:29 +0100 Subject: [PATCH 11/12] Enhance Colorset color setting with dynamic color addition - Modify `set` method to automatically add colors when setting an index beyond current palette size - Simplify color setting logic by removing redundant index tracking - Improve color palette management with more flexible color addition --- Helios/Colorset.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Helios/Colorset.cpp b/Helios/Colorset.cpp index c18caf4f..abcd03ec 100644 --- a/Helios/Colorset.cpp +++ b/Helios/Colorset.cpp @@ -244,13 +244,15 @@ RGBColor Colorset::get(uint8_t index) const // a slot higher than the number of colors in the colorset void Colorset::set(uint8_t index, RGBColor col) { - if (index >= NUM_COLOR_SLOTS) { + // special case for 'setting' a color at the edge of the palette, + // ie adding a new color when you set an index higher than the max + if (index >= m_numColors) { + if (!addColor(col)) { + //ERROR_LOGF("Failed to add new color at index %u", index); + } return; } m_palette[index] = col; - if (index >= m_numColors) { - m_numColors = index + 1; - } } void Colorset::setAll(const RGBColor* colors, uint8_t num_colors) From 866de08bd2a5815476bd889033b6a5aed88fa7d7 Mon Sep 17 00:00:00 2001 From: Kurt LaVacque Date: Fri, 14 Feb 2025 17:58:24 +0100 Subject: [PATCH 12/12] Simplify pattern enumeration in Patterns.h - Remove unused pattern IDs from the enumeration - Consolidate strobe-related patterns - Reduce complexity of pattern identification --- Helios/Patterns.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Helios/Patterns.h b/Helios/Patterns.h index a653a330..bbb4b158 100644 --- a/Helios/Patterns.h +++ b/Helios/Patterns.h @@ -18,28 +18,12 @@ enum PatternID : int8_t { // ===================================== // Strobe - PATTERN_RIBBON = PATTERN_FIRST, - PATTERN_ULTRA_DOPS, - PATTERN_DOPS, + PATTERN_DOPS = PATTERN_FIRST, PATTERN_STROBE, PATTERN_HYPNOSTROBE, PATTERN_STROBIE, - PATTERN_RAZOR, - PATTERN_FLARE, - PATTERN_BURST, PATTERN_GLOW, PATTERN_FLICKER, - PATTERN_FLASH, - // Morph - PATTERN_MORPH, - PATTERN_MORPH_STROBE, - PATTERN_MORPH_STROBIE, - PATTERN_MORPH_GLOW, - // Dash - PATTERN_DASH_DOPS, - PATTERN_DASH_DOT, - PATTERN_WAVE_PARTICLE, - PATTERN_LIGHTSPEED, // Meta pattern constants INTERNAL_PATTERNS_END,