Check the I2CRepeater state before changing it. (#2197)

Resolves #1923 - 'USB Error 9' preventing configuration of rtl-sdr devices
This commit is contained in:
Sir Christoff Von-Dryden Of The Bailey LLC
2025-03-19 23:17:31 -07:00
committed by GitHub
parent 96f0b7dd55
commit 4afb74a847

View File

@@ -579,7 +579,12 @@ public class RTL2832TunerController extends USBTunerController
{
short address = 1;
int value = (enabled ? 0x18 : 0x10);
writeDemodRegister(Page.ONE, address, value, 1);
boolean isEnabledAlready = isI2CRepeaterEnabled();
if (isEnabledAlready != enabled) {
// mLog.info("trying to " + (enabled ? "enable" : "disable") + " i2c repeater, which is currently " + (isEnabledAlready ? "enabled" : "disabled"));
writeDemodRegister(Page.ONE, address, value, 1);
}
}
/**