Commit Graph

1668 Commits

Author SHA1 Message Date
rusefillc 384113a984 would this give me h72 SD? 2021-02-18 16:16:45 -05:00
Matthew Kennedy 90ef4c93ad
merge mcuconf for f4/f7 (#2375)
* merge for f4/f7

* more

* include efifeatures

* s

* no TS serial on f7 for now

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-18 15:04:32 -05:00
Matthew Kennedy fa894d55a3
set MCU properly (#2371) 2021-02-17 15:25:57 -05:00
Matthew Kennedy d933d18e29
use spiPolledExchange for small transfers (#2358)
* configure for no cache

* this doesn't need a setting

* now we don't need invalidate

* reorder and comment

* mmc

* sw knock

* use spiPolledExchange for small transfers

* mock spi

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-17 14:48:21 -05:00
rusefillc 8584256677 trying to fix AuxValves 2021-02-17 08:57:18 -05:00
rusefillc 02a49de390 aux to vvt rename 2021-02-17 08:53:39 -05:00
Matthew Kennedy 39884f8934
use DECLARE_ENGINE_PTR for Engine class (#2365)
* engine cleanup

* do the cleanup

* one last spot

* expand_engine noop for firmware

* simulator
2021-02-16 16:58:54 -05:00
Matthew Kennedy 4a1d3de9a6
remove unused msg parameter (#2360)
* dead parameter

* last few
2021-02-16 09:32:16 -05:00
Matthew Kennedy 878794f9cf
properly put buffers in no-cache regions (#2357)
* configure for no cache

* this doesn't need a setting

* now we don't need invalidate

* reorder and comment

* mmc

* sw knock
2021-02-15 17:39:11 -05:00
Matthew Kennedy 187c4d00f7
USB mass storage tweaking (#2352)
* disable TS in case of USB MSD

* housekeeping while we're here

* enable on MRE

* changelog
2021-02-14 15:03:07 -05:00
Andrey G bb5ee69f29
RusEFI is green: put cpu in standby in idle (#2342)
* MRE is green: put cpu in standby in idle

* Revert "MRE is green: put cpu in standby in idle"

This reverts commit 62b5cadda014ace749b145b629da62b182b5e3ce.

* RusEFI is green on all boards
2021-02-14 10:24:21 -05:00
Matthew Kennedy 89391919dc
automatic switch between internal and MSD SD card (#2349)
* auto enable usb msd

* guard and turn on for proteus
2021-02-14 08:10:39 -05:00
Matthew Kennedy 56b7db8e9c
pullup (#2348) 2021-02-14 08:04:09 -05:00
Matthew Kennedy 6ab7e151f1
rewrite SD initialization (#2346)
* rewrite SD init

* static

* return a pointer instead
2021-02-13 21:26:11 -05:00
Andrey G f1785fee11
Config cleanups (#2347)
* Remove duplication

* Ports: STM32F7: we want PAL_USE_CALLBACKS for F7 too
2021-02-13 18:45:33 -05:00
Matthew Kennedy 7562de4f10
usb mass storage progress (#2345)
* usb mass storage

* remove old files

* this file is gone
2021-02-13 15:06:05 -05:00
rusefi 67f5b18f34 not great solution to code duplication, also helping QC build 2021-02-13 11:19:39 -05:00
Matthew Kennedy 9a3f3f34b2
USB mass storage descriptor (#2330)
* enable msd

* modify descriptors for composite device

* makefile cleanup

* format

* define

* embiggen fifos

* needed that

* cleanup too while we're at it

* rename endpoints

* switchable descriptors

* guard the request hook too

* don't need this changed yet

* cleanup

* update ep0 response

* cleanup

* use the msd hook from chibios

* this was wrong

* this was covered by other PR

* this is also covered

* s
2021-02-13 08:54:08 -05:00
Matthew Kennedy 990bfe763e
implement null block device (#2341)
* implement null device

* fix build
2021-02-13 08:53:10 -05:00
Matthew Kennedy d8032fbd8f
fix usb descriptor mistakes (#2340)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-13 01:06:55 -05:00
Matthew Kennedy 315360cb04
Rename USB endpoints, update ChibiOS-Contrib (#2334)
* rename endpoints

* update chibios contrib

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-12 14:21:56 -05:00
Matthew Kennedy 275b058e32
increase SD card speed (#2333)
* fast sd card

* fair enough
2021-02-11 20:42:23 -05:00
Matthew Kennedy fff734502d
turn in to a composite device (#2332) 2021-02-11 15:52:06 -05:00
Matthew Kennedy dade25ef34
move chconf/mcuconf/halconf in to hw_ports (#2321)
* move f4 config files

* don't need this

* f7

* f7

* h7

* this was duplicated

* turn off smart build

* loader too

* update prometheus paths

* bootloader should include confdir

* fix the flash size while we're at it

* move chconf_common

* use wait

* normalize board.mk

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-10 19:38:24 -05:00
rusefi 6f065274e4 aux pid is now VVT 2021-02-10 12:41:38 -05:00
Matthew Kennedy 85fab40d21
get mcu temperature within port (#2326)
* remove EFI_ADC_TEMP_SENSOR

* implement

* comment

* s

* switch adc_inputs over

* header

* s

* I think aligned-on-stack should work ok

* num channels

* cache safety

* move adc init too

* don't compile that file for the h7

* cypress & kinetis

* ports

* guard against bootloader

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-09 22:04:36 -05:00
rusefillc cbfed1a357
Create readme.md 2021-02-09 13:43:26 -05:00
Matthew Kennedy 2c465247e9
stm32h7 usb (#2319)
* enable

* enable

* serial number

* usb defines

* buffer size

* more stuff we can enable
2021-02-08 16:24:49 -06:00
Matthew Kennedy 435f8f7e2b
h7 flash, guard against no CAN (#2317)
* h7 flash

* guard some other stuff

* I guess it just builds now?

* maybe ci too
2021-02-08 16:24:38 -05:00
Matthew Kennedy 36483e870a
consolidate stm32 mpu util (#2314)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 15:52:00 -05:00
Matthew Kennedy 3debd2229b
move board.h for f7/h7 (#2316)
* f7 board.h

* h7
2021-02-08 15:46:48 -05:00
Matthew Kennedy ad07166e9d
move f4 board.h (#2313)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 15:29:07 -05:00
Matthew Kennedy b995e7bcaa
include board.c from hw_ports.mk (#2311)
* set mcu type in hw_ports

* move f4 linker script

* move f7 linker script

* don't set default linker file in makefiles

* extra line

* prometheus actually didn't depend on anything special for f469

* dead line

* h7

* dead

* move board.c

* set explicit cpu type for simulator

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 07:52:31 -06:00
Matthew Kennedy 423acd384b
simplify MCU selection (#2308)
* set mcu type in hw_ports

* move f4 linker script

* move f7 linker script

* don't set default linker file in makefiles

* extra line

* prometheus actually didn't depend on anything special for f469

* dead line

* h7

* dead
2021-02-08 02:11:44 -05:00
Matthew Kennedy 50a860a380
implement lps25 (#2301)
* bb

* implement

* tweaks

* s

* comment, format

* guard

* implement lps25

* headers and comment

* sensor works

* headers

* guard

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-06 23:59:44 -06:00
Matthew Kennedy f518b72260
implement bit-banged I2C driver (#2289)
* bb

* implement

* tweaks

* s

* comment, format

* guard

* headers and comment
2021-02-06 16:59:06 -06:00
Andrey G 3166076839
Some fixes prior to board pull request (#2291)
* ChibiOS: add support for STM32F765

This chip is used on Subaru EG33 p'n'p RusEFI board from Dron_Gus

* drivers: gpio: mc33810: commulative update

- use BIT macro
- fix wake-up method
- fix order of arguments in _add function

* port: stm32f4/7: detectCanDevice check for enabled interfaces only

* ADC: fix internal array size

internalAdcIndexByHardwareIndex should be EFI_ADC_LAST_CHANNEL size
couse adc_channel_e is used as index

* status LEDs: support status LEDs that driven by low level
2021-02-06 12:22:57 -05:00
rusefillc 30358e0526 reducing code duplication 2021-02-06 00:46:40 -05:00
rusefillc cda053f388 H7 compilation #2284 2021-02-06 00:37:12 -05:00
rusefillc 4dbb77415a reducing code duplication 2021-02-06 00:25:13 -05:00
rusefillc a093a839be reducing code duplication 2021-02-06 00:18:47 -05:00
rusefillc 7c231d968f H7 compilation #2284 2021-02-05 23:57:28 -05:00
rusefillc e4a85acb3b H7 compilation #2284 2021-02-05 23:37:18 -05:00
rusefillc aafb5ca28d let's build for h7 2021-02-05 22:29:23 -05:00
rusefillc 908dbd640c let's build for h7 2021-02-05 22:10:59 -05:00
rusefillc ac6c8a6c9f let's build for h7 2021-02-05 21:37:33 -05:00
rusefillc 9d77a35b5a let's build for h7 2021-02-05 21:09:36 -05:00
Matthew Kennedy 9151b0c6c1
fix #2269 (#2272)
* fix #2269

* cleanup
2021-02-03 08:04:22 -06:00
rusefillc 869e4cfc49 vvt/cam events to pass index 2021-01-31 22:24:45 -05:00
rusefillc d116101e1a trigger: exti: callback parameter is now index 2021-01-31 22:10:10 -05:00
rusefillc a411e0d1af code style 2021-01-31 22:02:01 -05:00
rusefillc 73085b3914 code style 2021-01-31 21:45:01 -05:00
Matthew Kennedy 198bdec496
USB reports real STM32 Serial Number (#2254)
* mpu util data

* implementation
2021-01-30 14:51:11 -05:00
rusefillc 5d1c248e4d No hablo inglés 2021-01-28 20:43:23 -05:00
rusefillc e1febfb9e1 fixing port I 2021-01-25 00:29:48 -05:00
rusefillc c069f1c959 fixing port I 2021-01-22 23:31:21 -05:00
rusefillc aaa9f2a608 Hellen needs text representation of GPIOI
H7 dreams are asking for J and K
2021-01-22 01:25:05 -05:00
Andrey G 777979c3ca
Chibi os 20 (#2212)
* Update ChibiOS

* Fix Makefiles includes paths

* halconf.h: remove flash hack

* mcuconf: fix EXTI ptiorityes

* Digital Input: ICU: use designated initializers, initialize 'arr'

* ChibiOS: lis302dl fix

* ADC: update to new API

* UARTConfig: timeout_cb field, formating

* ChibiOS: remove _exit, _kill, _getpid

* Fix lis302dl

* Bump config versions

* chconfig_common: cosmetic changes

* stm32f4ems: commulative config update

* Update Simulator

* ALLCSRC already contain all needed ChibiOS files.

Same for ALLINC and ALLCPPSRC

* ChibiOS fix for Simulator

* ChibiOS: port lock/unlock hook and MMC over SPI timeout

* STM32F7: update configs

* STM32F7: update linker file

* Cypress: port ADC lld to ChibiOS-20

* Cypress: port SPI lld to ChibiOS-20

* Cypress: port CAN lld to ChibiOS-20

* Cypress: fix include path for rules.ld

* Cypress: update chconf.h and halconf.h for ChibiOS-20

* Kinetis: update ADC lld to ChibiOS-20

* Kinetis: update SPI lld to ChibiOS-20

* Kinetis: update UART lld driver for ChibiOS-20

* Kinetis: update chconf.h and halconf.h for ChibiOS-20

* Kinetis: fix include path for rules.ld

* Nucleo F746: update ld script

* Nucleo F746: fix compile

* Bootloader: fix compilation with ChibiOS-20, cleanup

* Bootloader: add way to pass crosscompiler using CROSS_COMPILE

* Debug build arguments

* Simulator: fix windows compilation

Exclude syscalls_cpp.cpp from compilation
2021-01-19 15:20:35 -05:00
rusefi 0dc0ae19be OMG we are not using java yet?! 2021-01-18 19:00:53 -05:00
rusefi bb1ae49534 https://refactoring.com/catalog/replaceMagicLiteral.html 2021-01-18 18:54:18 -05:00
Matthew Kennedy fa30efbc94
boost fixes (#2230)
* fix boost pin reinit

* call boost from periodic slow

* ui

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-18 07:04:14 -05:00
Andrey G baea67eccf
Simplify Makefile, unify board.mk files (#2229)
* Proper way to add lis302 driver

* Proper way to add license directory to includes

* Makefile: simplify

All ChibiOS stuff is accumulated in ALLCSRC, ALLINC and so on.

* board.mk: append sources and includes to ALLSRC, ALLCPPSRC, ALLINC

* Cypress: fix CANv2 includence into build
2021-01-17 09:32:06 -05:00
Andrey G 25560b85c2
Supress annoing unused warnings (#2216) 2021-01-11 08:49:20 -05:00
rusefillc 9dfa5e9670 cherry pick from https://github.com/dron0gus/rusefi/tree/ChibiOS-20 2021-01-09 19:15:50 -05:00
rusefillc 4f49c73a45 Lcd fix (I hope) #2211
there is still an issue :(
2021-01-09 17:30:39 -05:00
Andrey G 7803968621
Lcd fix (I hope) (#2211)
* LCD: check if settings are valid on each access

* Lada Kalina: remove duplicate code

All LCD pins are set to GPIO_UNASSIGNED in disableLCD()

* Remove duplicate code

* We still need to know when invalid gpio is used...

This reverts commit c17775231a.
2021-01-09 17:16:10 -05:00
rusefillc c17775231a dron0gus please help 2021-01-09 15:31:09 -05:00
Andrey G 2af32084f4
gpio helper (#2195)
* gpios: isBrainPinValid helper

* LCD HD44780: do not touch pins if DM_NONE or invalid gpio

* Fix isEnabled checks for GPS and Joystick

* LCD HD44780: writePad use this method wider
2021-01-08 20:01:26 -05:00
rusefillc ff765f5f5d knock v12 2021-01-06 19:42:07 -05:00
Andrey G f96ae7525f
Gpio cleanup #2 (#1530)
* pin repository: PIN_USED size in now equal to brain_pin_e enum size

expect special values...

* smart gpios: register gpio chip to given base (no auto-allocation)

* drivers: gpio: core: add gpiochip_unregister()

* drivers: gpio: MC33810 intergation

* smart_gpio.cpp: cleanup ifdef mess, minor cleanups

* gpio: core: additional check for gpio ranges overlaps

* unit test: gpio chip: fixed and extended
2021-01-06 18:29:47 -05:00
Andrey G 37cd9266d3
Call startSmartCsPins when applying new settings (#2194)
Only stopSmartCsPins was called from applyNewHardwareSettings.
This cause lost of CS pins for external gpio chips
2021-01-06 08:59:13 -05:00
Andrey G b92e3086d0
Adc isAdcChannelValid helper (#2188)
* Guard define argument

* ADC: isAdcChannelValid

Check for both <= EFI_ADC_NONE and >= EFI_ADC_LAST_CHANNEL
Also check for value out of enum range (corrupted settings)

* Fix unit tests
2021-01-05 16:02:20 -05:00
Matthew Kennedy 19bf208cde
use limp mgr for trigger disable (#2145)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-26 18:12:36 -05:00
Matthew Kennedy 0df5d0ae3d
actually use button name (#2126)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-24 07:30:56 -05:00
rusefi 6032d0a26f Proteus is compiled without VSS feature #2122 2020-12-22 21:28:51 -05:00
rusefi a254c79d93 trigger and start button pins not displayed by "pins" command #2084 2020-12-22 21:20:57 -05:00
rusefi 42c1fb7b5e trigger and start button pins not displayed by "pins" command #2084 2020-12-22 21:05:49 -05:00
rusefi f62bcca7ea trigger and start button pins not displayed by "pins" command #2084 2020-12-22 20:54:28 -05:00
rusefi c4650076cf trigger and start button pins not displayed by "pins" command #2084 2020-12-22 20:53:05 -05:00
rusefi d6b745e1c0 Proteus is compiled without VSS feature #2122 2020-12-22 20:50:01 -05:00
rusefi fd54e37358 trigger and start button pins not displayed by "pins" command fix #2084 2020-12-22 20:42:30 -05:00
Matthew Kennedy 690ab7e917
gpio unit tests (#2099)
* fix unregister api for gpio

* consumers

* guard with a critical section

* index

* guard less

* unregister under lock

* fix reinit

* dead flag

* fix most tests

* initialize properly

* initialize properly

* assertions in tests

* fix message

* move gpio mocking

* test gpios

* we must lock earlier to be truly safe

* this was using huge memory

* devirtualize

* test deinit
2020-12-18 17:19:02 -05:00
Matthew Kennedy 6168bcea80
Fix gpio reinit race condition (#2098)
* fix unregister api for gpio

* consumers

* guard with a critical section

* index

* guard less

* unregister under lock

* fix reinit

* dead flag

* fix most tests

* initialize properly

* initialize properly

* assertions in tests

* fix message

* we must lock earlier to be truly safe

* this was using huge memory

* devirtualize
2020-12-18 17:18:12 -05:00
rusefillc ca0f3ba240 HW CI is flaky :( #2063
more detailed error messages
2020-12-17 20:22:04 -05:00
rusefillc 26fbf0527a trigger and start button pins not displayed by "pins" command fix #2084 2020-12-16 22:53:26 -05:00
rusefillc 8f2116921c trigger and start button pins not displayed by "pins" command fix #2084 2020-12-16 22:24:19 -05:00
rusefillc a47129693a trigger and start button pins not displayed by "pins" command #2084
progress but not complete fix yet
2020-12-16 22:00:42 -05:00
Andrey G cd546cf932
TLE8888: temp fix of #2065 (#2079) 2020-12-14 15:33:27 -05:00
Matthew Kennedy 360a8c7524
add support for ext ids (#2060)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-12 16:34:21 -05:00
Matthew Kennedy 8ad2080df7
switch stm32 scheduling to use PWM driver (#1983)
* move to folder

* extract hardware part of microsecond_timer

* dead ST forum link

* de-volatile

* simulator build

* guard

* switch stm32 to pwm timer

* comments

* f7 mcuconf

* simulator

* guard

* warning

* header, cleanup

* constant

* less magic

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-11 00:44:40 -05:00
Matthew Kennedy 5f69d23976
fix mock pins array (#2050)
* fix

* fix probably
2020-12-10 00:10:58 -05:00
rusefillc 824f87c2d0 basic hw in the loop - pwm self validation #2028 2020-12-08 04:52:49 -05:00
rusefillc 96c29840ce basic hw in the loop - pwm self validation #2028 2020-12-07 20:42:47 -05:00
rusefillc aca471273d basic hw in the loop - pwm self validation #2028 2020-12-07 20:26:47 -05:00
rusefillc 6712c63160 basic hw in the loop - pwm self validation #2028 2020-12-07 20:01:05 -05:00
rusefillc 2e8ae3ca94 refactoring 2020-12-06 19:04:23 -05:00
Andrey G 7c6974ab43
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 2b5fc79aa7
ADC: correctly calculate cache invalidate range for STM32F7xxx (#2021)
Bug was introduced in 2312b0ae57 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 852fdcd4d1
adc: fix CPU temperature read for STM32F76x/77x (#2020) 2020-12-05 09:58:23 -05:00
Matthew Kennedy 4deb875204
fix warnings (#2003)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-03 07:27:27 -05:00
Matthew Kennedy a3a49b02ed
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 2f91ae6f73 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:55:39 -05:00
rusefillc d4d7e7583b Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:41:22 -05:00
rusefillc 66ae6a1ecf Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 00:24:15 -05:00
rusefi 1238758c0f Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 00:16:59 -05:00
rusefillc a5d0e4beeb avoid float -> int64 conversion #1977
cherry picking...
2020-11-24 20:33:51 -05:00
Matthew Kennedy 922f0249d2
squash warnings (#1984)
* warnings

* unused

* a few more

* too much

* uint16_t-ify
2020-11-23 09:43:16 -05:00
Matthew Kennedy 6334e5011f
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 98605677f6 adc fixed #1979
partial revert
2020-11-22 15:31:33 -05:00
rusefillc 5678190d5a ADC: fixes: #1979
better error handling?
2020-11-22 13:42:24 -05:00
rusefi eece5496da ADC: fixes: #1979
more detailed error message
2020-11-22 12:57:04 -05:00
Andrey G a285ba6743
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 b60ce1b9f8
Typo fix (#1978) 2020-11-22 08:27:03 -05:00
rusefillc e6fa57db87 Starter is engaged on start-up in pull-up configuration #1969
maintainability
2020-11-20 00:18:38 -05:00
shadowm60 7c793834ef
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 f3b7a1d9da
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 47fbb92bff Starter seems to be engaged forever fix #1965 2020-11-18 23:54:30 -05:00
rusefillc 905d740b4b Starter seems to be engaged forever #1965 2020-11-18 22:45:37 -05:00
rusefillc 4e94324e4f Starter seems to be engaged forever #1965 2020-11-18 21:45:17 -05:00
Matthew Kennedy 8241b0aef6
consolidate to common (#1962) 2020-11-18 16:22:19 -05:00
Matthew Kennedy 5d3d85d644
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 dc3b14e5fc better MC33816 start-up status 2020-11-18 01:07:09 -05:00
Andrey G f48621e4c2
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 4d89095890 docs 2020-11-17 08:25:50 -05:00
Matthew Kennedy f9ae075ac6
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 6e4517be8c
adjust microsecond_timer api (#1952)
* change timer api

* don't need all that
2020-11-16 18:50:13 -05:00
Matthew Kennedy 5a443501fb
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 bb8650179c
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 62f441376c
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 7c8521f078 debounce unintended auto-increment bug (was: Proteus TCU gear shift configuration) #1927
refactoring
2020-11-07 00:46:59 -05:00
rusefi ee01be3fd2 debounce unintended auto-increment bug (was: Proteus TCU gear shift configuration) #1927
undoing brain fart
2020-11-07 00:43:42 -05:00
rusefillc 7bfa18295a Proteus TCU gear shift configuration #1927 2020-11-06 23:48:35 -05:00
Matthew Kennedy 3241a43a2d
extract idle hardware to its own file (#1923)
* extract idle hardware

* should fix the build
2020-11-03 18:06:32 -05:00
rusefi 7de1fc8e2a 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 0f5f0a549b this stuff is just too dead 2020-11-02 23:46:41 -05:00
Andrey G 63c25ab8a7
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 946fe5091c
remove spiMtx (#1907) 2020-10-25 17:26:46 -04:00
Matthew Kennedy 08d8262f77
oops (#1899) 2020-10-23 15:45:44 -04:00
Andrey G 8e11675afd
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 4e249889a6
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
Matthew Kennedy e4c5ca4af0
no sd enable (#1894)
* no sd enable

* add assert

* Revert "no sd enable"

This reverts commit fd997381ee884c890fe7664e56ed2b0f0caef2ff.
2020-10-22 20:51:28 -04:00
Matthew Kennedy e0bb7ad581
disable i2c, other unused features (#1891)
* dead

* more
2020-10-20 22:24:32 -04:00
rusefi 51e840eaa6 code style 2020-10-19 22:47:09 -04:00
rusefi e0a5c3dc12 GDI Epic #1448 2020-10-19 22:04:06 -04:00
Matthew Kennedy a68cbae0dc
Remove trigger listener list (#1886)
* avoid 64b on hot path

* no tooth log when fast

* use crit section locker

* final

* only flip pins if not also self stim

* only trace if doing work

* slightly drop lateDelay

* trace if not bailing out

* remove listener array
2020-10-17 08:00:11 -04:00
Matthew Kennedy 7eeb60a8a0
trigger/scheduler perf improvements (#1885)
* avoid 64b on hot path

* no tooth log when fast

* use crit section locker

* final

* only flip pins if not also self stim

* only trace if doing work

* slightly drop lateDelay

* trace if not bailing out
2020-10-16 11:04:27 -04:00
Matthew Kennedy 568ec91fc0
fix temp sensor & validate it (#1879)
* fix temp sensor & validate

* smaller here should work
2020-10-14 22:39:16 -04:00
Matthew Kennedy 2855e04234
start using BufferedWriter (#1878)
* do the part up to actual usage

* borrow some memory for now
2020-10-14 20:06:05 -04:00
rusefi dfa3e69186 GDI Epic #1448 2020-10-11 23:39:40 -04:00
Matthew Kennedy c885db32f0
use expected for event queue next event (#1859)
* use expected for event queue next event

* minor cleanup

* tests
2020-10-05 13:53:34 -04:00