Commit Graph

166 Commits

Author SHA1 Message Date
rusefillc 26997ab9e3 why so many channels are hidden in debug ? #3614 2021-11-29 01:02:40 -05:00
rusefillc c75291f415 live data for wastegate #3588
i want to persist state so no 'const' sorry
2021-11-23 15:52:43 -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 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 62daac73c7
Use Valgrind to detect unitialized variable references. (#3555)
* Use Valgrind to detect unitialized variable references.

Fix the edge cases that pop up

* Comment and disable Mac run
2021-11-15 23:42:23 -05:00
Matthew Kennedy 145316c497
less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
rusefillc 2431fa79b3 refactoring - extracting idle state 2021-10-17 00:30:26 -04:00
rusefillc 4533ce4764 refactoring - extracting idle state 2021-10-16 23:55:29 -04:00
rusefillc ea87d9c9be Whatever we call it, no matter how we do it - we need live data / remote view into rusEFI actual state #3353
dead code
2021-10-14 15:17:09 -04:00
Andreika d917cc8cc2
[DRAFT] Fix cranking->idling taper phase for useSeparate*ForIdle tables (#3168)
* Rename Phase::CrankToRunTaper -> CrankToIdleTaper

* Change isIdling() to isIdlingOrTaper()

* test_idle_controller.cpp

* useSeparateIdleTablesForCrankingTaper setting

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2021-10-06 12:05:20 -04:00
Matthew Kennedy 9797d25b7c
getOrZero (#3319) 2021-10-05 19:59:07 -04:00
rusefillc 8fabcd15ab wow that was a bad setting name 2021-09-26 18:07:49 -04:00
Matthew Kennedy 730b26d034
remove old vss implementation (#3208)
* dead vss

* remove
2021-08-28 01:39:55 -04:00
Matthew Kennedy 2ad4a9df1e
actually remove FSIO idle stuff (#3150)
* debug mode

* pid cleanup

* more dead

* more dead

* wow more dead

* much dead many death wow
2021-08-14 09:48:45 +03:00
rusefillc e445d9724e dead idle FSIO 2021-08-14 01:48:03 -04:00
alxrMironov 7ebebd6922
Begin "vehicleSpeed" refactoring. Module switched to "FunctionalPointerSensor" class. #3106 #3107 #3108. (#3132)
* Add new sensor type "VehicleSpeed"

* Add "Vehicle speed" sensor to name list

* Add Vehicle speed sensor initialization with function pointer sensor.

* Add init_vehicle_speed_sensor.cpp to Makefile

* Replace dependencies from "getVehicleSpeed" to OOP-like "Sensor::get()"

* Add warning and TODO to "mock vehicle speed" call

* Replace get & mock "VehicleSpeed" methods in tests

* Remove #warning directive (cause error by current settings)

* Remove stray tab

* Remove explicitly type casting.

* Add "InitVehicleSpeedSensor" function declaration to init.h

* Add "VehicleSpeedSensor" initialization call into "InitNewSensors"

Co-authored-by: alxrMironov <330OMcorporative>
2021-08-12 22:16:51 +03:00
Andrey 511b5c22dd unit test for vehicle_speed.cpp #3081 2021-08-01 12:09:53 -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
Andrey eaeade5305 Clutch switch inverted options do not invert detected pedal position
#3044
2021-07-24 18:59:00 -04:00
Andrey 37247db383 Clutch switch inverted options do not invert detected pedal position
#3044
2021-07-24 18:44:13 -04:00
Matthew Kennedy 617c2886d9
adjust taper behavior (#3051)
* adjust taper behavior

* check that taper works in running state too
2021-07-24 16:12:07 -04:00
rusefillc ca34562d5d Clutch switch inverted options do not invert detected pedal position #3044 2021-07-24 15:54:51 -04:00
rusefillc 9c166d86fe Clutch switch inverted options do not invert detected pedal position #3044 2021-07-24 15:36:03 -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 a926357a01 making code more testable 2021-07-14 22:37:05 -04:00
Matthew Kennedy 5bd3ae3aaa
Disable closed loop idle during cranking->running taper (#2900)
* implement

* dead file?

* implement tests

* new phase
2021-07-06 08:47:06 -04:00
Matthew Kennedy 007a390f2b
Gate closed loop idle on road speed (#2901)
* implement

* test

* b

* config
2021-07-04 09:35:12 -04:00
Matthew Kennedy a4973a6f3d
fan/AC idle improvements (#2818)
* fan 2 open loop bump

* we had an AC target bump all this time?!

* format

* enable test

* I can't type
2021-06-15 17:30:35 -04:00
Matthew Kennedy 15d172ab08
apply open loop idle when in automatic mode (#2745)
* always apply open loop in closed loop

* simplify flags

* comment

* move

* comment

* missed one

* config for fan bump

* adjust miata defaults

* test fan/ac open loop

* idle CL tests

* test coasting

* test integration case

* fix merge

* put back reset logic for now

* s

* don't need that part

* I guess use OL as baseIdlePosition

* reset condition
2021-06-12 14:21:11 -04:00
Matthew Kennedy 3ef969d743
warnings & assorted cleanup (#2793)
* lua hook

* validateBuffer

* tables

* simplify fsio table

* test

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-03 14:30:25 -04:00
Matthew Kennedy f3c5ff6d54
idle fan/AC open loop bump (#2785)
* idle open loop ui section

* idle bump logic

* test fan/ac bump
2021-06-01 00:45:04 +03:00
Matthew Kennedy 39e4f70405
iac coast table (#2784) 2021-06-01 00:43:58 +03:00
Matthew Kennedy 7d773bfb1d
make the implementation match what the UI claims (#2779) 2021-05-31 07:37:02 -04:00
Matthew Kennedy a50f8e0077
Idle test that fails (#2781)
* make member func

* failing test
2021-05-31 06:18:15 -04:00
Matthew Kennedy d2f7e96747
code style (#2780) 2021-05-31 06:01:57 -04:00
Matthew Kennedy 13d2ee03bc
idle indicators (#2692)
* add coasting bit

* remove useless bit
2021-05-13 17:35:00 -04:00
Matthew Kennedy bd1c84fa62
Logging remove 3 (#2568)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

* vvt

* more

* idle

* missed one

* dynoview

* launch

* can

* console IO

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-20 14:09:41 -04:00
Matthew Kennedy 5145ee4b62
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
Matthew Kennedy 4a1d3de9a6
remove unused msg parameter (#2360)
* dead parameter

* last few
2021-02-16 09:32:16 -05:00
Matthew Kennedy 9f0ebaac49
Proteus analog input ci (#2271)
* test vbatt

* test proteus vbatt

* tolerance

* these don't work on proteus

* new engine type

* test analog input

* more test points, less tolerance

* console build needs this file generated

* only include for hw ci builds

* wiring info

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-03 13:34:48 -06:00
Matthew Kennedy bdacda558c
fix instant rpm (#2180)
* consumers

* impl

* instant rpm in idle timing
2021-01-14 20:45:55 -05:00
Matthew Kennedy 868f0d47ac
Enable idle timing/ve tables based on idle phase logic (#2213)
* add helper

* advance

* ve

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-11 00:54:37 -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
Matthew Kennedy 7a90692187
Idle timing uses phase logic, remove falloff (#2169)
* use phase computation

* move & simplify implementation

* test

* bad merge

* initialize

* wonderful changelog

* now unused parameter

* put back deadzone

* ui

* test deadzone

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-07 08:06:36 -05:00
rusefillc 46583b2a19 Revert "Idle timing PID uses phase logic (#2156)"
This reverts commit 9634a803
2020-12-31 12:22:54 -05:00
Matthew Kennedy 342414a5f7
show when idle is closed loop (#2160)
* show when idle is closed loop

* semicolon

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-30 08:42:40 -05:00
Matthew Kennedy 9634a803f1
Idle timing PID uses phase logic (#2156)
* use phase computation

* move & simplify implementation

* test

* bad merge

* initialize

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-29 23:50:56 -05:00