Commit Graph

920 Commits

Author SHA1 Message Date
Matthew Kennedy a342bee57e
rpm calculator refactoring, gm 24x test (#3585)
* data

* stub test

* use getTimeSinceSyncPoint

* s

* s

* no

* test

* stray ;

* those were 1/10 what they were supposed to be

* actually check something

* dead log line?
2021-11-20 14:59:02 +03:00
rusefillc f1900b4887 On -fpermissive in Windows in unit tests #3581 2021-11-20 00:23:27 -05:00
rusefillc e54d3b9e06 On -fpermissive in Windows in unit tests #3581 2021-11-20 00:16:03 -05:00
Scott Smith 5bc1949aef
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 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 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
rusefillc 17d4646dce spelling 2021-11-16 16:46:54 -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
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
Andrey 0cc88ec6e2 Not all launch control options are used #3554 2021-11-15 21:13:01 -05:00
Andrey 05fa6071dd refactoring launch 2021-11-15 19:55:04 -05:00
Scott Smith 7011be6f86
Test for stack use after free in ASAN. (#3552)
Fix two cases that didn't affect the product, but did affect our ability to test.
2021-11-15 19:44:39 -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 cb032fb1ea
(void) -> () (#3550)
* static functions with (void)

* more

* Revert "more"

This reverts commit 246e53441f935451437df186ac92d7df26b62fb6.

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-15 13:02:34 +01:00
Matthew Kennedy 145316c497
less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
rusefi a5764d6e67 Lua: changing "table" API 2021-11-14 16:44:52 -05:00
rusefillc c22215cea7 Epic: Remove FSIO #2928 2021-11-14 10:39:47 -05:00
rusefillc a85d1bb064 Epic: Remove FSIO #2928 2021-11-14 07:30:26 -05:00
Matthew Kennedy 73b05d2e20
lua pid class (#3411)
* lua pid

* no luaaa stl

* update luaaa

* finality

* luaaa

* luaaa

* = default

* bad merge

* gitmodules

* lua

* proteus demo script

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-13 03:18:16 -05:00
Matthew Kennedy 57ad75aa98
load lua libs correctly (#3529)
* fix lua lib loading

* test
2021-11-11 13:44:13 -05:00
Scott Smith 713083baa5
Convert TriggerWaveform::wave to a pointer in preparation for code-defined sequences. (#3528)
It will eventually be class to support dynamic universal patterns in addition to ROM-based
tables.
2021-11-11 13:19:25 -05:00
Scott Smith 2f4d123052
Change users of MultiChannelStateSequence to use the API (#3524)
Better than reaching into members that should be private. I didn't feel like actually making
them private though, as one user validates pinStates isn't NULL.
2021-11-11 09:19:22 -05:00
Scott Smith d4c4db9a12
Move phaseCount into MultiChannelStateSequence (#3520)
We can them drop the field from a bunch of callers, simplifying the code.
2021-11-10 19:47:27 -05:00
rusefi 72a2bdba66 MathMin 2021-11-10 19:23:05 -05:00
Matthew Kennedy 3f2a9c3fe8
test TS writes (#3515)
* test TS writes

* s

* this must be a gcc extension
2021-11-10 07:29:40 -05:00
Scott Smith 158f719d95
Save ~2800 bytes of RAM by not caching angle->trigger mapping (#3506)
Memory seems more valuable than CPU; use the O(lg n) lookup by angle.  A side effect is that it
seems to fix trigger lookup for the second phase of TRIGGERTYPE 53 544 TT_TRI _TACH 0.00
2021-11-09 07:03:27 -05:00
Scott Smith 37da55c920
Compile each project's PCH to a separate file to reduce developer friction. (#3505)
Having to remove the precompiled header when switching from firmware to simulator to unit_tests and
back again is annoying.  Use a directory to store the precompiled header output.  Turn off
precompiled header warnings as GCC still complains even if it finds a valid one eventually.
2021-11-08 15:52:58 -05:00
Scott Smith 13c496b79b
Make getTimeNowNt even faster (#3504)
The last version is already much better than the original, mostly because it doesn't call
CriticalSectionLocker, which has a ton of overhead due to debug tracking.  But this version is
another 4 instructions / 12 bytes shorter.  Does as much match in 32-bit land as possible, and
avoids math operations that span 64-bits (i.e. either operate on the lower half or upper half, but
not both).  The result is only 3 instructions not including the necessary 4 loads (ptr to now, now,
ptr to upper, upper), 1 store (upper), and 1 return/branch.
2021-11-08 14:24:31 -05:00
Andrey 2c715be4b7 ETB: do not touch HW pins if function not selected, this way Lua can use DC motor hardware pins directly 2021-11-08 12:44:37 -05:00
Andrey 8a963633d3 refactoring: assigning etbFunctions earlier 2021-11-08 12:39:41 -05:00
Andrey 1b0d48d8c0 WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK 2021-11-08 12:27:02 -05:00
Andrey 9b0f617664 lua pid class #3411 2021-11-07 09:53:40 -05:00
Andrey 6111355e6c Remove Miata MX5 NB1 trigger #3488 2021-11-06 20:24:41 -04:00
Matthew Kennedy 3348c0404b
configurable etb maximum (#3469)
* etb maximum

* update tests and test new behavior
2021-11-05 18:16:19 -04:00
Scott Smith 6d38fe1eb3
Allow scaled_channel to have both multiplier and divisor (#3468)
Disallow scaled_channel for float.  I can't think of a reason to allow it, and it gets in the way
of rounding.

Add separate template param to setTable; let the compiler sort out whether assignment can happen
between TElement and VElement without forcing them to be the same at function call time.
2021-11-05 17:34:22 -04:00
Andrey f6a20ca1ea lua curve progress 2021-11-05 16:08:48 -04:00
Matthew Kennedy 24224729a3
support autoscale on table axes (#3452)
* scale map Y axis

* allow different row/col types

* scaled channel detector

* interpolation

* looks like this actually works

* tests, no manual scaling

* comment
2021-11-03 19:53:26 -04:00
Andrey 44fa9b028b lua interpolate 2021-11-02 23:35:48 -04:00
Matthew Kennedy 980a7cc833
autoscale fields in generated structs (#3444)
* add to grammar

* parser

* parser

* example consumer

* build config tool

* commit the right jar
2021-11-02 18:59:19 -04:00
Matthew Kennedy 75a2b5ef02
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
Matthew Kennedy 29ec0a5859
better pch usage and gmock constructors (#3426)
* break out mock constructors

* comment and spacing

* unnecessary compiler options

* happy stepper

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-30 20:31:09 -04:00
rusefillc d5de11bcc1 Override trigger gaps feature #2734 2021-10-30 11:09:10 -04:00
rusefillc 64ecbb16ab Revert "lua pid class #3411"
This reverts commit dde80bb900.
2021-10-28 23:41:23 -04:00
rusefillc dde80bb900 lua pid class #3411 2021-10-28 23:35:53 -04:00
rusefillc bf7ae2c76e generate java enum from C enum? generate both C and java from yaml? #2102 2021-10-24 13:10:38 -04:00
rusefillc b7601e063f generate java enum from C enum? generate both C and java from yaml? #2102 2021-10-24 11:40:47 -04:00
Matthew Kennedy 383d8caad9
Lua CAN RX (#3403)
* wiring

* static

* implementation

* comment

* unit tests happy

* guard

* guard smarter, not harder

* guard smarter not harder

* guard even smarter, not even harder

* don't need that
2021-10-24 08:37:04 -04:00
Matthew Kennedy 8a841bb52c
lua can set sensors (#3389)
* add sensor unsubscribe

* sensor hook

* test it!

* virtual destructor makes us sad

* ensure deinit
2021-10-22 16:36:29 -04:00
Andrey b750755369 findSensorTypeByName 2021-10-21 14:33:59 -04:00
Andrey 37594d5646 findSensorTypeByName 2021-10-20 22:21:42 -04:00
rusefillc eb05f4594e very old very dead code 2021-10-20 12:57:07 -04:00
rusefillc 1493973bea very old very dead code 2021-10-20 10:38:36 -04:00
Matthew Kennedy e4c34e016a
last packet optimization (#3363)
* last packet optimization

* comment

* test

* missed one

* set tcp mss
2021-10-18 19:59:08 -04:00
Andreika bc4a068c9c
[DRAFT] IAC H-Bridge Microstepping (#3213)
* fix for stepperHbridgeHardware

* new config fields for microstepping

* add stepper dir pin mode to the dialog

* refactor stepper hw dialog & add microstepping panel

* microstepper modes enum

* stepperDcInvertedPins needed by Hellen

* add sleep() for stepper and divisor for pause()

* microstepping impl.

* make unit-tests more happy

* small progress

* fix etb-stepper dlg conflict

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2021-10-06 13:57:04 -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
Matthew Kennedy db12cdbe19
put MAP in the sensor model (#3292)
* map averaging in sensor model

* deadly, deadly code!

* mpxh

* Revert "deadly, deadly code!"

This reverts commit 346fe25267966a313145a809792dced84be348cf.

* comments

* sensor types

* last sensor

* channel init

* correct spot

* deinit properly

* simplify

* fix

* mocks

* map init test

* showInfo

* comment

* singleton identity function

* sensor info print

* multiple cylinder averaging buffer

* comments

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-04 17:18:08 -04:00
rusefillc 77ebc71f9a
overdwell protection #3071 (#3294) 2021-10-02 01:17:53 -04:00
Matthew Kennedy 0a550a70b1
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
Andrey 13d21716db reducing crazy in unit tests 2021-10-02 00:13:15 -04:00
Andrey 097e871b19 reducing crazy in unit tests 2021-10-02 00:00:08 -04:00
Andrey 3da054c6e7 reducing crazy in unit tests 2021-10-01 23:53:22 -04:00
Andrey d478c9c411 reducing crazy in unit tests 2021-10-01 22:33:06 -04:00
Andrey b71d3c6111 reducing crazy in unit tests 2021-10-01 22:29:44 -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
Matthew Kennedy f41a2715a3
system lua: load a script! (#3231)
* load script

* test

* needs more rams

* embiggen stack

* init system lua from lua thread

* de-embiggen stack

* system needs a little more

* memory

* om nom nom delicious memory

* how much more memory could it want

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-09-23 21:45:14 -04:00
Matthew Kennedy b5bde5c307
Turbo sensor (#3245)
* outputs rpm

* no msg param necessary

* new sensor type

* happy test
2021-09-20 15:39:41 -04:00
alxrMironov bb341c4c07
Turbo speed sensor implementation #2935 (#3209)
* Add turbocharger speed converter class

* Add turbocharger speed converter tests

* Add turbocharger speed sensor initialization functions

* Add turbocharger speed sensor to initialization

Co-authored-by: alxrMironov <330OMcorporative>
Co-authored-by: rusefillc <48498823+rusefillc@users.noreply.github.com>
2021-09-19 20:50:11 -04:00
rusefi 6307ffd3a6 merc128: engine config defaults #3236 2021-09-18 22:12:22 -04:00
rusefillc 3e50319eb7 merc128: engine config defaults #3236 2021-09-18 21:27:17 -04:00
rusefillc 847fb75a23 TS channel names for nicer console messages 2021-09-18 15:33:14 -04:00
Matthew Kennedy c72bd07179
enable address sanitizer (#3217)
* enable asan

* lua

* this is dead and leaky

* leaky nissan

* fix pwm generator use-after-stack

* initializers

* prevent problems in case of invalid trigger shape

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-09-05 05:56:59 -04:00
rusefillc 427cce7596
Lua timer (#3218)
* Lua: Timer class #3159

* Lua: Timer class #3159

* Lua: Timer class #3159

* Lua: Timer class #3159

* lua timer is happy (#3216)

* hooks are happy

* don't need that any more

* format

* update lib

* module

Co-authored-by: rusefillc <sdfsdfqsf2334234234>
Co-authored-by: Matthew Kennedy <matthewkennedy@outlook.com>
2021-09-03 20:21:39 -04:00
Matthew Kennedy 730b26d034
remove old vss implementation (#3208)
* dead vss

* remove
2021-08-28 01:39:55 -04:00
Matthew Kennedy 6407e74ae2
disable closed loop boost below MAP threshold (#3206)
* boost minimum map

* changelog
2021-08-27 17:54:08 -04:00
Matthew Kennedy cf5d4cbe1c
add & test remove from linked list (#3199) 2021-08-26 23:03:09 +03:00
Matthew Kennedy a18b86a09b
start allowing ADC change while running (#3100)
* allow re-register of the same sensor

* add api to unsubscribe

* do it for tps

* clear the pin

* happy test

* maybe make afr happy for now

* tests build

* happy simulator

* active configuration

* check valid

* we need vbatt now

* manage all pin init in init_sensors.cpp

* don't need that

* cleanup

* thermistors

* do two phase reinit in the right place

* config vs engine

* finally the tests are happy
2021-08-24 16:41:16 -04:00
alxrMironov f926d2ccba
Vehicle speed switching to frequency sensor #3106 (#3148)
* Add vehicle_speed_converter.h with realization.

* Add test_vehicle_speed_converter.cpp with realization.

* Add test_vehicle_speed_converter.cpp to Makefile

* Edit "VehicleSpeedSensor" from function pointer sensor to frequency sensor

* Fix "VehicleSpeedSensor" init function args

* Remove "VehicleSpeedConverter" empty constructor

* Edit vehicle_speed_converter.h code style

* Fix args and engine injection in "VehicleSpeedSensor" initialization procedure

* Remove old "Vehicle Speed" module initialization

* Revert "Remove old "Vehicle Speed" module initialization"

This reverts commit 100b7caa8c615c20eed3d0c23a49824b4e556148.

* Remove old "Vehicle Speed" module initialization pieces

* Revert "Revert "Remove old "Vehicle Speed" module initialization""

This reverts commit f559a726f1f7f5a7acacd1b6517e571743e84327.

* Debug changes

* Revert "Debug changes"

This reverts commit f7e2be1a8a46c6f3f93f14f002b2f2db539da8e2.

* Another debug changes

* More debug changes

* And more debug changes.

* Revert "Another debug changes"

This reverts commit 914fbb1df42c37e4b5ecbb119bb45e7cffdf4064.

* Revert "More debug changes"

This reverts commit 0b2d96d461c3cd9b0f1ae97ed110b8effe6b0cc6.

* Revert "And more debug changes."

This reverts commit 06ae8daded0e6e1c025e4e5058b47283f4adfe92.

* Add "Vehicle Speed" sensor reconfiguration

* Revert "Add "Vehicle Speed" sensor reconfiguration"

This reverts commit a089a6d563dd710004ce1a7da1744b0b4b90c3b1.

* Revert "Revert "Add "Vehicle Speed" sensor reconfiguration""

This reverts commit 7b2bb8af4b3caa547236ca59e4c4bdb3ac1200cc.

* Debug changes

* Another debug changes

* Fix another debug changes

* Another debug changes 2

* Revert "Another debug changes 2"

This reverts commit cfad55141eec125b2f1d35fb95d9f46b54f666b6.

* Revert "Fix another debug changes"

This reverts commit 9bc2c74a3be6fd896827ff48cf4580e7657529c0.

* Revert "Another debug changes"

This reverts commit 4337ed8cad8dff508d093944eb3f75e9a69e4a77.

* Edit class  FrequencySensor, make it more RAII

* Debug changes

* Debug changes 2

* Debug changes 3

* Revert "Debug changes 3"

This reverts commit 52a7054c122b5157540fe45a055a84b57478d722.

* Revert "Debug changes 2"

This reverts commit dec79fb913344ccb4b8614910ad62e6c129a243e.

* Revert "Debug changes"

This reverts commit eb08d7a529b55ba397a7dd2c154b76eab42f212b.

* Revert "Edit class  FrequencySensor, make it more RAII"

This reverts commit 3a0bb1d3f1dd23c1b04e4cc1c526cfdc67ae86a3.

* Remove VSS pin definition in "Citroen Berlingo" engine config.

This reverts commit 3a0bb1d3f1dd23c1b04e4cc1c526cfdc67ae86a3.

* Remove VSS pin definition in "Dodge Neon" engine config

Co-authored-by: alxrMironov <330OMcorporative>
2021-08-24 00:55:41 -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 86e4664b2d dead idle FSIO 2021-08-12 18:28:55 -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
Matthew Kennedy 90a0e47b04
skip etb init if no primary sensor (#3136)
* skip init if no primary sensor

* specific test
2021-08-12 00:45:44 +03:00
Andrey 0df437e749 Nissan 4 cylinder QR trigger wheel #3118 2021-08-08 07:04:18 -04:00
Matthew Kennedy d24f1462e2
even more pch (#3112)
* s

* more

* s

* f7
2021-08-04 19:30:52 -04:00
Matthew Kennedy 5ff7235040
don't "validate instant RPM" (#3095)
* don't "validate instant RPM"

* test actually tests the right thing

* test mode transition
2021-08-04 08:17:14 +03:00
Matthew Kennedy 25414ebdad
yet more pch (#3068)
* big pch energy

* put back ramdisk stub

* tests are happy

* h743 nucleo

* kinetis

* I love deleting code!

* make stepper happy

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-08-03 22:05:01 -04:00
Andrey 75f27c6cbc unit test for vehicle_speed.cpp fix #3081 2021-08-03 19:54:11 -04:00
alxrMironov 6d12533120
Unit tests for vehicle speed.cpp #3081 (#3103)
* Add test_vehicle_speed.cpp

* Add test_vehicle_speed.cpp to makefile

* Add tests for vehicle_speed.cpp

* Enable vehicle_speed.cpp testing

* Edit make some constants explicit and format code style

* Revert "Enable vehicle_speed.cpp testing"

This reverts commit bcba5219a1d69fb3375e33c7fcb97abffc190a75.

* Remove verbose variables

* Remove dead code strings

* Fix tests coupling by setMockVehicleSpeed

Co-authored-by: alxrMironov <330OMcorporative>
2021-08-03 19:49:16 -04:00
Andrey 8fe2d99254 unit test for vehicle_speed.cpp #3081 2021-08-03 19:48:24 -04:00
Matthew Kennedy a8eddbccf6
perform extra-step-prevention in the stepper driver itself (#3038)
* perform extra-step-prevention in the stepper driver itself

* isBusy flag

* I am unable to type

* the court of public opinion has decided that greater-equal is correct

* that sets target in steps, not percent

* correct var name

* mock stepper motor

* testable stepper

* build is happy

* helping build
2021-08-02 07:03:57 -04:00
Matthew Kennedy f16173b4dd
call handleShaftSignal (#3097) 2021-08-02 07:02:45 -04:00
Matthew Kennedy fcd6c3d520
fix the mess (#3094)
* test

* s
2021-08-01 23:21:53 -04:00
alxrMironov 6f96887d74
Unit test for flex sensor.cpp #3091 (#3093)
* Add test_flex_sensor.cpp

* Add test_flex_sensor.cpp to makefile

* Edit test_flex_sensor.cpp code formatting

* Fix test case name in test_flex_sensor.cpp

* Remove explicitly defined constructor of "FlexSensorForTests" class

* Edit included headers replaced by single one in test_flex_sensor.cpp

* Edit format to make similar to other files.

Co-authored-by: alxrMironov <330OMcorporative>
2021-08-01 22:14:01 -04:00
Matthew Kennedy 4aaee01a26
remove some noise from nb2 trigger log (#3078) 2021-07-30 08:19:16 -04:00
Matthew Kennedy 0d983855b9
instant rpm uses full engine cycle (#3077)
* instant rpm uses full engine cycle

* turn off fast spinup for this test
2021-07-30 08:18:24 -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 bd599ab374
cleanup for pch (#3062)
* cleanup

* d
2021-07-25 20:43:02 -04:00
Matthew Kennedy f6095b8339
fix nonlinear correction threshold (#3060)
* s

* macro

* test has to do the inverse
2021-07-25 20:42:26 -04:00
Andrey 2495713af6 Clutch switch inverted options do not invert detected pedal position
#3545
2021-07-24 19:49:23 -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 23842bf143
safer NB2 progress (#3041)
* safer NB2 progress

* one step back
2021-07-23 16:43:24 -04:00
Andrey 6fc693aea2 VVT position of first cam is off on first cycle fix #2987 2021-07-22 01:02:37 -04:00
Andrey 7db8bc816e Nissan VVT trigger decoder #2887 2021-07-21 23:26:40 -04:00
Andrey 783fd70cce Nissan VVT trigger decoder #2887 2021-07-21 23:24:23 -04:00
Andrey 24cfbeba35 Nissan VVT trigger decoder #2887 2021-07-21 23:08:56 -04:00
rusefillc 07d32a9e80 Nissan VVT trigger decoder #2887 2021-07-21 22:41:37 -04:00
rusefi dba7a333f8 nissan logic cranking 2021-07-21 21:58:00 -04:00
Matthew Kennedy d520d12490
adjust nb2 vvt sync (#3019)
* test existing implementation

* nb2 vvt pattern sync

* update test
2021-07-21 20:07:28 -04:00
Matthew Kennedy 4b95262a5d
simplify quad vvt test (#3018)
* use single tooth in quad cam test

* mod == remainder

* now the test works without changes
2021-07-21 18:48:05 -04:00
Matthew Kennedy b9f141256a
test existing implementation (#3017) 2021-07-21 17:48:37 -04:00
Matthew Kennedy 0f0b84a6db
remove TS file read (#3004)
* remove

* more defines

* test

* lots of java

* s
2021-07-21 14:24:53 -04:00
Matthew Kennedy 5f3464b204
Fix prepareEventAngles for symmetrical crank triggers (#2982)
* fix and make code legible

* update test to check every tooth

* symmetrical crank

* simplify findTriggerPosition

* make getAngle intelligable
2021-07-17 23:27:20 -04:00
Andrey b161a26956 NB2 trigger shape does not seem to match JimStim #2980
only first steps of unit test
2021-07-17 19:43:17 -04:00
Andrey 9345e5d2e0 NB2 trigger shape does not seem to match JimStim #2980
only first steps of unit test
2021-07-17 17:47:32 -04:00
Andrey 0d8fd6f271 kaiju is asking for vq30de trigger wheel decoder #2974 2021-07-17 00:46:39 -04:00
Matthew Kennedy a62d6743bc
lua hooks for CAN tx (#2967)
* CanTxMessage usable from unit test

* testLuaReturnsNil

* CAN hook and tests

* it helps if parameter names exist

* nameless params

* s

* redefinition of default argument

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-16 14:06:26 -04:00
Andrey 03bb3e3ace trigger signal debug pins - logic level output #2959
test driven development is still amazing
2021-07-15 09:29:14 -04:00
Andrey 7486f5f040 trigger signal debug pins - logic level output #2959 2021-07-15 00:34:22 -04:00
Andrey e721c1768f trigger signal debug pins - logic level output #2959 2021-07-14 22:51:08 -04:00
Andrey 27350dbad8 FATAL on NB2 tune jim stim input signal #2965 2021-07-14 16:47:55 -04:00
Andrey e1c41ff798 FATAL on NB2 tune jim stim input signal #2965 2021-07-14 16:03:00 -04:00
Andrey 4750aa2efa cute example of a bug which only macoc unit test fails to compile 2021-07-13 18:15:22 -04:00
Andrey e1b6b405eb NB2 hellen-72-rev-d something is off #2958 2021-07-13 15:04:30 -04:00
Andrey 7fd2e8275f NB2 hellen-72-rev-d something is off #2958 2021-07-13 14:39:21 -04:00
Andrey 174e12b281 NB2 hellen-72-rev-d something is off #2958 2021-07-13 14:24:47 -04:00
rusefillc 1a72390d37 NB2 hellen-72-rev-d something is off #2958
export as is
2021-07-13 14:07:55 -04:00
rusefillc acc4882f06 NB2 hellen-72-rev-d something is off #2958
export as is
2021-07-13 13:27:47 -04:00
Andrey 774bcaa5ef it's spelled 'resources' :( 2021-07-13 12:36:50 -04:00
Andrey f33862f537 it's spelled 'resources' :( 2021-07-13 12:35:43 -04:00
rusefi b3c076dae7 NB2 hellen-72-rev-d something is off #2958 2021-07-13 11:57:18 -04:00
Matthew Kennedy aef0732509
fix vvt indication (#2926)
* wrap logic

* rename gauges

* names and ranges

* binary log

* we actually don't need that warning

* values auto wrap

* values auto wrap

* bye warnings

* comparison
2021-07-12 16:29:07 -04:00
Matthew Kennedy 86683afca2
trailing spark scheduling (#2932)
* enable bit

* implement trailing sparks

* test trailing spark

* it helps to call the correct function

* add pins

* gobblin ram
2021-07-09 08:37:46 -04:00
Andrey 9dfc066bce restore testQuadCam #2911 2021-07-08 00:11:54 -04:00
Andrey 0aa8693f21 Matt has CUSTOM_ERR_VVT_OUT_OF_RANGE warning #2921 2021-07-07 23:55:49 -04:00
Matthew Kennedy d10ba3ddfa
injector nonlinearity (#2916)
* nonlinear polynomial

* make existing tests work again

* test that nonlinearity is called

* s

* fix enum

* ui

* fix and test

* comment

* changeloggy
2021-07-07 23:46:44 -04:00
Matthew Kennedy 5e08907590
knock sensing peak detect (#2910)
* knock peak detect

* comments

* comment

* initialize

* test

* fix warnings while we're here

* those are functions, not values

* ram
2021-07-06 21:44:59 -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
Andrey 70424ac7b5 Nissan VVT trigger decoder #2887
another bug - improper handling of three-times-symmetrical
2021-07-05 23:15:44 -04:00
Andrey 2e9e5c2745 Nissan VVT trigger decoder #2887
that looks like one bug
2021-07-05 22:50:44 -04:00
Andrey 1b174bd4b3 Nissan VVT trigger decoder #2887
that's all very strange
2021-07-05 22:17:26 -04:00
Andrey 064c1612e3 restore testQuadCam #2911 2021-07-05 21:04:09 -04:00
Andrey 7cd5ea855c restore testQuadCam #2911 2021-07-05 20:56:24 -04:00
Matthew Kennedy 3574de1da3
shard unit tests (#2906)
* scripts

* it found problems!

* off by one

* call bash maybe?
2021-07-04 22:28:31 -04:00
Matthew Kennedy 992570f322
explicitly set mock vss to test (#2905) 2021-07-04 17:52:45 -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
Andrey b67b1f424f Nissan VVT trigger decoder fix #2887
TDD is amazing we are done here!
2021-07-03 12:43:01 -04:00
Andrey 0cf095a943 Nissan VVT trigger decoder #2887 2021-07-03 12:02:00 -04:00
Andrey 23e7022e55 Nissan VVT trigger decoder #2887 2021-07-03 11:08:22 -04:00
Andrey f5e937fe2b refactoring: getShaftSynchronized 2021-07-03 10:37:03 -04:00
Andrey 152eea43b1 Nissan VVT trigger decoder #2887 2021-07-03 10:15:41 -04:00
Andrey 0d5098e0a9 Nissan VVT trigger decoder #2887 2021-07-03 09:43:54 -04:00
Andrey e5a1b68eb2 Nissan VVT trigger decoder #2887 2021-07-02 20:28:15 -04:00
Andrey 1660a5b3fd Nissan progress 2021-07-02 19:57:26 -04:00
Andrey e7d7d79f13 Nissan progress 2021-07-02 19:23:52 -04:00
Andrey 0d7c0a7f50 Nissan progress 2021-07-02 18:33:32 -04:00
Andrey d18d4496d1 Nissan progress 2021-07-02 17:32:45 -04:00
Andrey bd5ff4b5a5 Nissan progress 2021-07-02 16:31:10 -04:00
Andrey a9e7166f74 Nissan progress 2021-07-02 14:56:12 -04:00
Matthew Kennedy 025c32de00
Stricter miata sync (#2891)
* strict mazda trigger shape

* this is an even better gap

* sync point moved so things are different now

* fix

* update instantrpm in test

* s

* s

* this is safer

* test

* tests

* instant rpm

* cleanup
2021-07-01 21:29:04 -04:00
Matthew Kennedy 8569f028d6
Fix pre sync timestamp copy (#2892)
* fix tests

* fix pre sync copy

* this fixes the issue
2021-07-01 18:58:28 -04:00
Matthew Kennedy 2a85bfc73f
test multiple starts (#2888)
* test

* pi

* typo

* private

* test short gap too

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-01 17:29:31 -04:00
Matthew Kennedy 1bca4843fe
test dc_motor.cpp (#2890)
* use ipwm where possible

* mock ipwm

* initialize

* test
2021-07-01 09:21:18 -04:00
Matthew Kennedy 35ad1b7d89
fix instant rpm (#2886)
* fix instant rpm

* this is what it should look like!

* warning

* comment issue link

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-01 09:19:16 -04:00
Matthew Kennedy c171d5f1d3
not const getAirmass (#2883)
* not const

* test
2021-07-01 00:05:42 -04:00
Matthew Kennedy 942f23a6b3
aggressively test rpm calculator (#2884)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-01 00:05:24 -04:00
Matthew Kennedy 32f5ce6fb4
no fan if stopped engine (#2822)
* no fan if stopped engine

* config

* use config

* more tests

* merge

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-28 08:52:54 -04:00
Matthew Kennedy cd5eb6a77c
Move AC logic out of FSIO (#2872)
* new impl

* remove fsio

* inject "is ac active" to fan

* include the correct code

* include

* test

* more AC features

* AC switch vs. actual AC indicators

* include

* duh
2021-06-27 18:51:34 -04:00
Andrey fcc97fb9a6 VW warnings on cranking #2861 2021-06-27 13:01:56 -04:00
Andrey f6b003820c more minimal version of fix trigger replay #2874 2021-06-27 11:38:42 -04:00
Andrey 8696ea4890 crankDivider is asking for a new unit test 2021-06-27 00:51:14 -04:00
Andrey 7c7766efcc VW warnings on cranking #2861 2021-06-26 16:05:43 -04:00
Andrey c6d0d88465 VW warnings on cranking #2861 2021-06-26 01:37:55 -04:00
rusefillc 8a2564aaef VW warnings on cranking #2861 2021-06-26 01:31:50 -04:00
Andrey 6dbc40e990 VW warnings on cranking #2861 2021-06-26 00:51:09 -04:00
Andrey 78dd28467d progress 2021-06-26 00:33:28 -04:00
rusefillc 6a00036983 VW warnings on cranking #2861 2021-06-25 22:24:41 -04:00
rusefillc 0af5de0934
Minor change of Miata NA trigger shape #2855 #669 (#2856)
* Minor change of Miata NA trigger shape #2855 #669

* Minor change of Miata NA trigger shape #2855 #669
2021-06-25 14:12:18 -04:00
Andrey 942eb46471 Trigger: warning code on normal engine start up #669
better TDC unit test approach?
2021-06-25 13:19:16 -04:00
Andrey dbea1e23a0 Trigger: warning code on normal engine start up #669
better TDC unit test approach?
2021-06-25 13:02:37 -04:00
Andrey f04cb1ceac Trigger: warning code on normal engine start up #669 2021-06-25 01:43:15 -04:00
Andrey 71fdfe6756 giving unit tests a chance to use tdcMarkCallback 2021-06-25 01:31:53 -04:00
Andrey 76840d07db better test coverage 2021-06-24 23:38:16 -04:00
Andrey a39920b68e refactoring - better entity names 2021-06-24 23:19:31 -04:00
Andrey 8d17e0576c docs 2021-06-24 23:12:16 -04:00
Andrey 175eea0a96 raw files #669 2021-06-24 22:39:00 -04:00
Andrey 3092164e48 Minor change of Miata NA trigger shape #2855 #669 2021-06-24 22:21:30 -04:00
Andrey 461132d993 Trigger: warning code on normal engine start up #669 2021-06-24 21:58:40 -04:00
Matthew Kennedy 7eb3b9890d
misc threading/safety improvements (#2854)
* allow termination of thread controller

* no gpio if fatal

* stub for test
2021-06-24 20:18:23 -04:00
Andrey 6ca965d246 Trigger: warning code on normal engine start up #669 2021-06-23 11:32:06 -04:00
Andrey 1c48a61339 refactoring 2021-06-23 06:37:32 -04:00
Andrey a57d7c48fb global static not good, there shall be only one god object /s 2021-06-23 06:10:27 -04:00
Andrey 74c5a80cac Trigger: warning code on normal engine start up #669 2021-06-23 05:22:08 -04:00
rusefillc a222a3961a one can dream about a well defined framework 2021-06-19 09:56:08 -04:00
Andrey 2c66d74c7e Trigger: warning code on normal engine start up #669 2021-06-18 22:52:01 -04:00