Commit Graph

191 Commits

Author SHA1 Message Date
Matthew Kennedy 5f0791f9fb Destroy all shared logger (#2574)
* most of shared logger

* a few more

* one more

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 14:28:48 -04:00
Matthew Kennedy 737ee444b8 rip the bandaid: find-replace most of scheduleMsg (#2572)
* biiiig find replace

* more trivial find replace

* pwm

* almost all of them

* few more

* gpio

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 12:53:13 -04:00
Matthew Kennedy 992c16b4af logging cleanup 2: sensors, pid, etb, etc (#2567)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 20:02:32 -04:00
Andrey G a0053d5845 hip9011 and friends (#2527)
* engine math: extrant getFiringOrderTable for reuse

* engine math: getNextFiringCylinderId helper

* introduce knock_logic: first member is getCylinderKnockBank()

moved from software_knock.cpp

* hip9011: support two inputs/banks

* fix CI

* Board Subaru EG33: populated with TPIC8101 with Advanced mode

* hip9011: test communication in advanced mode

* hip9011: handle situation when chip is already in advanced mode

* Board Subaru EG33: cylinder to knock bank mapping

* hip9011: count spi transactions in advansed mode too

* hip9011: reset incalid responce counter after chip initialization

* hip9011: make debug output more structured
2021-04-04 18:13:21 -04:00
Matthew Kennedy 761e65c710 make board config override actually usable (#2508)
* new function

* hellen

* MRE

* proteus

* put those function declarations in a reasonable place

* put the comment back

* weak

* move that to a reasonable place

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-31 14:46:50 -04:00
Andrey G 112b4d1182 Hip9011 (#2512)
* hip9011: coexistance with other spi devices

* hip9011: rework so SPI transfer is invoked from thread

also use polling spi exchange to avoid cache problems

* hip9011: move calculations from ADC callback to thread

* hip9011: big cleanup

* hip9011: simplify spi communication

* No need to set knockBandCustom if it is not custom

HIP9011 calculates knockBand from cylinderBore same way

* hip9011: make unit test happy

* hip9011: fix unit test

* hip9011: remove duplicated initialization, reorder

* hip9011: just renames and data type adjustments

* hip9011: rename BAND() to HIP9011_BAND()

* hip9011: move some code from lookup.cpp to logic.cpp

* hip9011: move initEngineNoiseTable to engine_configuration.cpp

* hip9011: move lookup tables to hip9011_logic.c

* hip9011: remove empty files

* hip9011: additional checks
2021-03-30 10:56:25 -04:00
Andrey G 5fda278503 hip9011: get callback from spark on each cylinder (#2499)
* hip9011: get callback from spark on each cylinder

* hip9011: cleanup unused
2021-03-27 14:12:49 -04:00
Andrey G aa05ff195d Hip9011 and cleanups (#2477)
* hip9011: move hipCs out of EnginePins to hip9011 driver

* hip9011: cleanup debug output, save few RAM bytes

* Supress few signed vs unsigned warnings
2021-03-20 08:40:36 -04:00
Matthew Kennedy c168c748ea dead code, warnings (#2461) 2021-03-15 10:23:19 -04:00
rusefillc 9f90387d09 vBatt -> SensorType::vBatt fix #2260 2021-03-11 23:07:18 -05:00
Matthew Kennedy 122f31fe4a hook up lps25 on proteus (#2418)
* hook up lps25

* it would help to include all the files

* unguard some stuff

* unguard more

* guarding

* s

* guard

* only register if init worked

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-04 22:39:20 -05:00
Andrey G cd548b4db2 hip9011 compilation fix, cosmetic clean-ups (#2414)
* Board subaru eg33: has HIP9011 knock sensor

* hip9011: lastExecutionCount does not exist any more

* hip9011: extranc commands to header, use logic math for bitfields
2021-02-28 15:42:57 -05:00
Matthew Kennedy f8747a35bf set all thread priorities in the same place (#2412)
* unify thread priority

* header

* mmc
2021-02-28 07:30:45 -05:00
Matthew Kennedy 179a3cb89e 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
Matthew Kennedy 55facb6613 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 dbebc353a2 remove unused msg parameter (#2360)
* dead parameter

* last few
2021-02-16 09:32:16 -05:00
Matthew Kennedy 63c9612602 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
Andrey G b61ae75fe2 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 5a75c69b8e knock v12 2021-01-06 19:42:07 -05:00
Andrey G 71fe582ce5 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
rusefi 06e72d6676 trigger and start button pins not displayed by "pins" command #2084 2020-12-22 21:20:57 -05:00
rusefi a06c58d916 trigger and start button pins not displayed by "pins" command #2084 2020-12-22 21:05:49 -05:00
Matthew Kennedy 30fd52d82d 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 5390fccada Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:55:39 -05:00
Matthew Kennedy c73978310f 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 fc02c2bdf4 fix broken master, inject engine ptr to rpmcalculator (#1759)
* fix

* oops
2020-09-05 18:49:42 -04:00
rusefi c476cd3b95 refactoring 2020-09-03 19:29:15 -04:00
rusefi 9a33e922af The Big Refactoring of 2019: folder structure #723 2020-08-02 20:46:40 -04:00
rusefi a2648c4d52 WBO 2020-05-20 19:01:55 -04:00
rusefi b34693da97 docs 2020-05-03 10:41:48 -04:00
rusefi f9e63c5c45 CJ125 PI commands 2020-05-01 20:22:49 -04:00
rusefi f66a1c21c9 cj125 progress 2020-05-01 19:42:09 -04:00
rusefi b262b5da66 cj125 less verbose when running 2020-05-01 19:27:26 -04:00
rusefi c33d611dd4 bugfix 2020-05-01 19:19:29 -04:00
rusefi 9353ef7d51 better state messages 2020-05-01 18:52:06 -04:00
rusefi 7689cfc2dd Attempting cj125 2020-05-01 17:52:25 -04:00
rusefi bdacba7d4a docs 2020-04-30 22:30:37 -04:00
rusefi b04a3ecbed https://github.com/rusefi/rusefi_documentation/issues/37 2020-04-29 18:46:51 -04:00
rusefi 0ec3ce595e dead code 2020-04-26 17:40:12 -04:00
rusefi 33eb9fd2ec new attempt at better simulator 2020-04-13 13:12:55 -04:00
rusefi 79d7afca3c fixing build 2020-04-13 10:23:08 -04:00
rusefi 27a38c7cf8 progress 2020-04-13 09:14:48 -04:00
rusEfi 371754118c cj125 diag 2020-04-09 00:17:29 -04:00
rusEfi 80d5ef0c3f cj125 diag 2020-04-09 00:12:27 -04:00
rusefi c98cdc9c0a cj125 progress 2020-04-08 23:14:21 -04:00
rusefi 914855d262 refactoring 2020-04-08 21:23:49 -04:00
rusefi cc35e8a9b0 code style 2020-04-01 19:00:56 -04:00
Matthew Kennedy 0ac3e06149 cleanup extern mess (#1237)
* cleanup

* move outside define
2020-03-29 19:06:03 -04:00
rusefi 74b191d6d0 random code from Ola 2020-03-24 19:14:16 -04:00
Matthew Kennedy c51f3ad303 Dont cache dma buffers (#1110)
* add no_cache

* don't disable cache

* conventions

* formatting
2020-01-29 00:32:43 -05:00
rusefi 5ec42fd6bc F7 SPI challenges 2020-01-24 23:52:56 -05:00
Matthew Kennedy f8cd2ad3ce use NT_PER_SECOND instead of convert from microseconds (#1107)
* add NT_PER_SECOND

* missed a few

* inject tooth logger timestamp

* inject
2020-01-19 22:23:41 -05:00
rusefi a222ecdfe1 happy new year unification 2020-01-13 21:57:43 -05:00
rusefi 63e3e84e08 happy new year 2020-01-08 00:02:40 -05:00
dron0gus d218b4e8e6 Spi fixes (#1083)
* spi: add support for SPI4

* mpu_util: spi: add 8BIT mode definitions for F4, F7 and kineris (?)
2020-01-06 08:44:23 -05:00
rusefi cf0b13041f random refactoring: hopefully not changing byte size of any variables but clarifying/fixing type between ticks, US and MS 2019-12-21 21:11:09 -05:00
rusefi f47a1a16d1 getting rid of boardConfiguration / binary compatible change 2019-12-11 17:48:55 -05:00
rusefi a09ee15b08 The Big Refactoring of 2019: folder structure #723 2019-12-04 00:22:34 -05:00
rusefi 7fb375b15f fixing build 2019-12-02 09:59:53 -05:00
rusefi f9c387b42e cj125 unit test progress! 2019-12-02 01:52:54 -05:00
rusefi 19bdb9a35f docs & code formatting 2019-11-19 18:17:03 -05:00
rusefi 8bbd06d165 refactoring: time to unify digital pin API 2019-11-11 23:32:09 -05:00
Matthew Kennedy 821ca6156f move tsOutputChannels to header (#970) 2019-10-08 21:02:51 -04:00
rusefi c6bca8e77a ETB target is using integer values #945
refactoring - ADC mocking is a mess
2019-09-22 10:02:07 -04:00
rusefi 658dac889c ETB target is using integer values #945
refactoring - ADC mocking is a mess
2019-09-22 09:56:06 -04:00
rusefi 3fa5399ed7 EFI_CJ125_DIRECTLY_CONNECTED_UR should be a runtime parameter fix #914 2019-09-03 18:44:05 -04:00
rusefi 0e6509906b longer field names 2019-07-13 10:32:36 -04:00
Matthew Kennedy 0b52f5b542 Template-ize bin/value length for interpolation (#878)
* update consumers

* tests

* whitespace

* format
2019-07-09 21:16:36 +03:00
rusefi 9d004635e4 More than one aux pid #866
renaming this class since we will probably have two different implementations for two different cases
2019-07-08 03:35:41 -04:00
Matthew Kennedy 515ab03688 const, explicit, and override (#831)
* const, explicit, and override

* more const

* more const

* missed a spot
2019-06-08 09:51:36 -04:00
rusefi e736578452 docs 2019-05-27 17:02:46 -04:00
rusefi ea86d987c8 PID - fix dTime usages #776 2019-04-25 21:31:33 -04:00
dron0gus 83d1f254a1 Exti rework (#770)
* io_pins: implement efiSetPadUnused

When pin becomes unused it should be switched to safe mode and
disconnected from any IP block. Assume that gpio input mode with
pull-up is safe enough.

* trigger_input: switch triggers pins to safe mode on stop/reinit

* digital_input_exti: rework

* rename enableExti to efiExtiEnablePin
* add efiExtiDisablePin
* keep track of used exti channels

* trigger_input: use digital_input_exti functions
2019-04-21 09:28:49 -04:00
rusefi 56511da9e1 input mode control and other pin mode control #767
TODO
2019-04-20 10:59:07 -04:00
rusefi 16c68ef5d1 docs 2019-04-20 10:21:45 -04:00
rusefi c55300df7d USB and TLE8888 not working for F4 or F767 #764 2019-04-19 13:01:06 -04:00
rusefi 476db0c857 USB and TLE8888 not working for F4 or F767 #764 2019-04-19 12:42:21 -04:00
rusefi f6eb829fef cj125 and hip125 and else SPI broken with chibi18 migration #757 2019-04-14 18:09:58 -04:00
rusefi 6bda683fba random cleanup 2019-04-14 13:52:27 -04:00
rusefi fe1f871a69 defined(__DOXYGEN__) ? #748 2019-04-12 20:52:51 -04:00
rusefi 54f83a431e smarter PWM API - need to pass arbitrary pointer 2019-04-12 20:11:27 -04:00
dron0gus 12e07bc3ab Some more include fixes for linux (#738)
* Some more include fixes for linux

* Pass cross-compile path through CROSS_COMPILE

* Lower-upper case conversion fixes for linux
2019-04-10 01:12:35 +02:00
rusefi 0121a7bc5b The Big Refactoring of 2019: folder structure #723 2019-04-02 23:19:21 -04:00
dron0gus 3163d04dfb console vs ts cleanup and compilation fix for linux (#728)
* console vs ts cleanup

* include is case-sensetive in linux
2019-04-01 23:04:49 +02:00
rusefi 5311bfa502 unifying_file_naming 2019-03-29 09:40:43 -04:00
rusefi ad46204200 git 2019-03-29 09:38:08 -04:00
rusefi ddb0fc6510 better error handling for invalid SPI settings 2019-03-26 09:38:23 -04:00
rusefi 3ff5581e77 SPI prescaler refactoring 2019-03-25 22:41:31 -04:00
rusefi 1f81aa169a we need TLE8888 driver #714 2019-03-25 20:30:36 -04:00
rusefi 8303dc7595 refactoring: no logic changes, just nicer variable and method names 2019-03-12 18:54:46 -04:00
rusefi c60c8ce777 better (?) variable names 2019-02-10 22:47:49 -05:00
rusefi 7549f7e0fc CJ125 unit-tests coverage #617 2019-02-02 01:45:26 -05:00
rusefi e4e47ae833 CJ125 unit-tests coverage #617 2019-02-02 01:06:45 -05:00
rusefi 4796942097 CJ125 unit-tests coverage #617 2019-02-01 23:48:11 -05:00
rusefi 6992480f74 CJ125 unit-tests coverage #617 2019-02-01 23:16:34 -05:00
rusefi dd7add7a78 CJ125 heater zero PWM improvement 2019-02-01 22:20:15 -05:00
rusefi 55e74865b7 docs 2019-01-11 08:33:34 -05:00
Matthew Kennedy fd8c6a8906 idle CS pin fix #665 (#666) 2019-01-11 08:12:26 -05:00
rusefi fed61c1af4 The Big Refactoring of 2019: DECLARE_ENGINE_PARAMETER_SUFFIX consistency and simplification #657 2019-01-09 22:57:33 -05:00
rusefi 9f63ea4130 The Big Refactoring of 2019: scheduler should not be global #655 2019-01-09 08:50:51 -05:00