Fix warning in OpenRGBSystemInfoPage.cpp

This commit is contained in:
Adam Honse
2026-06-29 14:04:39 -05:00
parent d130e64f69
commit d3f4bfe192
3 changed files with 0 additions and 35 deletions

View File

@@ -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() */

View File

@@ -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);

View File

@@ -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;