Commit Graph

1630 Commits

Author SHA1 Message Date
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
Scott Smith c354d30a71 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 b545743f7d Not all launch control options are used #3554 2021-11-15 21:13:01 -05:00
Andrey 7b790d36f6 random refactoring: trigger central encapsulation 2021-11-15 20:22:05 -05:00
Andrey 837cdf2cfb refactoring launch 2021-11-15 19:55:04 -05:00
Scott Smith d09166d439 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 bc3befd0ac refactoring launch 2021-11-15 18:57:12 -05:00
Andrey bafd5e0e17 refactoring launch 2021-11-15 14:40:35 -05:00
Matthew Kennedy c1941f3a49 (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 bd04dc8352 less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
GitHub build-unit-tests Action 56a5b4ac78 Trigger wheel definitions 2021-11-14 23:14:04 +00:00
rusefi 468cc07811 Lua: changing "table" API 2021-11-14 16:44:52 -05:00
rusefillc 5f1aadf638 Epic: Remove FSIO #2928 2021-11-14 10:39:47 -05:00
rusefillc 94320910e9 Epic: Remove FSIO #2928 2021-11-14 07:30:26 -05:00
GitHub build-unit-tests Action 54ebe6bd21 Trigger wheel definitions 2021-11-14 03:05:33 +00:00
Matthew Kennedy 31848f5bf4 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 baf11a27b9 load lua libs correctly (#3529)
* fix lua lib loading

* test
2021-11-11 13:44:13 -05:00
Scott Smith 93d31c6c9b 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 aec887efc8 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 1a299a3221 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 76f9840dc1 MathMin 2021-11-10 19:23:05 -05:00
Matthew Kennedy 26749e0384 test TS writes (#3515)
* test TS writes

* s

* this must be a gcc extension
2021-11-10 07:29:40 -05:00
Scott Smith 9b40e68155 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 7367aa5b8a 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 8639b7c7e4 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 2166a5ba16 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 3d7bc6d422 refactoring: assigning etbFunctions earlier 2021-11-08 12:39:41 -05:00
Andrey fdcce9558e WITH_ENGINE_TEST_HELPER_BOARD_CALLBACK 2021-11-08 12:27:02 -05:00
Andrey 49d4dea65e lua pid class #3411 2021-11-07 09:53:40 -05:00
Matthew Kennedy 8124c2a12d unit test build times (#3489)
* don't emit assembly listings

* more

* extract coverage

* link coverage
2021-11-06 21:20:24 -04:00
Andrey e3355ab2d3 Remove Miata MX5 NB1 trigger #3488 2021-11-06 20:24:41 -04:00
GitHub build-unit-tests Action e8f7dd7546 Trigger wheel definitions 2021-11-05 22:25:35 +00:00
Matthew Kennedy 72cdc52acc configurable etb maximum (#3469)
* etb maximum

* update tests and test new behavior
2021-11-05 18:16:19 -04:00
Scott Smith fcac26c032 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 818e0057c9 lua curve progress 2021-11-05 16:08:48 -04:00
rusefillc 57dc9b36f4 lua curve progress 2021-11-05 10:34:12 -04:00
GitHub build-unit-tests Action 21952f5eba Trigger wheel definitions 2021-11-05 11:24:12 +00:00
Matthew Kennedy a2766e5d9b 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 52bd7a9cb7 lua interpolate 2021-11-02 23:35:48 -04:00
Matthew Kennedy 4717210859 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 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
GitHub build-unit-tests Action 68a7efe8fa Trigger wheel definitions 2021-10-31 01:43:02 +00:00
rusefillc 45cc772739 small step back 2021-10-30 20:52:10 -04:00
Matthew Kennedy 292120b8dc 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 3d2e5be370 Override trigger gaps feature #2734 2021-10-30 11:09:10 -04:00
rusefillc 6a504e0755 Revert "lua pid class #3411"
This reverts commit 02bbe16170.
2021-10-28 23:41:23 -04:00
rusefillc 02bbe16170 lua pid class #3411 2021-10-28 23:35:53 -04:00
Andrey 29851fe219 export board-specific macro for stm32 pins based on board yaml #3298
meta progress
2021-10-26 10:27:10 -04:00
Andrey 1e1a71675e export board-specific macro for stm32 pins based on board yaml #3298
mre meta progress
2021-10-25 21:05:45 -04:00
Andrey 24a786be9a export board-specific macro for stm32 pins based on board yaml #3298
proteus meta progress
2021-10-25 17:36:21 -04:00