Commit Graph

481 Commits

Author SHA1 Message Date
Andrey b64e553d5d refactoring: reducing outputChannels copy 2022-09-01 01:06:49 -04:00
Andrey be790e2c44 less code is better 2022-08-31 23:14:20 -04:00
rusefillc b3dfbd5a1d more proper fix for part of https://github.com/rusefi/rusefi/pull/4493 2022-08-27 22:28:29 -04:00
rusefillc c0391b16e4 docs 2022-08-25 23:50:00 -04:00
rusefillc 7e6bb54e7a saving 4 bytes of RAM? 2022-08-25 22:34:16 -04:00
rusefillc 72c4637512 progress or maybe even a fix of logging? 2022-08-25 22:24:35 -04:00
rusefillc fb3343dff5 this code is too dead 2022-08-25 22:09:22 -04:00
Andrey 5392f8d13e https://github.com/rusefi/hellen154hyundai/issues/60
extra logging
2022-08-25 19:58:10 -04:00
Matthew Kennedy d4721bee89 implement sensor checker (#4395)
* implement sensor checker

* use default

* s

* fix

* properly report non-timeout errors

* it's not safe to read Value when invalid

* it's not safe to read Value when invalid
2022-07-30 17:08:48 -04:00
rusefillc e19b61aa5b [SECURITY] Cheap password protection against tune modification fix #4243 2022-07-30 12:23:53 -04:00
rusefillc 9e8bfe92d8 #4308 progress 2022-07-14 12:36:55 -04:00
rusefillc 92119af801 logging of live data structs was: data points #3614 2022-06-29 02:37:24 -04:00
rusefi 514531bc5c verbose trigger sync should reuse engineSnifferRpmThreshold #4259
reducing complexity
2022-06-18 14:17:36 -04:00
Matthew Kennedy 5f1801f9d6 trigger configuration refactoring for clarity (#4212)
* This field was ignored.

* move pad out

* gone

* make trigger configuration a little clearer

* even simpler!

* format

* test fix
2022-05-30 19:36:47 -04:00
Matthew Kennedy cf89b42716 move logic in to trigger decoder (#4162)
* move logic in to trigger decoder

* status loop

* minor cleanup

* s
2022-05-10 23:55:28 +03:00
rusefillc 178721c809 Remove value copy from controller into outputChannels #4095 2022-05-09 06:12:17 -04:00
David Holdeman b4e8dfb05a More untested transmission features (#4093)
* use ISS for gearbox ratio, add gauge for TC ratio

* measure shift time

* add shift time gauge, todo notes for pc

* do conversion in the right direction

* switch to Timer and seconds

* try fixing build

* try fixing build again

* try defines, remove include

* use shift pcs

* add 3-2 pct curve

* control 3-2 solenoid

* move 3-2 to persistent config

* fix param
2022-04-23 07:34:39 -04:00
Matthew Kennedy 8650686ab7 knock threshold table fix (#4077)
* fix knock threshold table

* defaults

* knock controller is engine module

* testable

* test builds

* knock tests work

* s

* format

* everyone loves changelogs
2022-04-18 08:03:16 -04:00
rusefillc 16a6112002 one step sideways to fix build 2022-04-16 21:24:02 -04:00
rusefillc 0ba512c925 logging of live data structs was: data points #3614
progress
2022-04-16 21:04:02 -04:00
rusefillc cb4979e068 very random progress 2022-04-16 17:07:57 -04:00
rusefillc 5c5d258b5f typo/grammar 2022-04-13 17:55:31 -04:00
rusefillc 089d7f5cd1 steps towards ignition live data 2022-04-13 16:48:25 -04:00
rusefillc 905fbd851e Air Conditioning Improvements #4054 2022-04-09 00:26:52 -04:00
Matthew Kennedy 405f7f3b43 Gear detection improvements (#4047)
* gear detect improvements

* ui

* ui for gear ratios

* ui
2022-04-06 16:15:58 -04:00
rusefillc 9ae96ea7e5 refactoring: method rename 2022-04-02 21:01:29 -04:00
Matthew Kennedy f0013f71b5 limp mangaer handles more stuff (#3983) 2022-03-20 09:28:17 -04:00
rusefi 0832b694d2 EFI_LAUNCH_CONTROL clean-up 2022-02-06 18:46:09 -05:00
Matthew Kennedy f82f4d08d6 Remove fsio part 2 (#3876)
* dead config stuff

* fsio state

* remove tests

* getEngineValue

* put part back
2022-02-02 00:49:44 -05:00
rusefillc 3be2fcaa80 Limp shutdown rebase (#3879)
* limp manager handles engine stop

* use timer

* dead relevant fsio

* this stuff needs its own ticket

* if we can comment out 'business logic' and tests do not fail it's not a great sign :(

Co-authored-by: Matthew Kennedy <matthewkennedy@outlook.com>
Co-authored-by: rusefillc <sdfsdfqsf2334234234>
2022-02-01 20:47:17 -05:00
Matthew Kennedy 50c31b78ae extract logic from wall wetting AE (#3848)
* extract logic

* extract interface

* explicitly test wall fuel
2022-01-27 07:45:50 -05:00
Matthew Kennedy 5978df2855 refactor decel fuel cut (#3830)
* refactor dfco

* s

* output channel logs dfco

* slightly cheeky comment
2022-01-23 19:44:41 -05:00
Matthew Kennedy 6fc4503ee2 XY Idle VE Table (#3781)
* config & ui

* implement

* test idle VE switching behavior

* use the interface where we can

* s

* re-bump flash version
2022-01-20 14:08:54 -05:00
rusefillc 6fd0ae24d9 RE usability: live data for idle controller 2022-01-10 19:48:58 -05:00
Matthew Kennedy 265f005239 hook up fuel trims (#3715)
* hook up fuel trims

* pass all the params

* store per-cylinder fuel mass directly

* main trigger callback only touches per-cylinder, no banks!

* test test test test

* move UI to happy land

* changelog
2022-01-01 02:19:59 -05:00
Matthew Kennedy c058698859 Nb2 crank sync special case (#3727)
* extract isSyncPoint

* test because why not

* check vvt resync nb2

* custom nb decoder

* test only resyncs once!

* good job valgrind, you found a bug!
2021-12-31 15:47:25 -05:00
rusefillc 5f3de0d69c live data for wastegate and launch control #3588 2021-12-16 16:19:33 -05:00
Matthew Kennedy bdf6583306 smarter priming logic (#3674)
* ignition controller detects rising edge on voltage

* update test

* comment

* ignore negative transients

* tweak

* test

* priming happens on ignition-on

* priming has its own scheduling

* config & UI

* dead config

* implementation

* look, the test caught a bug

* keep the watchdog happy

* bad merge

* changelog

* easier to read the test

* test naming
2021-12-08 16:20:19 -05:00
Matthew Kennedy e80654511d prime upon ignition voltage, not on power on (#3662)
* ignition controller detects rising edge on voltage

* update test

* comment

* ignore negative transients

* tweak

* test

* priming happens on ignition-on

* priming has its own scheduling

* test

* dead adjacent line of code
2021-12-08 07:26:49 -05:00
Matthew Kennedy 3d3bf5ea4b ignition controller detects rising edge on voltage (#3636)
* ignition controller detects rising edge on voltage

* update test

* comment

* ignore negative transients

* tweak

* test
2021-12-07 21:28:04 -05:00
Andrey d2c46b3310 Let's always have TS structure so that unit tests can check values in outputChannels, kind of making outputChannels a god dump for state but whatever since Live View is coming 2021-12-07 20:18:47 -05:00
rusefillc 359420e93d Pause CAN broadcast on engine stop #3665 2021-12-07 10:35:52 -05:00
rusefillc 7c5940fcc2 tune via CAN #3361
pauseCANdueToSerial
2021-12-05 21:21:36 -05:00
Matthew Kennedy ba6eec22c8 Alternator controller is engine module (#3663)
* alternator is engine module

* user can't set pid period
2021-12-05 18:33:50 -05:00
Matthew Kennedy b2af3637a2 simplify cylinder phasing (#3650) 2021-12-05 10:46:35 -05:00
Matthew Kennedy 6e4759389a AC is EngineModule (#3604)
* AC is engine module

* missed a spot with main relay while we're at it

* TS
2021-11-25 07:59:31 -05:00
rusefillc 28c9d7555b live data for wastegate #3588 2021-11-24 12:59:57 -05:00
Matthew Kennedy 5274cffff3 main relay doesn't use fsio (#3580)
* fuel pump

* s

* call correct callback

* more dead

* test adjustment

* don't overflow

* don't need separate function

* java

* give it a name

* generated

* generated

* add to generate script

* import *

* this is so cheap we don't need a flag

* main relay

* plumbing

* dead fsio stuff

* test it

* by 100%, we mean 99.98%
2021-11-24 07:47:51 -05:00
Scott Smith 07d30285fc Basic framework for high pressure fuel pump control (#3476)
* Basic framework for high pressure fuel pump control

* Many changes

Move calculations to fast callback
Move main object into Engine
Respond to pin changes without requiring a reboot

* Use EngineModule for HpfpController
Schedule pin off after executing pin on so we are sure it ends, even if the motor stops.
Test scheduling.
Less RAM use by only having one event and reordering fields.

* Make scheduling test actually useful - need non-0 activation angle.

Co-authored-by: rusefillc <48498823+rusefillc@users.noreply.github.com>
2021-11-19 23:06:51 -05:00
Matthew Kennedy e7956a53f6 fuel pump doesn't use fsio (#3576)
* fuel pump

* s

* call correct callback

* more dead

* test adjustment

* don't overflow

* don't need separate function

* java

* give it a name

* generated

* generated

* add to generate script

* import *

* this is so cheap we don't need a flag
2021-11-19 22:23:12 -05:00
Scott Smith aba4e5167e Separate out scheduleOrQueue into it's own standalone scheduler. (#3573)
It's a large enough entity that it shouldn't be buried in ignition logic.
2021-11-18 14:27:21 -05:00
Scott Smith b3e0b28c75 Make the module API more concise. (#3571)
engineModules.get<FOO>(). becomes modules<FOO>()->

I believe the new API is more conducive to supporting arrays, by doing std::array<T, N> or
std::array<Mockable<T>, N>, with the support of a helper class.
2021-11-17 21:50:00 -05:00
Scott Smith 659cc68be1 Final cleanup of ENGINE macros (#3567)
Fix some uses of ENGINE() not detected by regex due to parenthesis.
Remove now empty engine_ptr.h
Don't worry about EFI_* not being defined, the compiler defaults to 0 if they aren't.
2021-11-17 13:45:10 -05:00
Scott Smith f9f13f0bad Create a base class EngineModule for that contains various useful callbacks. (#3548)
* Create a base class EngineModule for that contains various useful callbacks.

This cleans up the API by not requiring the notifiers to know about who wants callbacks.  The only
place you need to update to add a module is in one place.

* Add mockability.

* Convert InjectorModel to a Mockable EngineModule
2021-11-17 20:13:19 +03:00
Scott Smith 19f7fa8f89 Make engine* and friends be const pointers in production. (#3564)
This allows the compiler to see through the pointer and make accesses faster.
It saves 1336 bytes of text.
2021-11-17 03:53:17 -05:00
Scott Smith dac2ae9b1d Programmatically remove EnginePtr/inject, EXPAND_Engine, and WITH_ENGINE_TEST_HELPER* (#3560)
* Programmatically remove EnginePtr/inject, EXPAND_Engine, and WITH_ENGINE_TEST_HELPER*

for i in ": public EnginePtr " ", public EnginePtr" "EXPAND_Engine;" "EXPAND_Engine"; do
    git grep -l "$i" | xargs sed -i "s/$i//g"
done

git grep -l "inject" | xargs sed -i "/inject[(][)]/d"

for i in WITH_ENGINE_TEST_HELPER_SENS WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK WITH_ENGINE_TEST_HELPER; do
    git grep -l "$i" | xargs sed -i "s/$i/EngineTestHelper eth/g"
done

git checkout firmware/controllers/core/engine_ptr.h
git checkout unit_tests/global.h

* Review fixups.
2021-11-16 16:52:11 -05:00
Andrey 1be12392c0 proportional spark cut #3427 2021-11-16 13:23:08 -05:00
Matthew Kennedy 7296593448 remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
Scott Smith 2cfc4af998 Start the process of using a global engine ptr for unit tests. (#3551)
* Start the process of using a global engine ptr for unit tests.

Passing around the engine, config, and persistent state wasn't buying anything.  Instead, use
EngineTestHelper(Base) to correctly set and clear the global variables.  Add a dummy check in
case some test tries to set them manually.

* Fix OSX build

* Adapt PR to recently added code.
2021-11-16 00:23:14 -05:00
Andrey 349d224b5f technical debt: enableOverdwellProtection #3553
only documentation
2021-11-15 20:32:25 -05:00
Andrey 7b790d36f6 random refactoring: trigger central encapsulation 2021-11-15 20:22:05 -05:00
Andrey 4bc9343d0b refactoring launch 2021-11-15 20:09:03 -05:00
Andrey c8b733ea6e refactoring launch 2021-11-15 19:34:42 -05:00
Andrey bc3befd0ac refactoring launch 2021-11-15 18:57:12 -05:00
Matthew Kennedy bd04dc8352 less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
rusefi 291f815b2d Something something Automatic Compression Release #3442 2021-11-14 15:04:10 -05:00
Andrey 1aca049c47 Something something Automatic Compression Release #3442 2021-11-11 20:16:46 -05:00
Andrey 9aa98cd523 refactoring: less hacky implementation 2021-11-11 20:16:46 -05:00
Matthew Kennedy 1cee83a56c Knock retard (#3396)
* output gauge

* knock controller

* don't need that

* inject engine ref

* test knock

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-01 23:33:59 -04:00
rusefillc d60e6eb9af refactoring - extracting idle state 2021-10-17 00:30:26 -04:00
rusefillc d4e9c1597a refactoring - extracting idle state 2021-10-16 23:55:29 -04:00
rusefillc 504bd78814 Remove engine load acceleration enrichment fix #3357 2021-10-16 21:24:05 -04:00
rusefillc 705295dbfb Whatever we call it, how ever we implement it - we need live data / remote view into rusEFI actual state #3353 2021-10-14 00:47:26 -04:00
Matthew Kennedy ea7187bb25 overdwell protection (#3220)
* cancel event

* looks like it works...

* some tests are happy

* add enable bit

* undo test changes

* Revert "add enable bit"

This reverts commit 000afadd3fc560867302557afe26f76cd9fc4ed6.

* enable bit in engine

* only turn off for one test

* Revert "undo test changes"

This reverts commit 106db49e291b5a531a94de6ac177c6584d5337f6.
2021-10-02 01:10:24 -04:00
Matthew Kennedy 48da721c49 dead knock code (#3255)
* more unification

* hip stub

* comment

* guard

* channel idx

* include

* hip

* move in to engine

* hip9011

* dead stuff

* dead

* fsio

* lcd

* more dead
2021-09-21 20:40:20 -04:00
Matthew Kennedy 6ac12f2984 more knock sense unification (#3250)
* more unification

* hip stub

* comment

* guard

* channel idx

* include

* hip

* move in to engine

* hip9011
2021-09-21 17:39:21 -04:00
Matthew Kennedy f6e269a3ab remove old vss implementation (#3208)
* dead vss

* remove
2021-08-28 01:39:55 -04:00
Matthew Kennedy 210aa31ef3 cleanup missing fsio stuff (#3189) 2021-08-24 08:19:03 +03:00
Andrey e62244a623 unit test for vehicle_speed.cpp #3081 2021-08-03 19:48:24 -04:00
Andrey 39b9211588 VVT C++ magic - helping Kinetis 2021-07-21 23:06:35 -04:00
Andrey 6f5101bb3a VVT C++ magic - helping Kinetis 2021-07-21 22:38:00 -04:00
Andrey 30289a002b VVT C++ magic 2021-07-21 22:28:35 -04:00
Andrey 4c4816bc10 VVT C++ magic 2021-07-21 22:21:59 -04:00
Andrey 2f2814e035 VVT C++ magic 2021-07-21 22:14:21 -04:00
rusefi fbab735587 VVT verbose fix 2021-07-21 21:35:26 -04:00
rusefillc 9570458aea NB2 trigger shape does not seem to match JimStim #2980 2021-07-17 16:12:54 -04:00
Matthew Kennedy e3849b95d5 don't require EXTERN_ENGINE in every file (#2969)
* move enginePins

* no more extern engine

* uses

* more

* extern config too

* put this where it belongs

* include correct header

* merge
2021-07-16 18:13:33 -04:00
Andrey aed7afa1d4 trigger signal debug pins - logic level output #2959 2021-07-15 01:56:04 -04:00
Matthew Kennedy 717d4dd7ac Unified cyl count macro (#2914)
* update test framework

* eh

* hey look it's fewer warnings

* unwind

* fix

* config

* configs

* logic

* even java had some

* console needs help
2021-07-06 20:14:08 -04:00
Andrey 0a5f688697 global static not good, there shall be only one god object /s 2021-06-25 01:37:43 -04:00
Andrey f567c764ab giving unit tests a chance to use tdcMarkCallback 2021-06-25 01:31:53 -04:00
Andrey 263bdb7eae global static not good, there shall be only one god object /s 2021-06-23 06:10:27 -04:00
Matthew Kennedy 0c03a1cb4a const airmass (#2694) 2021-05-14 07:17:22 -04:00
Matthew Kennedy d7f9d42e07 Hook up multi bank fuel trim (#2532)
* multi bank trim

* cleaning

* output channels

* output channels
2021-05-08 17:41:50 -04:00
Matthew Kennedy 37a3de07cf remove stateChangeCallback from simplepwm (#2644)
* remove callback parameter from cj125

* remove from ext

* remove stateChangeCallback

* alt doesn't need that

* demorgan

* remove call

* bad cut/paste

* check the actual pin in the test
2021-05-07 09:38:41 -04:00
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 c168c748ea dead code, warnings (#2461) 2021-03-15 10:23:19 -04:00
Matthew Kennedy a7a82b1aab remove lastTriggerToothEventTimeNt (#2430)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-07 17:11:50 -05:00
Matthew Kennedy 89d71e4379 Compute injection duration later in the pipeline (#2175)
* injector model, test

* new math

* inject fuel based on new math

* tests

* fix

* it should work like this

* format

* update TPS AE even when we're cutting fuel

* comment

* conversion factor

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-03 07:30:56 -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