Browse Source

Shift m before compare to 0

pull/1/head
Scott Lahteine 6 years ago
parent
commit
48d1bd29cb
  1. 3
      Marlin/src/module/temperature.cpp

3
Marlin/src/module/temperature.cpp

@ -1191,9 +1191,8 @@ void Temperature::manage_heater() {
#define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \ #define SCAN_THERMISTOR_TABLE(TBL,LEN) do{ \
uint8_t l = 0, r = LEN, m; \ uint8_t l = 0, r = LEN, m; \
for (;;) { \ for (;;) { \
m = l + r; \ m = (l + r) >> 1; \
if (!m) return short(pgm_read_word(&TBL[0][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])); \ if (m == l || m == r) return short(pgm_read_word(&TBL[LEN-1][1])); \
short v00 = pgm_read_word(&TBL[m-1][0]), \ short v00 = pgm_read_word(&TBL[m-1][0]), \
v10 = pgm_read_word(&TBL[m-0][0]); \ v10 = pgm_read_word(&TBL[m-0][0]); \

Loading…
Cancel
Save