Skip to content

Commit d7bab0d

Browse files
committed
Add support for MSI X870 GAMING PLUS WIFI (MS-7E47)
1 parent fa03750 commit d7bab0d

2 files changed

Lines changed: 28 additions & 7 deletions

File tree

Controllers/MSIMysticLightController/MSIMysticLight761Controller/MSIMysticLight761Controller.cpp

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,20 @@ static const std::vector<MSI_ZONE> zone_set1 =
4545
MSI_ZONE_JARGB_3,
4646
};
4747

48-
static const std::string board_names[] = { "MSI MAG X870 TOMAHAWK WIFI (MS-7E51)", "MSI MAG B850M MORTAR WIFI (MS-7E61)", "MSI MPG B850I EDGE TI WIFI (MS-7E79)" };
48+
static const std::string board_names[] =
49+
{
50+
"MSI MAG X870 TOMAHAWK WIFI (MS-7E51)",
51+
"MSI MAG B850M MORTAR WIFI (MS-7E61)",
52+
"MSI MPG B850I EDGE TI WIFI (MS-7E79)",
53+
"MSI X870 GAMING PLUS WIFI (MS-7E47)"
54+
};
4955

5056
static const mystic_light_761_config board_configs[] =
5157
{
5258
{ &(board_names[0]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI X870 TOMAHAWK WIFI
5359
{ &(board_names[1]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MAG B850M MORTAR WIFI
5460
{ &(board_names[2]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MPG B850I EDGE TI WIFI
61+
{ &(board_names[3]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI X870 GAMING PLUS WIFI
5562
};
5663

5764

@@ -153,8 +160,6 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
153160
location = path;
154161
name = dev_name;
155162

156-
supported_zones = new std::vector<MSI_ZONE>;
157-
158163
const mystic_light_761_config * board_config = nullptr;
159164
for(int i = 0; i < NUM_CONFS; i++)
160165
{
@@ -232,8 +237,6 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
232237
int res = hid_send_feature_report(dev, conf_arr, SETUP_ARRAY_SIZE);
233238
LOG_INFO("Sending configuration resulted in %i\n", res);
234239

235-
free(conf_arr);
236-
237240
data = new FeaturePacket_761;
238241

239242
data->jaf.zone = MSI_ZONE_JAF;
@@ -256,6 +259,8 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
256259
init_packet(&data->jargb2);
257260
init_packet(&data->jargb3);
258261
}
262+
263+
free(conf_arr);
259264
}
260265
else
261266
{
@@ -267,6 +272,22 @@ MSIMysticLight761Controller::MSIMysticLight761Controller
267272
MSIMysticLight761Controller::~MSIMysticLight761Controller()
268273
{
269274
hid_close(dev);
275+
276+
if(data)
277+
{
278+
delete data;
279+
data = nullptr;
280+
}
281+
282+
for(ZoneConfig& zone : zone_configs)
283+
{
284+
if(zone.zone_data)
285+
{
286+
delete zone.zone_data;
287+
zone.zone_data = nullptr;
288+
}
289+
}
290+
zone_configs.clear();
270291
}
271292

272293
void MSIMysticLight761Controller::SetMode

Controllers/MSIMysticLightController/MSIMysticLight761Controller/MSIMysticLight761Controller.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ class MSIMysticLight761Controller
131131
private:
132132
std::string name;
133133
std::vector<MSIMysticLight761Controller::ZoneConfig> zone_configs;
134-
std::vector<MSI_ZONE>* supported_zones;
135-
hid_device* dev;
134+
const std::vector<MSI_ZONE>* supported_zones;
135+
hid_device* dev;
136136
std::string location;
137137
std::string version_aprom;
138138
std::string version_ldrom;

0 commit comments

Comments
 (0)