Tle8888 wd (#1143)

* tle8888: watchdog: debug over TS: remove tailing register address

* tle8888: ann console command to dump all regs
This commit is contained in:
dron0gus 2020-02-12 01:49:14 +03:00 committed by GitHub
parent 678c3525b8
commit 82e33e45af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View File

@ -207,9 +207,9 @@ static const char* tle8888_pin_names[TLE8888_OUTPUTS] = {
#if EFI_TUNER_STUDIO
void tle8888PostState(TsDebugChannels *debugChannels) {
debugChannels->debugIntField1 = WindowWatchdogErrorCounterValue;
debugChannels->debugIntField2 = FunctionalWatchdogPassCounterValue;
debugChannels->debugIntField3 = TotalErrorCounterValue;
debugChannels->debugIntField1 = (WindowWatchdogErrorCounterValue >> 8) & 0x3f;
debugChannels->debugIntField2 = (FunctionalWatchdogPassCounterValue >> 8) & 0x3f;
debugChannels->debugIntField3 = (TotalErrorCounterValue >> 8) & 0x3f;
//debugChannels->debugIntField1 = tle8888SpiCounter;
//debugChannels->debugIntField2 = spiTxb;
//debugChannels->debugIntField3 = spiRxb;
@ -685,6 +685,14 @@ err_gpios:
return ret;
}
/* DEBUG */
void tle8888_read_reg(uint16_t reg, uint16_t *val)
{
struct tle8888_priv *chip = &chips[0];
tle8888_spi_rw(chip, CMD_R(reg), val);
}
int tle8888_init(void * data)
{
int ret;

View File

@ -52,6 +52,24 @@ PinRepository::PinRepository() {
static PinRepository instance;
/* DEBUG */
extern "C" {
extern void tle8888_read_reg(uint16_t reg, uint16_t *val);
}
static void tle8888_dump_regs(void)
{
int i;
uint16_t tmp;
tle8888_read_reg(0, NULL);
for (i = 0; i < 0x7e + 1; i++) {
tle8888_read_reg(i, &tmp);
scheduleMsg(&logger, "%02x: %02x", tmp & 0x7f ,(tmp >> 8) & 0xff);
}
}
static void reportPins(void) {
for (unsigned int i = 0; i < getNumBrainPins(); i++) {
const char *pin_user = getBrainUsedPin(i);
@ -161,6 +179,7 @@ void initPinRepository(void) {
initialized = true;
addConsoleAction(CMD_PINS, reportPins);
addConsoleAction("tle8888", tle8888_dump_regs);
}
bool brain_pin_is_onchip(brain_pin_e brainPin)