mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-07-08 04:14:50 -04:00
Fix warning in OpenRGBSystemInfoPage.cpp
This commit is contained in:
@@ -134,35 +134,3 @@ std::string i2c_dump(i2c_smbus_interface * bus, unsigned char address)
|
||||
return text;
|
||||
|
||||
} /* i2c_dump() */
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* i2c_read *
|
||||
* *
|
||||
* Prints <size> values read from register address regaddr of a given SMBus device *
|
||||
* *
|
||||
* bus - pointer to i2c_smbus_interface to scan *
|
||||
* address - SMBus device address to scan *
|
||||
* regaddr - register address to read from *
|
||||
* size - number of bytes to read *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
std::string i2c_read(i2c_smbus_interface * bus, unsigned char address, unsigned char regaddr, unsigned char size)
|
||||
{
|
||||
int i;
|
||||
|
||||
bus->i2c_smbus_write_byte(address, regaddr);
|
||||
|
||||
char line[128];
|
||||
std::string text;
|
||||
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
snprintf(line, 128, "%02x ", (unsigned char)bus->i2c_smbus_read_byte(address));
|
||||
text.append(line);
|
||||
}
|
||||
|
||||
return text;
|
||||
|
||||
} /* i2c_read() */
|
||||
|
||||
@@ -20,5 +20,3 @@
|
||||
std::string i2c_detect(i2c_smbus_interface * bus, int mode);
|
||||
|
||||
std::string i2c_dump(i2c_smbus_interface * bus, unsigned char address);
|
||||
|
||||
std::string i2c_read(i2c_smbus_interface * bus, unsigned char address, unsigned char regaddr, unsigned char size);
|
||||
|
||||
@@ -153,7 +153,6 @@ void OpenRGBSystemInfoPage::on_CommandButton_clicked()
|
||||
i2c_smbus_interface* bus = busses[current_index];
|
||||
unsigned char address = ui->CommandAddressBox->value();
|
||||
unsigned char regaddr = ui->CommandRegisterBox->value();
|
||||
unsigned char size = ui->CommandSizeBox->value();
|
||||
unsigned short write_data = ui->CommandWriteDataLineEdit->text().toInt(nullptr, 0);
|
||||
unsigned short read_data = 0xFFFF;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user