tle8888 refactoring already - extracting method

This commit is contained in:
rusefi 2020-02-12 17:19:58 -05:00
parent 4ce7e42fc4
commit c78ea7da6c
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,8 @@
// we can change this value on TLE8888QK but we probably do not have a reason to change
#define Window_watchdog_close_window_time_ms 100.8
#define getRegisterFromResponse(x) (x >> 1) & 0x7f
// unchangeable value for TLE8888QK
// unused for now
//#define Window_watchdog_open_window_time_ms 12.8

View File

@ -66,7 +66,7 @@ void tle8888_dump_regs(void)
for (int request = 0; request < 0x7e + 1; request++) {
uint16_t tmp;
tle8888_read_reg(request, &tmp);
uint8_t response = (tmp >> 1) & 0x7f;
uint8_t response = getRegisterFromResponse(tmp);
uint8_t data = (tmp >> 8) & 0xff;
scheduleMsg(&logger, "%02x: %02x", response, data);