only: pulling most useful fields up

This commit is contained in:
rusefillc 2023-12-19 13:50:27 -05:00
parent 943a5c0d98
commit f11e52a402
4 changed files with 8 additions and 10 deletions

View File

@ -880,7 +880,7 @@ end
function onTick()
local targetVoltage = getAuxAnalog(0)
-- local target = interpolate(1, 0, 3.5, 100, targetVoltage)
local target = interpolate(1, 0, 3.5, 100, voltageFromCan)
-- clamp 0 to 100

View File

@ -29,6 +29,11 @@ struct GpioChip {
virtual int readPad(size_t /*pin*/) { return -1; }
virtual brain_pin_diag_e getDiag(size_t /*pin*/) { return PIN_OK; }
virtual int deinit() { return 0; }
/* chip needs reinitialization due to some critical issue */
bool need_init;
int init_cnt;
};
int gpiochips_getPinOffset(brain_pin_e pin);

View File

@ -158,14 +158,11 @@ struct L9779 : public GpioChip {
/* last requested subaddr in case of read */
uint8_t last_subaddr;
/* chip needs reintialization due to some critical issue */
bool need_init;
/* statistic */
//int por_cnt;
//int wdr_cnt;
//int comfe_cnt;
int init_cnt;
//int init_req_cnt;
int spi_cnt;
int spi_err_parity; /* parity errors in rx data */
@ -548,7 +545,7 @@ static THD_FUNCTION(l9779_driver_thread, p) {
chip->diag_ts = chTimeAddX(chVTGetSystemTimeX(), TIME_MS2I(DIAG_PERIOD_MS));
}
poll_interval = chip->calc_sleep_interval();
poll_interval = chip->calc_sleep_interval();
#endif
/* default poll_interval */
}

View File

@ -248,9 +248,6 @@ struct Tle8888 : public GpioChip {
systime_t wwd_ts;
systime_t fwd_ts;
/* chip needs reintialization due to some critical issue */
bool need_init;
/* main relay output */
bool mr_manual;
@ -258,7 +255,6 @@ struct Tle8888 : public GpioChip {
int por_cnt;
int wdr_cnt;
int comfe_cnt;
int init_cnt;
int init_req_cnt;
int spi_cnt;
uint16_t recentTx;
@ -660,7 +656,7 @@ int Tle8888::chip_init()
* not to affect analog inputs.
* Disable open load detection and set short to bat
* thresholt to 125 mV (default) for OUTPUT8..13 */
CMD_OUTCONFIG(2, (0x0 << 6) | 0x00),
CMD_OUTCONFIG(2, (0x0 << 6) | 0x00),
#else
/* Enable open load detection and set short to bat
* thresholt to 125 mV (default) for OUTPUT8..13 */