Skip to content

Commit be84a60

Browse files
More Polychrome V1 changes, set LED selection register for ASRLED/Polychrome V1
1 parent e40617e commit be84a60

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

Controllers/PolychromeController/PolychromeController.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ void PolychromeController::SetColorsAndSpeed(unsigned char led, unsigned char re
133133
switch(asrock_type)
134134
{
135135
case ASROCK_TYPE_ASRLED:
136+
case ASROCK_TYPE_POLYCHROME_V1:
137+
/*-----------------------------------------------------*\
138+
| Select LED |
139+
\*-----------------------------------------------------*/
140+
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_LED_SELECT, 1, select_led_pkt);
141+
std::this_thread::sleep_for(1ms);
142+
136143
switch(active_mode)
137144
{
138145
/*-----------------------------------------------------*\
@@ -170,7 +177,6 @@ void PolychromeController::SetColorsAndSpeed(unsigned char led, unsigned char re
170177
std::this_thread::sleep_for(1ms);
171178
break;
172179

173-
case ASROCK_TYPE_POLYCHROME_V1:
174180
case ASROCK_TYPE_POLYCHROME_V2:
175181
/*-----------------------------------------------------*\
176182
| Select LED |
@@ -196,9 +202,19 @@ void PolychromeController::SetMode(unsigned char mode, unsigned char speed)
196202
switch(asrock_type)
197203
{
198204
case ASROCK_TYPE_ASRLED:
205+
bus->i2c_smbus_write_block_data(dev, ASRLED_REG_MODE, 1, &active_mode);
206+
std::this_thread::sleep_for(1ms);
207+
break;
208+
199209
case ASROCK_TYPE_POLYCHROME_V1:
200210
bus->i2c_smbus_write_block_data(dev, ASRLED_REG_MODE, 1, &active_mode);
201211
std::this_thread::sleep_for(1ms);
212+
213+
/*-----------------------------------------------------*\
214+
| Select a single LED |
215+
\*-----------------------------------------------------*/
216+
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_LED_COUNT, 0, led_count_pkt);
217+
std::this_thread::sleep_for(1ms);
202218
break;
203219

204220
case ASROCK_TYPE_POLYCHROME_V2:

Controllers/PolychromeController/PolychromeController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum
2727
{
2828
ASRLED_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
2929
ASRLED_REG_MODE = 0x30, /* Mode selection register */
30+
ASRLED_REG_LED_SELECT = 0x31, /* LED selection register */
3031
};
3132

3233
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */

0 commit comments

Comments
 (0)