Saving bytes for same result

This commit is contained in:
Theo Arends 2021-08-23 17:37:12 +02:00
parent 8e9960be80
commit 7d1bcda887
1 changed files with 4 additions and 2 deletions

View File

@ -148,8 +148,10 @@ void Ade7953GetData(void)
} else if (10 == i) {
acc_mode = value; // Accumulation mode
if (0 == Ade7953.model) { // Shelly 2.5 - Swap channel B values due to hardware connection
if (acc_mode & APSIGN[0]) { acc_mode &= ~APSIGN[0]; } else { acc_mode |= APSIGN[0]; }
if (acc_mode & VARSIGN[0]) { acc_mode &= ~VARSIGN[0]; } else { acc_mode |= VARSIGN[0]; }
// if (acc_mode & APSIGN[0]) { acc_mode &= ~APSIGN[0]; } else { acc_mode |= APSIGN[0]; }
// if (acc_mode & VARSIGN[0]) { acc_mode &= ~VARSIGN[0]; } else { acc_mode |= VARSIGN[0]; }
acc_mode ^= (APSIGN[0] | VARSIGN[0]);
// acc_mode ^= 0xA00;
}
} else {
reg[i >> 2][i &3] = value;