Commit Graph

1677 Commits

Author SHA1 Message Date
Andrey 1d52e84e35 refactoring 2021-12-07 17:00:42 -05:00
Andrey c793b19538 MAP phase sensing #3544
look new unit test!
2021-12-07 16:58:10 -05:00
Matthew Kennedy aa8584d89a 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
rusefillc 2b465be253 MAP phase sensing #3544
option to look for high and low peaks
2021-12-05 14:25:26 -05:00
rusefillc e0559a8548 MAP phase sensing #3544
taking a step back to happy place
2021-12-04 18:21:10 -05:00
rusefillc 216b5d9e7a tune via CAN #3361
CAN testability
2021-12-04 01:01:48 -05:00
rusefillc 82044e579a header style 2021-12-04 01:01:48 -05:00
Andrei d1f30f10b1 CAN update 2021-12-03 21:44:15 -05:00
rusefillc 9dcaa2ecbc trigger_adc helping simulator 2021-12-01 14:17:16 -05:00
rusefillc a13bc09fe4 trigger_adc unit tests 2021-12-01 13:35:44 -05:00
Andrei 6c01dd5791 trigger_adc unit-test data files 2021-12-01 12:28:48 -05:00
rusefillc 52eace58e4 proteus to have enlarged Lua 2021-11-30 21:37:17 -05:00
Matthew Kennedy 565a94ea34 Remove the EFI_NO_CONFIG_WORKING_COPY option (#3630)
* no working copy

* oops
2021-11-29 16:44:45 -05:00
rusefillc 7e99e9123d Epic: Remove FSIO #2928 2021-11-28 17:54:26 -05:00
Matthew Kennedy aed334f9ac better VSS configuration (#3542)
* vss uses real values

* some defaults

* test and correct math

* km, not miles!

* comment

* tooltip

* that macro went away

* 100hz and default settings gives 9kph

* changelog

* order of operations safety

* make the test like the pwm test

* housekeeping

* this is why we need sensor automation

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-27 08:49:07 -05:00
GitHub build-unit-tests Action 63e0b8b599 Trigger wheel definitions 2021-11-26 02:09:34 +00:00
GitHub build-unit-tests Action 0519ad2acb Trigger wheel definitions 2021-11-25 23:54:51 +00:00
Andrey 695557f709 MAP phase sensing #3544 2021-11-24 22:36:36 -05:00
Andrey d8799e7e8e MAP phase sensing #3544 2021-11-24 21:53:32 -05:00
Andrey c1196988a0 MAP phase sensing #3544 2021-11-24 21:53:16 -05:00
Matthew Kennedy 5274cffff3 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 7760ddd8b6 live data for wastegate #3588
i want to persist state so no 'const' sorry
2021-11-23 15:52:43 -05:00
rusefillc d9e8509440 harley 2021-11-22 19:16:57 -05:00
Matthew Kennedy 9bd8a19564 oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -05:00
rusefillc 5271d9791a j1850 SAE crc8 Lua 2021-11-22 14:19:19 -05:00
rusefillc 3d8ddbceea j1850 SAE crc8 2021-11-22 14:03:52 -05:00
Scott Smith 9d61fb4cfd 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 b9f8409f59 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 e2a4504728 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 8029f8446a 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 568dc8a277 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 569415930c 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 03b13af2db On -fpermissive in Windows in unit tests fix #3581 2021-11-20 00:26:52 -05:00
rusefillc 6766ff8cab On -fpermissive in Windows in unit tests #3581 2021-11-20 00:23:27 -05:00
rusefillc 18aacc0ef6 On -fpermissive in Windows in unit tests #3581 2021-11-20 00:16:03 -05:00
Scott Smith 07d30285fc 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 e7956a53f6 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 a79b0c424c turn on c++ 20 (#3579)
* set flags

* emit initializers

* jar
2021-11-19 22:19:34 -05:00
Scott Smith aba4e5167e 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 b3e0b28c75 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 659cc68be1 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 f9f13f0bad 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 80091498a6 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 14578ddae7 Remove a bunch of macros from engine_ptr.h (#3562) 2021-11-17 10:01:39 +03:00
Scott Smith dac2ae9b1d 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 774d96493e spelling 2021-11-16 16:46:54 -05:00
Matthew Kennedy 7296593448 remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
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