Implement a speed table for AMD Wraith Prism to use the values taken from the official software. Interpolation was causing strange issues.

This commit is contained in:
Adam Honse
2020-01-23 22:23:37 -06:00
parent 2e84e9808c
commit 2a76201ca4
3 changed files with 45 additions and 13 deletions

View File

@@ -129,7 +129,7 @@ std::string AMDWraithPrismController::GetFirmwareVersionString()
void AMDWraithPrismController::SetFanMode(unsigned char mode, unsigned char speed, bool random_color)
{
current_fan_mode = mode;
current_fan_speed = speed;
current_fan_speed = speed_values_fan_logo[speed][mode];
current_fan_random_color = random_color;
}
@@ -152,7 +152,7 @@ void AMDWraithPrismController::SetFanColor(unsigned char red, unsigned char gree
void AMDWraithPrismController::SetLogoMode(unsigned char mode, unsigned char speed, bool random_color)
{
current_logo_mode = mode;
current_logo_speed = speed;
current_logo_speed = speed_values_fan_logo[speed][mode];
current_logo_random_color = random_color;
}
@@ -175,7 +175,7 @@ void AMDWraithPrismController::SetLogoColor(unsigned char red, unsigned char gre
void AMDWraithPrismController::SetRingMode(unsigned char mode, unsigned char speed, bool direction, bool random_color)
{
current_ring_mode = mode;
current_ring_speed = speed;
current_ring_speed = speed_values_ring[speed][mode];
current_ring_direction = direction;
current_ring_random_color = random_color;
}

View File

@@ -20,6 +20,13 @@ static const unsigned char max_brightness_fan_logo[] =
0xFF
};
static const unsigned char speed_values_fan_logo[][5] =
{
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, /* Static */
{ 0x96, 0x8C, 0x80, 0x6E, 0x68 }, /* Color Cycle */
{ 0x3C, 0x37, 0x31, 0x2C, 0x26 }, /* Breathing */
};
static const unsigned char max_brightness_ring[] =
{
0xFF,
@@ -52,6 +59,22 @@ static const unsigned char mode_value_ring[] =
0x05
};
static const unsigned char speed_values_ring[][5] =
{
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, /* Static */
{ 0x3C, 0x37, 0x31, 0x2C, 0x26 }, /* Breathing */
{ 0x96, 0x8C, 0x80, 0x6E, 0x68 }, /* Color Cycle */
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */
{ 0x72, 0x68, 0x64, 0x62, 0x61 }, /* Rainbow */
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Bounce */
{ 0x77, 0x74, 0x6E, 0x6B, 0x67 }, /* Chase */
{ 0x77, 0x74, 0x6E, 0x6B, 0x67 }, /* Swirl */
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Morse Code */
};
enum
{
AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC = 0x01, /* Fan/Logo Static Mode */
@@ -73,6 +96,15 @@ enum
AMD_WRAITH_PRISM_EFFECT_CHANNEL_MORSE = 0x0B, /* Morse code effect channel */
};
enum
{
AMD_WRAITH_PRISM_SPEED_SLOWEST = 0x00, /* Slowest speed */
AMD_WRAITH_PRISM_SPEED_SLOW = 0x01, /* Slow speed */
AMD_WRAITH_PRISM_SPEED_NORMAL = 0x02, /* Normal speed */
AMD_WRAITH_PRISM_SPEED_FAST = 0x03, /* Fast speed */
AMD_WRAITH_PRISM_SPEED_FASTEST = 0x04, /* Fastest speed */
};
class AMDWraithPrismController
{
public:

View File

@@ -18,7 +18,7 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
version = wraith->GetFirmwareVersionString();
mode Static;
Static.name = "Static";
Static.name = "Static";
Static.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_STATIC;
Static.flags = MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR;
modes.push_back(Static);
@@ -27,28 +27,28 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl
Breathing.name = "Breathing";
Breathing.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_BREATHING;
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR | MODE_FLAG_RANDOM_COLOR;
Breathing.speed_min = 0x3C;
Breathing.speed_max = 0x26;
Breathing.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
Breathing.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST;
Breathing.random = false;
Breathing.speed = 0x31;
Breathing.speed = AMD_WRAITH_PRISM_SPEED_NORMAL;
modes.push_back(Breathing);
mode ColorCycle;
ColorCycle.name = "Color Cycle";
ColorCycle.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_COLOR_CYCLE;
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
ColorCycle.speed_min = 0x96;
ColorCycle.speed_max = 0x68;
ColorCycle.speed = 0x80;
ColorCycle.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
ColorCycle.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST;
ColorCycle.speed = AMD_WRAITH_PRISM_SPEED_NORMAL;
modes.push_back(ColorCycle);
mode Rainbow;
Rainbow.name = "Rainbow";
Rainbow.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_RAINBOW;
Rainbow.flags = MODE_FLAG_HAS_SPEED;
Rainbow.speed_min = 0x72;
Rainbow.speed_max = 0x61;
Rainbow.speed = 0x64;
Rainbow.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST;
Rainbow.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST;
Rainbow.speed = AMD_WRAITH_PRISM_SPEED_NORMAL;
modes.push_back(Rainbow);
led logo_led;