Commit Graph

1661 Commits

Author SHA1 Message Date
GitHub build-unit-tests Action 8d1231a588 Trigger wheel definitions 2021-11-25 23:54:51 +00:00
Andrey e2fa1af527 MAP phase sensing #3544 2021-11-24 22:36:36 -05:00
Andrey 58c0fb4539 MAP phase sensing #3544 2021-11-24 21:53:32 -05:00
Andrey 259e8744cb MAP phase sensing #3544 2021-11-24 21:53:16 -05:00
Matthew Kennedy 81fffe87b7
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
rusefillc c75291f415 live data for wastegate #3588
i want to persist state so no 'const' sorry
2021-11-23 15:52:43 -05:00
rusefillc 50ccf1fbea harley 2021-11-22 19:16:57 -05:00
Matthew Kennedy 3334a6963c
oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -05:00
rusefillc 42da5746f4 j1850 SAE crc8 Lua 2021-11-22 14:19:19 -05:00
rusefillc da68ff5ad6 j1850 SAE crc8 2021-11-22 14:03:52 -05:00
Scott Smith ba4a00d3bb
Drop SingleChannelStateSequence in favor of MultiChannelStateSequenceWithData (#3519)
* Drop SingleChannelStateSequence in favor of MultiChannelStateSequenceWithData

Most all the users were Multi* anyways, so just improve that:
1. Allow up to 8 waveforms to share one byte per timestamp.  It could be better but this is simple
   and gets most of the benefit.
2. Use a wrapper structure to handle reserving space for the arrays.  Makes the interface simpler
   and more rigid.  Also saves 4 bytes per Multi*.  Downside is access is now via -> and *,
   not . and (nothing).

Saves 224 bytes of BSS, 1832 bytes of RAM4/CCM, 952 bytes of TEXT, and 103 bytes of RODATA

* Instantiate a base_t to make debugging easier.
Also fixes crash on real firmware by using &m_base instead - LTO optimization issue?

* No magical templated StaticAlloc thingy.  Just virtual functions.
2021-11-21 04:56:07 -05:00
Matthew Kennedy 9a28e8d938
correctly compute engine revolution number (#3586)
* add param

* first revolution is revolution 0, not revolution 1

* would you look at that, we sync one rev quicker!

* changelog

* rpm value
2021-11-21 09:01:27 +03:00
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 bdc6340df7 only c++ because lua does some things asan doesn't like, but don't actually cause overruns. 2021-11-20 03:04:52 -05:00
Matthew Kennedy 754e832a7f
don't do things that don't work in clang (#3584)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-20 02:40:41 -05:00
Matthew Kennedy bb57a4b084
detect more overflows with asan (#3582)
* overflow detector

* type list dynamic allocate

* fix the buffer length

* comment

* pr fb

* sanitize sim

* fix sim sanitizer bug

* didn't mean to turn off optimization for sim

* asan can do that, if you turn it on!

* cleaning
2021-11-20 01:38:39 -05:00
rusefillc fcc2b780e9 On -fpermissive in Windows in unit tests fix #3581 2021-11-20 00:26:52 -05: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
Matthew Kennedy cdd27abb09
turn on c++ 20 (#3579)
* set flags

* emit initializers

* jar
2021-11-19 22:19:34 -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 8dbdeb7773
Remove a bunch of macros from engine_ptr.h (#3562) 2021-11-17 10:01:39 +03: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 655b77dc3f random refactoring: trigger central encapsulation 2021-11-15 20:22:05 -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 246e53441f.

* 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
GitHub build-unit-tests Action 97bf934e58 Trigger wheel definitions 2021-11-14 23:14:04 +00: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
GitHub build-unit-tests Action 7a9d1ecdd1 Trigger wheel definitions 2021-11-14 03:05:33 +00: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