Fixed regression bug from fd3434b8
* Renamed LenovoRGBController_Gen7_8 to RGBController_Lenovo_Gen7_8 to align with naming convention * Fixed #include statements pointing to wrong header(s) * Corrected variable names in RGBController_Lenovo_Gen7USB.cpp * Other style and formatting changes
This commit is contained in:
parent
fd3434b833
commit
a989166cdc
7 changed files with 49 additions and 35 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#include "LenovoUSBController_Gen7_8.h"
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include "LenovoUSBController_Gen7_8.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ class LenovoGen7And8USBController
|
|||
|ctor(s) and dtor|
|
||||
\*--------------*/
|
||||
LenovoGen7And8USBController(hid_device* dev_handle, const char* path, uint16_t in_pid);
|
||||
LenovoGen7And8USBController();
|
||||
~LenovoGen7And8USBController();
|
||||
|
||||
/*--------------*\
|
||||
|
|
|
|||
|
|
@ -10,11 +10,10 @@
|
|||
#include "Detector.h"
|
||||
#include "LogManager.h"
|
||||
#include "RGBController.h"
|
||||
#include "LenovoGen7And8USBController.h"
|
||||
#include "LenovoUSBController.h"
|
||||
|
||||
#include "LenovoDevices.h"
|
||||
#include "RGBController_LenovoUSB.h"
|
||||
#include "LenovoRGBController_Gen7_8.h"
|
||||
#include "RGBController_Lenovo_Gen7_8.h"
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
|
|||
|
|
@ -263,10 +263,10 @@ RGBController_Lenovo_Gen7USB::~RGBController_Lenovo_Gen7USB()
|
|||
void RGBController_Lenovo_Gen7USB::SetupZones()
|
||||
{
|
||||
vector<lenovo_zone> lenovo_zones;
|
||||
lenovo_zones.push_back(lenovo_legion_7gen7_kbd_ansi);
|
||||
lenovo_zones.push_back(legion7_gen7and8_kbd_ansi);
|
||||
lenovo_zones.push_back(lenovo_legion_7gen7_logo);
|
||||
lenovo_zones.push_back(lenovo_legion_7gen7_vents);
|
||||
lenovo_zones.push_back(lenovo_legion_7gen7_neon);
|
||||
lenovo_zones.push_back(legion7_gen7and8_neon);
|
||||
|
||||
for(unsigned int i = 0; i < lenovo_zones.size(); i++)
|
||||
{
|
||||
|
|
@ -322,12 +322,12 @@ void RGBController_Lenovo_Gen7USB::ResizeZone(int /*zone*/, int /*new_size*/)
|
|||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_Lenovo_Gen7USB::UpdateSingleLED(int led)
|
||||
void RGBController_Lenovo_Gen7USB::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_Lenovo_Gen7USB::UpdateZoneLEDs(int led)
|
||||
void RGBController_Lenovo_Gen7USB::UpdateZoneLEDs(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
|
@ -335,7 +335,8 @@ void RGBController_Lenovo_Gen7USB::UpdateZoneLEDs(int led)
|
|||
void RGBController_Lenovo_Gen7USB::DeviceUpdateMode()
|
||||
{
|
||||
uint8_t hw_profile_id = controller->getCurrentProfileId();
|
||||
if(hw_profile_id != profile_id) {
|
||||
if(hw_profile_id != profile_id)
|
||||
{
|
||||
profile_id = hw_profile_id;
|
||||
ReadDeviceSettings();
|
||||
last_mode = active_mode;
|
||||
|
|
@ -351,7 +352,8 @@ void RGBController_Lenovo_Gen7USB::DeviceUpdateMode()
|
|||
}
|
||||
}
|
||||
|
||||
if(last_mode != active_mode){
|
||||
if(last_mode != active_mode)
|
||||
{
|
||||
|
||||
if(modes[last_mode].value == LENOVO_LEGION_GEN7_MODE_DIRECT)
|
||||
{
|
||||
|
|
@ -392,7 +394,8 @@ void RGBController_Lenovo_Gen7USB::ReadDeviceSettings()
|
|||
vector<led_group> current_settings = controller->getProfileSettings(profile_id);
|
||||
if(current_settings.size() > 0)
|
||||
{
|
||||
for(int i = 0; i<modes.size(); i++){
|
||||
for(int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if(modes[i].value == current_settings[0].mode)
|
||||
{
|
||||
switch(current_settings[0].color_mode)
|
||||
|
|
@ -419,7 +422,10 @@ void RGBController_Lenovo_Gen7USB::ReadDeviceSettings()
|
|||
switch(modes[i].color_mode)
|
||||
{
|
||||
case MODE_COLORS_PER_LED:
|
||||
for(size_t j=0; j< colors.size(); j++) colors[j]=0x00;
|
||||
for(size_t j=0; j < colors.size(); j++)
|
||||
{
|
||||
colors[j]=0x00;
|
||||
}
|
||||
for(const led_group &lg : current_settings)
|
||||
{
|
||||
if(lg.colors.size() > 0)
|
||||
|
|
@ -500,7 +506,7 @@ std::vector<led_group> RGBController_Lenovo_Gen7USB::GetLedGroups()
|
|||
size_t end = leds.size();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Riplle and Type only apply to keyboard |
|
||||
| Ripple and Type only apply to keyboard |
|
||||
\*---------------------------------------------------------*/
|
||||
if(modes[active_mode].value == LENOVO_LEGION_GEN7_MODE_RIPPLE ||
|
||||
modes[active_mode].value == LENOVO_LEGION_GEN7_MODE_TYPE)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "LenovoRGBController_Gen7_8.h"
|
||||
#include "RGBController_Lenovo_Gen7_8.h"
|
||||
#include "LenovoDevices.h"
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -351,7 +351,8 @@ void LenovoRGBController_Gen7_8::UpdateZoneLEDs(int led)
|
|||
void LenovoRGBController_Gen7_8::DeviceUpdateMode()
|
||||
{
|
||||
uint8_t hw_profile_id = controller->getCurrentProfileId();
|
||||
if(hw_profile_id != profile_id) {
|
||||
if(hw_profile_id != profile_id)
|
||||
{
|
||||
profile_id = hw_profile_id;
|
||||
ReadDeviceSettings();
|
||||
last_mode = active_mode;
|
||||
|
|
@ -367,7 +368,8 @@ void LenovoRGBController_Gen7_8::DeviceUpdateMode()
|
|||
}
|
||||
}
|
||||
|
||||
if(last_mode != active_mode){
|
||||
if(last_mode != active_mode)
|
||||
{
|
||||
|
||||
if(modes[last_mode].value == LENOVO_LEGION_GEN7_8_MODE_DIRECT)
|
||||
{
|
||||
|
|
@ -408,7 +410,8 @@ void LenovoRGBController_Gen7_8::ReadDeviceSettings()
|
|||
vector<led_group> current_settings = controller->getProfileSettings(profile_id);
|
||||
if(current_settings.size() > 0)
|
||||
{
|
||||
for(int i = 0; i<modes.size(); i++){
|
||||
for(int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if(modes[i].value == current_settings[0].mode)
|
||||
{
|
||||
switch(current_settings[0].color_mode)
|
||||
|
|
@ -435,7 +438,10 @@ void LenovoRGBController_Gen7_8::ReadDeviceSettings()
|
|||
switch(modes[i].color_mode)
|
||||
{
|
||||
case MODE_COLORS_PER_LED:
|
||||
for(size_t j=0; j< colors.size(); j++) colors[j]=0x00;
|
||||
for(size_t j=0; j < colors.size(); j++)
|
||||
{
|
||||
colors[j]=0x00;
|
||||
}
|
||||
for(const led_group &lg : current_settings)
|
||||
{
|
||||
if(lg.colors.size() > 0)
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "LenovoGen7And8USBController.h"
|
||||
#include "LenovoUSBController_Gen7_8.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
@ -589,8 +589,10 @@ HEADERS +=
|
|||
Controllers/LenovoControllers/LenovoDevices4Zone.h \
|
||||
Controllers/LenovoControllers/LenovoGen7USBController.h \
|
||||
Controllers/LenovoControllers/LenovoUSBController.h \
|
||||
Controllers/LenovoControllers/LenovoUSBController_Gen7_8.h \
|
||||
Controllers/LenovoControllers/RGBController_Lenovo4ZoneUSB.h \
|
||||
Controllers/LenovoControllers/RGBController_LenovoUSB.h \
|
||||
Controllers/LenovoControllers/RGBController_Lenovo_Gen7_8.h \
|
||||
Controllers/LenovoControllers/RGBController_Lenovo_Gen7USB.h \
|
||||
Controllers/LenovoMotherboardController/LenovoMotherboardController.h \
|
||||
Controllers/LenovoMotherboardController/RGBController_LenovoMotherboard.h \
|
||||
|
|
@ -1277,10 +1279,12 @@ SOURCES +=
|
|||
Controllers/LenovoControllers/Lenovo4ZoneUSBDetect.cpp \
|
||||
Controllers/LenovoControllers/LenovoGen7USBController.cpp \
|
||||
Controllers/LenovoControllers/LenovoUSBController.cpp \
|
||||
Controllers/LenovoControllers/LenovoUSBController_Gen7_8.cpp \
|
||||
Controllers/LenovoControllers/LenovoUSBDetect.cpp \
|
||||
Controllers/LenovoControllers/RGBController_Lenovo4ZoneUSB.cpp \
|
||||
Controllers/LenovoControllers/RGBController_LenovoUSB.cpp \
|
||||
Controllers/LenovoControllers/RGBController_Lenovo_Gen7USB.cpp \
|
||||
Controllers/LenovoControllers/RGBController_Lenovo_Gen7_8.cpp \
|
||||
Controllers/LenovoMotherboardController/LenovoMotherboardController.cpp \
|
||||
Controllers/LenovoMotherboardController/LenovoMotherboardControllerDetect.cpp \
|
||||
Controllers/LenovoMotherboardController/RGBController_LenovoMotherboard.cpp \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue