Removing rising timer on packet intialisation to allow for true Direct mode

This commit is contained in:
Chris 2021-08-19 00:38:01 +10:00 committed by Adam Honse
parent ab9a7674bd
commit dfcc436472
3 changed files with 14 additions and 24 deletions

View file

@ -362,42 +362,32 @@ void RGBFusion2USBController::SetLEDEffect(unsigned int led, int mode, unsigned
pkt.e.effect_type = mode;
pkt.e.color0 = r << 16 | g << 8 | b;
if(speed < speeds.size())
{
const std::array<int, 3>& s = speeds[speed];
pkt.e.period0 = s[0];
pkt.e.period1 = s[1];
pkt.e.period2 = s[2];
}
pkt.e.max_brightness = brightness;
switch(mode)
{
case 0:
case 0: // Direct
case 1: // Static
break;
// Static
case 1:
break;
case 2: //Breathing
case 3: //Blink
case 4: // Color Cycle
if(speed < speeds.size())
{
const std::array<int, 3>& s = speeds[speed];
// Breathing
case 2:
pkt.e.period0 = s[0];
pkt.e.period1 = s[1];
pkt.e.period2 = s[2];
}
// Blink
case 3:
if(random)
{
pkt.e.effect_param0 = 7; // cycle through up to 7 (max?) colors
}
break;
// Color Cycle
case 4:
pkt.e.effect_param0 = 7; // cycle through up to 7 (max?) colors
break;
// "Fake" effects
case 10: // flashing, flashing color cycle
pkt.e.period0 = 200;

View file

@ -175,7 +175,7 @@ union PktEffect
e.max_brightness = 100;
e.min_brightness = 0;
e.color0 = 0x00FF2100; //orange
e.period0 = 1200;
e.period0 = 0; //Rising Timer - Needs to be 0 for "Direct"
e.period1 = 1200;
e.period2 = 200;
e.period3 = 200;

View file

@ -533,8 +533,8 @@ void RGBController_RGBFusion2USB::UpdateZoneLEDs(int zone)
/*---------------------------------------------------------*\
| Get mode parameters |
\*---------------------------------------------------------*/
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
int mode_value = (modes[active_mode].value);
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM || mode_value == EFFECT_COLORCYCLE);
/*---------------------------------------------------------*\
| Set motherboard LEDs |