Shift m before compare to 0
This commit is contained in:
parent
9f69fbe5ee
commit
48d1bd29cb
1 changed files with 1 additions and 2 deletions
|
@ -1191,9 +1191,8 @@ void Temperature::manage_heater() {
|
|||
#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \
|
||||
uint8_t l = 0, r = LEN, m; \
|
||||
for (;;) { \
|
||||
m = l + r; \
|
||||
m = (l + r) >> 1; \
|
||||
if (!m) return short(pgm_read_word(&TBL[0][1])); \
|
||||
m >>= 1; \
|
||||
if (m == l || m == r) return short(pgm_read_word(&TBL[LEN-1][1])); \
|
||||
short v00 = pgm_read_word(&TBL[m-1][0]), \
|
||||
v10 = pgm_read_word(&TBL[m-0][0]); \
|
||||
|
|
Reference in a new issue