Commit Graph

493 Commits

Author SHA1 Message Date
Matthew Kennedy a1647fd66e baro fully in sensor model (#3829)
* consumers and api

* dead test

* baro uses sensor model

* remove old (copy of?) map lookup logic

* I guess we don't need FastInterpolation any more?

* don't double init analog input
2022-01-23 09:42:11 -05:00
rusefillc e8f980eca0 docs 2022-01-22 22:18:50 -05:00
Matthew Kennedy bf8d07f729 does this help? (#3795)
* does this help?

* maybe this helps

* oops I snuck in an O0

* only firmware
2022-01-16 08:55:40 -05:00
rusefillc 597a3430d9 https://en.wikipedia.org/wiki/Pi 2022-01-14 21:23:27 -05:00
rusefillc dd4950f850 Code style for methods with zero arguments #3535 2022-01-11 22:40:52 -05:00
rusefillc fc996ad339 Code style for methods with zero arguments #3535 2022-01-11 22:26:24 -05:00
rusefillc 433aedd036 dead code 2022-01-11 22:20:15 -05:00
GitHub build-firmware Action e4f828c0a1 Auto-generated configs and docs 2022-01-05 06:49:51 +00:00
GitHub build-firmware Action fd23938b2a Auto-generated configs and docs 2022-01-05 05:09:04 +00:00
rusefillc 5737590d94 itoa unit test, not a very detailed one 2022-01-03 03:31:57 -05:00
Matthew Kennedy 041a3e12a3 extract isSyncPoint function (#3726)
* extract isSyncPoint

* test because why not

* check vvt resync nb2

* clean up noise from test case

* clarify and comment
2021-12-30 11:39:04 -05:00
Matthew Kennedy 5642ef07be Autoscale all the things! (#3713)
* Map3D accepts any scaled_channel type

* consistency

* reinstate test

* fix ratio

* throttle, boost, gppwm

* scale ignition and VE

* tests
2021-12-22 08:09:41 -05:00
Matthew Kennedy 0f133f88a1 Map3D accepts any scaled_channel type (#3712)
* Map3D accepts any scaled_channel type

* consistency

* reinstate test

* fix ratio
2021-12-21 18:52:46 -05:00
Matthew Kennedy f2312facd6 tables support non-integer-scaled scaled_channel (#3708)
* support dividers

* float

* format
2021-12-21 00:59:07 -05:00
Matthew Kennedy c92f6b832b ui & config for fuel/ign trim tables (#3704)
* ui & config

* bump flash version

* compaction

* s

* make things happy

* fsio too

* OK, well those defaults were insane

* b

* why are these defaults insane

* adjust cylinder offset ui

* s

* cleanup
2021-12-20 21:58:53 -05:00
Matthew Kennedy 2ba4c7844d simplify some table lookups (#3692)
* simplify

* expand interpolation test
2021-12-20 08:14:30 -05:00
rusefillc 44389c5eca helping mac 2021-12-20 01:23:23 -05:00
Andrey 53d842b19f 2 byte table axis #3045 2021-12-19 23:23:33 -05:00
Andrey 05daba6539 2 byte table axis #3045 2021-12-19 23:20:21 -05:00
Andrey 91f28b6cf5 2 byte table axis #3045 2021-12-19 23:17:17 -05:00
Andreika 95adac3f03 CAN ISO-TP progress (+unit-tests fix) (#3677)
Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2021-12-08 15:11:19 -05:00
rusefillc 216b5d9e7a tune via CAN #3361
CAN testability
2021-12-04 01:01:48 -05:00
rusefillc 8f3f2f4a55 hellen81 util changes 2021-12-01 20:46:36 -05:00
rusefillc 1e53844f5b why so many channels are hidden in debug ? #3614 2021-11-29 00:33:05 -05:00
rusefillc d791ef5581 skipspark script kills ECU fix #3611 2021-11-25 22:40:19 -05:00
Andrey 4e45297145 minor progress 2021-11-24 22:35:56 -05:00
Andrey f17c951742 dead file 2021-11-24 20:26:40 -05:00
Matthew Kennedy 9bd8a19564 oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -05:00
rusefillc 3d8ddbceea j1850 SAE crc8 2021-11-22 14:03:52 -05:00
Scott Smith 04fa1fd410 Fix potential buffer overrun in cyclic_buffer. (#3583)
This exposed a buffer overrun, so double the size of the buffer (to account for 720 degree engine
cycle vs 360 degree crank events).

Also use proper numeric limits when computing min/max.
Finally, add a lock around the call to cyclic_buffer that actually caused the contention.
2021-11-20 03:01:11 -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
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 a0a1b5e6a0 delimeter is not comma (#3533)
* delimeter is not comma

* do it in config txt

* use txt

* s

* string

* compat

* also, spelling is hard

* use new name

* use new name

* generate enough for happy console

* use an even less common character

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-19 12:01:45 +03: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 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 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
Andrey c8b733ea6e refactoring launch 2021-11-15 19:34:42 -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
rusefi 1f486a1e15 Lua: changing "table" API 2021-11-14 16:29:46 -05:00
rusefi e40780a595 more API 2021-11-14 14:53:44 -05:00
rusefillc 677a2ede70 Overflow in currentTimeMillis and getTimeNowSeconds #3531
it now takes 1000 times longer to overflow
2021-11-11 16:39:23 -05:00
rusefillc 0ec6d5be4a dead code 2021-11-08 19:01:18 -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
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
racer-coder a18beadb03 Create an interpolate3d function to match the interpolate2d, but for 3d tables. (#3459)
Remove some implicit C array to pointer conversions in Map3D by adding
(), *, and & where appropriate.  This allows us to remove getBinPtr.

Call interpolate3d from Map3d so there's no code duplication.
2021-11-04 14:07:37 -04: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 592bf2a359 docs 2021-11-02 23:34:44 -04:00
Andrey 14aac56c41 warning(CUSTOM_PID_DTERM, "PID: unexpected dTime") 2021-10-29 18:31:43 -04:00
Matthew Kennedy e7d66fd242 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