tle8888 refactoring already - extracting method
This commit is contained in:
parent
4ce7e42fc4
commit
c78ea7da6c
|
@ -25,6 +25,8 @@
|
||||||
// we can change this value on TLE8888QK but we probably do not have a reason to change
|
// 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 Window_watchdog_close_window_time_ms 100.8
|
||||||
|
|
||||||
|
#define getRegisterFromResponse(x) (x >> 1) & 0x7f
|
||||||
|
|
||||||
// unchangeable value for TLE8888QK
|
// unchangeable value for TLE8888QK
|
||||||
// unused for now
|
// unused for now
|
||||||
//#define Window_watchdog_open_window_time_ms 12.8
|
//#define Window_watchdog_open_window_time_ms 12.8
|
||||||
|
|
|
@ -66,7 +66,7 @@ void tle8888_dump_regs(void)
|
||||||
for (int request = 0; request < 0x7e + 1; request++) {
|
for (int request = 0; request < 0x7e + 1; request++) {
|
||||||
uint16_t tmp;
|
uint16_t tmp;
|
||||||
tle8888_read_reg(request, &tmp);
|
tle8888_read_reg(request, &tmp);
|
||||||
uint8_t response = (tmp >> 1) & 0x7f;
|
uint8_t response = getRegisterFromResponse(tmp);
|
||||||
uint8_t data = (tmp >> 8) & 0xff;
|
uint8_t data = (tmp >> 8) & 0xff;
|
||||||
|
|
||||||
scheduleMsg(&logger, "%02x: %02x", response, data);
|
scheduleMsg(&logger, "%02x: %02x", response, data);
|
||||||
|
|
Loading…
Reference in New Issue