Commit Graph

197 Commits

Author SHA1 Message Date
Andrey 705dda095e dead code 2022-09-01 00:23:33 -04:00
Andrey da66fa055c refactoring: enum name clean-up 2022-09-01 00:23:33 -04:00
Andrey 9f4f85a097 let spark deal with spark limpManager 2022-08-31 23:59:40 -04:00
Andrey 28d797d5c2 moving confusion further away from fuel control 2022-08-31 23:59:40 -04:00
Andrey 6d3a6dc2f8 readability 2022-08-31 23:29:47 -04:00
Andrey 4cbaddcc60 less code is better 2022-08-31 23:14:20 -04:00
Andrey 039f70b18e unused parameter 2022-08-31 22:59:05 -04:00
Andrey fef406a5a6 english do you speak it 2022-08-31 22:56:38 -04:00
Andrey c8e821ce16 dead 2022-08-31 22:45:35 -04:00
Andrey a4805dace0 dead console command and minor refactoring 2022-08-31 22:41:58 -04:00
Andrey cecc5a9d6e https://github.com/rusefi/hellen154hyundai/issues/60
extra logging
2022-08-25 19:58:10 -04:00
rusefillc 5d2096f906 require full sync for odd cylinder count #4478 2022-08-23 22:58:33 -04:00
Matthew Kennedy c0f290b922
Injector scheduled by angle, not tooth index (#4208)
* trigger decoder returns a result

* TriggerFormDetails

* s

* don't reach out and touch the engine

* injection doesn't care about teeth

* fix up existing tests

* oh look, we can actually test this logic now without trying to depend on trigger shape!!!

* fix a real bug

* simplify
2022-06-24 17:43:23 -04:00
Matthew Kennedy 720c463ffb
trigger decoder returns a result (#4206) 2022-05-28 09:01:45 -04:00
Matthew Kennedy fe77f5127e
12 tooth crank mode (#4179)
* 12 tooth crank

* comment

* s

* rusefi config
2022-05-17 21:38:24 -04:00
rusefillc 7ca32951ec An option to disable semi-random ignition fix #4151 2022-05-08 09:16:43 -04:00
Matthew Kennedy bc6a87cadc
allow enum_class in rusefi_hw_enums.h (#4104)
* make things c++ friendly

* install various canaries in coal mines

* using is much clearer than typedef

* fixing builds

* lps25

* trigger includes were a mess

* c -> c++ cleanup

* os util

* why did so many include os_util.h?

* fwd declare

* cypress/kinetis

* s

* eg33 happy

* happy sim

* cypress usb

* pch

* cypress

* doesn't need to include all that

* h7
2022-04-25 20:38:16 -04:00
rusefillc 71275e841b
m_hasSynchronizedSymmetrical handling improvements #4099 (#4101) 2022-04-23 19:45:29 -04:00
rusefillc 6b5747d4c8 refactoring: method rename 2022-04-02 21:01:29 -04:00
Matthew Kennedy f742ae8b7e
limp mangaer handles more stuff (#3983) 2022-03-20 09:28:17 -04:00
Benas Brazdziunas 2035c2fa7f
Launch fuel and spark cut issue (#3988)
* Launch fual and spark cut issue

* moved launch cuts to limp_manager

* Applied recomendations

* Auto-generated configs and docs

* Added recomendations

* Auto-generated configs and docs

Co-authored-by: GitHub build-firmware Action <action@github.com>
Co-authored-by: Benas <bbrazdziunas@gavea.co.uk>
2022-03-11 09:27:42 -05:00
Matthew Kennedy b5232ab5e6
decouple TPS accel enrichment from trigger (#3825)
* move call site

* move thresholding out of fast path

* adjust config

* test
2022-01-23 15:31:39 -05:00
Andrey 365f2f24f0 Good news RPM is now float
open question if I've affected performance negativelly or not.
2022-01-21 00:56:13 -05:00
Andrey 33df88d3f7 fixing NOISY_RPM handling via Sensor framework 2022-01-21 00:21:45 -05:00
Andrey cda2b711cf migrating to SensorType::Rpm API 2022-01-20 23:32:59 -05:00
rusefillc 177a5faa63 limp ClearReason 2022-01-08 22:13:20 -05:00
Matthew Kennedy ab3e3ac83f
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 b3de217c1b
adjustment to #3722 (#3723)
* s

* behold, another bug a test caught

* test

* test generates usable trigger pattern so it works correctly

* comment

* don't need that
2021-12-31 01:21:21 -05:00
Matthew Kennedy c3b712aa3b
remove vvtSyncTimeNt (#3722)
* s

* poke

* poke again for science

* kick for science

* kick

* kick

* comment kick

* s

* don't try to compare the array decay pointer to 0 (!)

* collateral damage

* adjust miata sync

* reset trigger states correctly on engine stop

* s

* check synchronized bit

* now we don't need it at all?!

* and *NOT* synced

* start VVT sync earlier
2021-12-28 00:00:26 -05:00
Matthew Kennedy 95ad75318d
improved noFiringUntilVvtSync logic (#3696)
* s

* poke

* poke again for science

* kick for science

* kick

* kick

* comment kick

* s

* don't try to compare the array decay pointer to 0 (!)

* collateral damage

* adjust miata sync

* reset trigger states correctly on engine stop

* s

* nissan MR too
2021-12-27 12:09:38 -05:00
rusefillc 82c061a8e0 MAP phase sensing #3544 2021-12-16 21:11:29 -05:00
Matthew Kennedy 4148ee76bf
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 2050580a16
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 3a95e86112
calculate per-cylinder ignition timing (#3652)
* simplify cylinder phasing

* per cylinder timing

* s

* s

* s

* why was there a divide by 2?
2021-12-06 21:19:37 -05:00
Andrey 48ed80ffb9 MAP phase sensing #3544 2021-11-24 23:06:52 -05:00
Matthew Kennedy 3334a6963c
oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -05:00
Matthew Kennedy d40ca0f581
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 18c27a6e9c
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 98040ad9af
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 69d36dad6e
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 988aacdd91
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 823d9a07e0
Programmatically replace ENGINE() and CONFIG() with engine-> etc (#3565)
git grep -l -w ENGINE | xargs sed -i -r "s/ENGINE\(([]a-zA-Z_0-9.[]+)\)/engine->\1/g"

git grep -l -w CONFIG | xargs sed -i -r "s/([^a-zA-Z_])CONFIG\(([]a-zA-Z_0-9.[]+)\)/\1engineConfiguration->\2/g"
2021-11-17 03:54:21 -05:00
Scott Smith cc95bd6c8e
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
Matthew Kennedy 8cdac4cac0
remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
Scott Smith 344c9073e2
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 655b77dc3f random refactoring: trigger central encapsulation 2021-11-15 20:22:05 -05:00
Andrey 928c673695 refactoring launch 2021-11-15 20:09:03 -05:00
Andrey 05fa6071dd refactoring launch 2021-11-15 19:55:04 -05:00
Andrey 4002c92dcc refactoring launch 2021-11-15 18:57:12 -05:00
Andrey 34015eceee refactoring launch 2021-11-15 14:40:35 -05:00
Matthew Kennedy 145316c497
less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
Andrey cd57e1fdb6 Something something Automatic Compression Release #3442 2021-11-11 20:16:46 -05:00
Andrey 6436a2b9a4 dead line 2021-11-11 20:16:46 -05:00
rusefillc 61e2b3d5db Remove engine load acceleration enrichment fix #3357 2021-10-16 21:24:05 -04:00
Matthew Kennedy 9797d25b7c
getOrZero (#3319) 2021-10-05 19:59:07 -04:00
rusefillc a6fbb98193 Complete fuel cut, maybe by wall wetting? Warning on decel (?) CUSTOM_OBD_SKIPPED_FUEL = 9010 fix #3225 2021-09-27 22:04:03 -04:00
rusefillc bca1b11146 "Injector Duty cycle cut" 2021-09-26 20:59:32 -04:00
Matthew Kennedy 8cd132b8a8
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 b52d50bbf2
Use pch in lots of files (#3066)
* most engine.h

* most engine_configuration

* more

* more

* more

* more

* more

* moooooore

* ok I'm done for now

* oops
2021-07-26 01:05:17 -04:00
Matthew Kennedy 2368e90ae7
dead (#3016) 2021-07-23 08:31:23 -04:00
rusefillc 599943cf26 NB2 trigger shape does not seem to match JimStim #2980 2021-07-17 16:12:54 -04:00
Matthew Kennedy 2ce7777865
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 e1c41ff798 FATAL on NB2 tune jim stim input signal #2965 2021-07-14 16:03:00 -04:00
Andrey a57d7c48fb global static not good, there shall be only one god object /s 2021-06-23 06:10:27 -04:00
Matthew Kennedy 13f3d1e291
Fix multi bank fueling (#2661)
* add cylinder number

* changelog

* wording
2021-05-09 09:37:07 -04:00
Matthew Kennedy 3968204dfa
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 c26987b96b
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 ad71016862
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
rusefillc 41804736e2 engine sniffer into unit tests 2021-04-04 22:41:38 -04:00
Matthew Kennedy 4e3e95db2d
replace print/printMsg with scheduleMsg (#2497)
* start cleaning

* disabled feature means don't print that it's disabled

* cli

* usages

* printMsg -> scheduleMsg

* this is alllll dead now

* no crlf please

* all hope is lost if you manage to hit this line

* tests

* tests

* ok we did actually need that part

* sim

* d

* kinetis

* it did ifdef, not if

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-26 17:23:26 -04:00
Andrey G 89b631a794
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 650d148008
Usable fuel consumption data/gauges (#2474)
* fuel consumption

* gauge names

* consumers

* obd

* binary logging

* doesn't need explicit constructor

* getters

* it works

* correct for injections per cycle

* datalog

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-19 17:04:42 -04:00
Matthew Kennedy 5067b81fce
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 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
rusefillc 2d99e77c95 M62T vanos support #2243 2021-02-08 21:50:31 -05:00
rusefi 6b10de5616 refactoring: naming consistency 2021-02-08 18:20:53 -05:00
Matthew Kennedy 93b034b8e9
Limp handles inj/ign disable (#2245)
* status loop just asks limp mgr

* put logic in limp manager

* don't need that function any more

* bye

* TIL these bits already exist in the configuration
2021-01-27 21:28:53 -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
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 ff4ce2fb1f
create limp manager (#2142)
* move rev limit to limp manager

* call fatal error

* include order

* fix bug

* tests

* comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-26 17:30:46 -05:00
rusefillc c36f76b68e Fuel pump should turn on at the first sign of engine rotation #1961 2020-12-02 23:09:39 -05:00
rusefillc 9045470fc6 avoid float -> int64 conversion #1977
cherry picking...
2020-11-23 23:53:25 -05:00
Matthew Kennedy 55379463c0
remove (#1985) 2020-11-23 20:10:17 -05:00
rusefillc 96a126d60f 60/2 perf grab #1850
unused parameter
2020-10-04 02:09:12 -04:00
rusefillc 030ec42ac7 60/2 perf grab #1850
a) removing more of stack validating - one validation within the deepest method would be enough

b) un-wrapping main callback loop for explicit order of execution
2020-10-04 01:43:02 -04:00
rusefillc 6b95579706 60/2 perf grab #1850 2020-10-04 01:26:29 -04:00
rusefillc c9d3d1f01a 60/2 perf grab #1850 2020-10-04 01:04:15 -04:00
shadowm60 8d8e8ec260
Launch control - experimental (#1816)
* Update tachometer.cpp

Initial implementation of E30 M3 Tach output solution #907, unit_test plus debugging next

* tacho unit tests

First successfull unit test for tachometer

* RAM adjustment so it would link

* refactoring tacho, broken!

* starting to make some progress...still fails after a few seconds

* Rework with SW PWM

* Update after code review

* unit_test update

* First working unit_test

* Update .gitignore

* Update engine_controller.cpp

* Update engine_controller.cpp

* Update tachometer.h

* Update test_tacho.cpp

* Switched UART DMA on

* Revert "Switched UART DMA on"

This reverts commit 4a23974c43.

* enable launch control

make use of already existent code + integration

* Delete compile_frankenso_all.sh

remove it since it is not part of the project

* Update main_trigger_callback.cpp

broke unit_Tests

Co-authored-by: rusefi <rusefi@users.noreply.github.com>
2020-09-22 16:25:27 -04:00
rusefi 1657e499ce better QC procedure 2020-09-19 04:39:32 -04:00
Matthew Kennedy 95798a5246
fix broken master, inject engine ptr to rpmcalculator (#1759)
* fix

* oops
2020-09-05 18:49:42 -04:00
rusefi ca21d5b4c2 refactoring 2020-09-03 19:29:15 -04:00
rusefi c32c8d715d A vague bug #1684 2020-08-08 20:57:42 -04:00
rusefi 1ba4dd0dcc A vague bug #1684 2020-08-08 20:36:16 -04:00
Matthew Kennedy 5b99fdf3df deprecate 2020-07-28 12:13:55 -07:00
Matthew Kennedy 626f55a08a refacto 2020-07-24 18:26:24 -07:00
Matthew Kennedy 131f4c4e8f Merge remote-tracking branch 'upstream/master' into reset-overlap 2020-07-20 18:43:17 -07:00
rusefi 48cc155144 changing crazy in composite logger 2020-07-20 21:20:58 -04:00
Matthew Kennedy dc05efef61 Merge remote-tracking branch 'upstream/master' into reset-overlap 2020-07-20 14:53:59 -07:00
rusefi c34a0d95d7 unit test framework improvements for smoother event execution 2020-07-20 17:13:33 -04:00
Matthew Kennedy 8b0d6a26cf Merge remote-tracking branch 'upstream/master' into reset-overlap 2020-07-20 13:27:51 -07:00