Commit Graph

1478 Commits

Author SHA1 Message Date
Matthew Kennedy ce2e7d3cbe fix mock pins array (#2050)
* fix

* fix probably
2020-12-10 00:10:58 -05:00
rusefillc 2f15c08498 basic hw in the loop - pwm self validation #2028 2020-12-08 04:52:49 -05:00
rusefillc 3a3586f730 basic hw in the loop - pwm self validation #2028 2020-12-07 20:42:47 -05:00
rusefillc 89cebd7d72 basic hw in the loop - pwm self validation #2028 2020-12-07 20:26:47 -05:00
rusefillc ee9aaf4e0d basic hw in the loop - pwm self validation #2028 2020-12-07 20:01:05 -05:00
rusefillc 93e69bea93 refactoring 2020-12-06 19:04:23 -05:00
Andrey G 4980fc49d9 Fixes after clenup (#2019)
* We still need consoleEventListener for boards with EFI_CONSOLE_SERIAL_DEVICE

* MC33810: add MC_ prefix for command defines

As CMD_PWM define is now used by console command
2020-12-05 11:54:09 -05:00
Andrey G f31731d380 ADC: correctly calculate cache invalidate range for STM32F7xxx (#2021)
Bug was introduced in 5d421f7ffa when
sample buffer was moved out of class. So sample become adcsample_t*
instead of adcsample_t[] and sizeof returns 4.
2020-12-05 10:14:33 -05:00
Andrey G 040e07ec48 adc: fix CPU temperature read for STM32F76x/77x (#2020) 2020-12-05 09:58:23 -05:00
Matthew Kennedy b34759f3c9 fix warnings (#2003)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-03 07:27:27 -05:00
Matthew Kennedy c442f1f785 fix gpio the right way (#1990)
* fix the right way

* use the api

* explain

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-11-27 00:24:41 -05:00
rusefillc 5390fccada Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:55:39 -05:00
rusefillc 7b8d20108f Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:41:22 -05:00
rusefillc fa3410ec07 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 00:24:15 -05:00
rusefi ab98e15f01 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 00:16:59 -05:00
rusefillc 3cbb33c763 avoid float -> int64 conversion #1977
cherry picking...
2020-11-24 20:33:51 -05:00
Matthew Kennedy ebb8ede1da squash warnings (#1984)
* warnings

* unused

* a few more

* too much

* uint16_t-ify
2020-11-23 09:43:16 -05:00
Matthew Kennedy eb7a26be14 Port-ify microsecond_timer hardware implementation (#1964)
* move to folder

* extract hardware part of microsecond_timer

* dead ST forum link

* de-volatile

* simulator build

* guard
2020-11-22 20:39:32 -05:00
rusefi 954d214919 adc fixed #1979
partial revert
2020-11-22 15:31:33 -05:00
rusefillc b1510791c5 ADC: fixes: #1979
better error handling?
2020-11-22 13:42:24 -05:00
rusefi ba97b22236 ADC: fixes: #1979
more detailed error message
2020-11-22 12:57:04 -05:00
Andrey G 005a5daa74 ADC: fixes: (#1979)
* ADC: fixes:

-use enums
-internalAdcIndexByHardwareIndex array should be adc_channel_e size
-add sanity checks
-save few bytes of RAM

* ADC: use logical OR instead of math add
2020-11-22 12:23:27 -05:00
Andrey G 83f5c8e6b6 Typo fix (#1978) 2020-11-22 08:27:03 -05:00
rusefillc 12187b4254 Starter is engaged on start-up in pull-up configuration #1969
maintainability
2020-11-20 00:18:38 -05:00
shadowm60 e69d103461 Launch control unit tests update (#1972)
* testable launch start

* extract base class

* add a test

* fix ts debug

* Launch control unit_tests

updated launch control for a better split
VSS mock for unit tests

Co-authored-by: Matthew Kennedy <matthewkennedy@outlook.com>
2020-11-19 21:14:38 -05:00
Matthew Kennedy 2792828dce Remove lockAnyContext, replace with CriticalSectionLocker (#1938)
* switch to CriticalSectionLocker

* that's just about all

* clean up last usage

* include hpp for sim

* need the cpp wrappers in the makefile too

* include dir

* include
2020-11-19 06:56:02 -05:00
rusefillc dbdfd87c6d Starter seems to be engaged forever fix #1965 2020-11-18 23:54:30 -05:00
rusefillc 3a38c837cc Starter seems to be engaged forever #1965 2020-11-18 22:45:37 -05:00
rusefillc 9f94205b2b Starter seems to be engaged forever #1965 2020-11-18 21:45:17 -05:00
Matthew Kennedy 776dd75a8a consolidate to common (#1962) 2020-11-18 16:22:19 -05:00
Matthew Kennedy 786aaf2e3c put getTimeNowLowerNt in to mpu_util (#1950)
* put getTimeNowLowerNt in to mpu_util

* move GPTDEVICE to port_mpu_util

* and remove from efifeatures
2020-11-18 14:17:00 -05:00
rusefi 5a249e1b8f better MC33816 start-up status 2020-11-18 01:07:09 -05:00
Andrey G 39bc608ce5 TLE8888: disable diagnostic for OUTPUT8..13 (#1956)
Enabled pull-down affects analog inputs that shares same pins.
Disable it.
DOTO: enable diagnostic if ouput requested through tle8888_setPadMode
2020-11-17 18:33:37 -05:00
rusefillc ecbdfe379e docs 2020-11-17 08:25:50 -05:00
Matthew Kennedy 319384143e read SD card config exactly once (#1955)
* only read mmc device once

* format

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-11-17 07:48:43 -05:00
Matthew Kennedy e0d0727896 adjust microsecond_timer api (#1952)
* change timer api

* don't need all that
2020-11-16 18:50:13 -05:00
Matthew Kennedy d9f625c8ba prevent MMC preemption by TS thread (#1949)
* prevent preemption by TS thread

* didn't need that
2020-11-15 20:44:36 -05:00
Matthew Kennedy 6b0c533d2c consolidate EFI_UNIT_TEST and friends (#1940)
* restructure

* guard c++

* idle too

* status_loop.h

* consolidate definitions

* use 1/0 instead, check for existence

* missed a few

* dead define

* defs for bootloader
2020-11-11 20:34:39 -05:00
Andrey G 2f891cc23a Tle8888 stepper (#1936)
* TLE8888: enable PP mode for OUT21..24 in case of useTLE8888_stepper

* Lada Kalina is a test mule for stepper idle
2020-11-10 14:16:46 -05:00
rusefi 9f237d963b debounce unintended auto-increment bug (was: Proteus TCU gear shift configuration) #1927
refactoring
2020-11-07 00:46:59 -05:00
rusefi 55065781f8 debounce unintended auto-increment bug (was: Proteus TCU gear shift configuration) #1927
undoing brain fart
2020-11-07 00:43:42 -05:00
rusefillc 89a20a20b0 Proteus TCU gear shift configuration #1927 2020-11-06 23:48:35 -05:00
Matthew Kennedy e8bb0cfd00 extract idle hardware to its own file (#1923)
* extract idle hardware

* should fix the build
2020-11-03 18:06:32 -05:00
rusefi 4dc5c61f60 Output pin init/deinit needs a linked list #1803
trying to make things more consistent & smarter
2020-11-03 00:46:03 -05:00
rusefi 8dcb2fe55f this stuff is just too dead 2020-11-02 23:46:41 -05:00
Andrey G e14fa4b189 Tle8888 small update (#1908)
* TLE8888: add support MR switching from SW

Main Relay has limitation - it is always active while KEY=1. When
KEY=0 MR can be switched on from SW.

* TLE8888: support reading of KEY and WAKE inputs

* Rusefi enums: add new TLE8888 pins
2020-11-01 22:19:55 -05:00
Matthew Kennedy 4c3046a707 remove spiMtx (#1907) 2020-10-25 17:26:46 -04:00
Matthew Kennedy 5fc47d0153 oops (#1899) 2020-10-23 15:45:44 -04:00
Andrey G 88e830d635 Tle8888 big update 1 (#1892)
* smart gpio: fix tle8888 direct pin mapping for MRE

* MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888

* TLE8888: cleanup

* TLE8888: do not reset driver private data on WD/undervoltage reset

* TLE8888: diagnostic updates

* TLE8888 driver: BIG driver rework

* TLE8888: check SPI answers for abnormal states

Reply with other than requested register can be a sign of:
-Power-On-Reset, then OpStat0 will be replyed
-WatchDog reset, then FWDStat1 will be replyed
-Invalid communication frame, then Diag0 will be replyed

Keep tracking last accessed register and check with the next reply.

* TLE8888: debug clean-up

* TLE8888: implement spi array write

This reduce CS inactive state time between two consequent accesses
from 8.8 uS to 1.4 uS

* TLE8888: fix PP outputs in OD mode

* TLE8888: cleanup register definitions

* TLE8888: run separate driver thread for each chip instance

Calculating poll interval for few chips become more complex, avoid
this running thread for each device.

* TLE8888: fix cypress and kinetic compilation

Both platforms define its own MAX and cause redifination error if
common.h is included in driver.

* MRE: update mapping.yaml and fix direct pin mapping for TLE8888

* TLE8888: diagnnostic: disable switch off in case of overcurrent

For all output, use current limiting instead

* TLE8888: check for overvoltage on OUT8..OUT13

* TLE8888: add TODO note about how to recover from failure condition

Currently TLE8888 automaticly recovers only from overcurrent and
(may be) overtemperature conditions.
Short to bat cause output disable (bit in OECONFIG is reset) and
needs driver/host intervention.

* TLE8888: save few bytes of RAM

* TLE8888: Lada Kalina is test mule for IDLE stepper on TLE8888

Don't forget to enable PP mode for TLE8888 outputs 21..24:
uncomment line 1087 in tle8888.c

* TLE8888: reorder code, cleanup

* TLE8888: mode all debug/statisctic to per-chip struct

* TLE8888: rework poll interval calculation

* MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888 #2
2020-10-23 12:25:30 -04:00
Matthew Kennedy dbdeca93b0 implement fuel pressure sensors (#1897)
* add

* remove old

* remove more old

* makefile

* fix init

* patch up other stuff

* actually fix it this time

* raw output channels

* gauges, UI

* scaled channel

* fix field ordering
2020-10-23 07:31:47 -04:00