calling setPower instead of setDac as the conversion should happen here

This commit is contained in:
2026-01-28 15:20:34 +01:00
parent 9a876075ab
commit 9e7952048a
2 changed files with 5 additions and 2 deletions

View File

@@ -420,7 +420,8 @@ void setupDetector() {
if (idac == D_PWR_EMPTY)
continue;
int min = (idac == D_PWR_IO) ? VIO_MIN_MV : POWER_RGLTR_MIN;
setDAC(idac, min, 0);
// will not enable power at startup (dacValues = -1)
setPower(idac, min);
}
resetFlow();
@@ -1327,6 +1328,8 @@ void setPower(enum DACINDEX ind, int val) {
LOG(logDEBUG1, ("Switching off power enable\n"));
bus_w(addr, bus_r(addr) & ~(mask));
int startup = dacValues[ind] == -1 ? 1 : 0;
// convert voltage to dac (power off is anyway done with power enable)
if (val > 0) {
@@ -1347,7 +1350,7 @@ void setPower(enum DACINDEX ind, int val) {
setDAC(ind, dacval, 0);
// if valid, enable power
if (dacval >= 0) {
if (dacval >= 0 && startup == 0) {
LOG(logDEBUG1, ("Switching on power enable\n"));
bus_w(addr, bus_r(addr) | mask);
}