File tree Expand file tree Collapse file tree
usermod_v2_four_line_display_ALT
usermod_v2_rotary_encoder_ui_ALT Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ class FourLineDisplayUsermod : public Usermod {
158158 uint8_t knownBrightness = 0 ;
159159 uint8_t knownEffectSpeed = 0 ;
160160 uint8_t knownEffectIntensity = 0 ;
161- uint8_t knownMode = 0 ;
161+ uint16_t knownMode = 0 ;
162162 uint8_t knownPalette = 0 ;
163163 uint8_t knownMinute = 99 ;
164164 uint8_t knownHour = 99 ;
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ void RotaryEncoderUIUsermod::sortModesAndPalettes() {
353353
354354byte *RotaryEncoderUIUsermod::re_initIndexArray (int numModes) {
355355 byte *indexes = (byte *)malloc (sizeof (byte) * numModes);
356- for (byte i = 0 ; i < numModes; i++) {
356+ for (uint16_t i = 0 ; i < numModes; i++) { // WLEDMM changed to uint16_t to avoid infinite loop with 16bit mode IDs
357357 indexes[i] = i;
358358 }
359359 return indexes;
@@ -630,7 +630,7 @@ void RotaryEncoderUIUsermod::displayNetworkInfo() {
630630void RotaryEncoderUIUsermod::findCurrentEffectAndPalette () {
631631 if (modes_alpha_indexes == nullptr ) return ; // WLEDMM bugfix
632632 currentEffectAndPaletteInitialized = true ;
633- for (uint8_t i = 0 ; i < strip.getModeCount (); i++) {
633+ for (uint16_t i = 0 ; i < strip.getModeCount (); i++) { // WLEDMM changed to uint16_t to avoid infinite loop with 16bit mode IDs
634634 if (modes_alpha_indexes[i] == effectCurrent) {
635635 effectCurrentIndex = i;
636636 break ;
You can’t perform that action at this time.
0 commit comments