@@ -416,7 +416,7 @@ void RotaryEncoderUIUsermod::sortModesAndPalettes() {
416416
417417byte *RotaryEncoderUIUsermod::re_initIndexArray (int numModes) {
418418 byte *indexes = (byte *)malloc (sizeof (byte) * numModes);
419- for (byte i = 0 ; i < numModes; i++) {
419+ for (unsigned i = 0 ; i < numModes; i++) {
420420 indexes[i] = i;
421421 }
422422 return indexes;
@@ -700,7 +700,7 @@ void RotaryEncoderUIUsermod::findCurrentEffectAndPalette() {
700700
701701 effectPaletteIndex = 0 ;
702702 DEBUG_PRINTLN (effectPalette);
703- for (uint8_t i = 0 ; i < strip.getPaletteCount ()+strip.customPalettes .size (); i++) {
703+ for (unsigned i = 0 ; i < strip.getPaletteCount ()+strip.customPalettes .size (); i++) {
704704 if (palettes_alpha_indexes[i] == effectPalette) {
705705 effectPaletteIndex = i;
706706 DEBUG_PRINTLN (F (" Found palette." ));
@@ -764,7 +764,7 @@ void RotaryEncoderUIUsermod::changeEffect(bool increase) {
764764 effectCurrent = modes_alpha_indexes[effectCurrentIndex];
765765 stateChanged = true ;
766766 if (applyToAll) {
767- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
767+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
768768 Segment& seg = strip.getSegment (i);
769769 if (!seg.isActive ()) continue ;
770770 seg.setMode (effectCurrent);
@@ -792,7 +792,7 @@ void RotaryEncoderUIUsermod::changeEffectSpeed(bool increase) {
792792 effectSpeed = max (min ((increase ? effectSpeed+fadeAmount : effectSpeed-fadeAmount), 255 ), 0 );
793793 stateChanged = true ;
794794 if (applyToAll) {
795- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
795+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
796796 Segment& seg = strip.getSegment (i);
797797 if (!seg.isActive ()) continue ;
798798 seg.speed = effectSpeed;
@@ -820,7 +820,7 @@ void RotaryEncoderUIUsermod::changeEffectIntensity(bool increase) {
820820 effectIntensity = max (min ((increase ? effectIntensity+fadeAmount : effectIntensity-fadeAmount), 255 ), 0 );
821821 stateChanged = true ;
822822 if (applyToAll) {
823- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
823+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
824824 Segment& seg = strip.getSegment (i);
825825 if (!seg.isActive ()) continue ;
826826 seg.intensity = effectIntensity;
@@ -855,7 +855,7 @@ void RotaryEncoderUIUsermod::changeCustom(uint8_t par, bool increase) {
855855 case 2 : val = sid.custom2 = max (min ((increase ? sid.custom2 +fadeAmount : sid.custom2 -fadeAmount), 255 ), 0 ); break ;
856856 default : val = sid.custom1 = max (min ((increase ? sid.custom1 +fadeAmount : sid.custom1 -fadeAmount), 255 ), 0 ); break ;
857857 }
858- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
858+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
859859 Segment& seg = strip.getSegment (i);
860860 if (!seg.isActive () || i == id) continue ;
861861 switch (par) {
@@ -894,7 +894,7 @@ void RotaryEncoderUIUsermod::changePalette(bool increase) {
894894 effectPalette = palettes_alpha_indexes[effectPaletteIndex];
895895 stateChanged = true ;
896896 if (applyToAll) {
897- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
897+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
898898 Segment& seg = strip.getSegment (i);
899899 if (!seg.isActive ()) continue ;
900900 seg.setPalette (effectPalette);
@@ -923,7 +923,7 @@ void RotaryEncoderUIUsermod::changeHue(bool increase){
923923 colorHStoRGB (currentHue1*256 , currentSat1, col);
924924 stateChanged = true ;
925925 if (applyToAll) {
926- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
926+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
927927 Segment& seg = strip.getSegment (i);
928928 if (!seg.isActive ()) continue ;
929929 seg.colors [0 ] = RGBW32 (col[0 ], col[1 ], col[2 ], col[3 ]);
@@ -952,7 +952,7 @@ void RotaryEncoderUIUsermod::changeSat(bool increase){
952952 currentSat1 = max (min ((increase ? currentSat1+fadeAmount : currentSat1-fadeAmount), 255 ), 0 );
953953 colorHStoRGB (currentHue1*256 , currentSat1, col);
954954 if (applyToAll) {
955- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
955+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
956956 Segment& seg = strip.getSegment (i);
957957 if (!seg.isActive ()) continue ;
958958 seg.colors [0 ] = RGBW32 (col[0 ], col[1 ], col[2 ], col[3 ]);
@@ -1012,7 +1012,7 @@ void RotaryEncoderUIUsermod::changeCCT(bool increase){
10121012#endif
10131013 currentCCT = max (min ((increase ? currentCCT+fadeAmount : currentCCT-fadeAmount), 255 ), 0 );
10141014// if (applyToAll) {
1015- for (byte i=0 ; i<strip.getSegmentsNum (); i++) {
1015+ for (unsigned i=0 ; i<strip.getSegmentsNum (); i++) {
10161016 Segment& seg = strip.getSegment (i);
10171017 if (!seg.isActive ()) continue ;
10181018 seg.setCCT (currentCCT);
0 commit comments