Commit Graph

16408 Commits

Author SHA1 Message Date
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
GitHub build-firmware Action f8f52c4c1f Auto-generated configs and docs 2021-11-20 03:34:23 +00: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
GitHub set-date Action 3288f42fbf Update date 2021-11-20 00:59:29 +00:00
GitHub build-firmware Action 0b4ca8346b Auto-generated configs and docs 2021-11-19 12:08:29 +00:00
rusefillc 684622e476 debug mode for skipped count for 4 cylinders #3570 2021-11-19 07:02:21 -05:00
Matthew Kennedy 29613ec403
fast exti interrupt handoff (#3497)
* fast exti

* test code snuck in

* full interrupt disable :(

* do it the old fashioned way

* enable interrupt

* consume stored timestamp

* dead

* h7 maybe

* guard maybe

* non-stm32

* exti 16 wrong on f4/f7

* CORTEX_MAXIMUM_PRIORITY

* safer but uglier

* s

* chibios

* no const

* initializers

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-19 06:37:52 -05:00
GitHub build-firmware Action f76054c0b3 Auto-generated configs and docs 2021-11-19 09:16:06 +00:00
Matthew Kennedy caee2a5439
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
Matthew Kennedy 692e3d7e9f
adjust miata sync conditions (#3577) 2021-11-19 02:30:05 -05:00
Scott Smith df3e60c07c
Extend LogField to support scaled_channel divisors. (#3575)
Also move the type field and shrink the size field for better packing.
Saves about 800 bytes of flash.  This fixes #3574.
2021-11-19 02:29:19 -05:00
rusefillc d91e5f2ad0 automation around outputs section #197
a step back
2021-11-18 21:12:54 -05:00
rusefillc f1103b65bc automation around outputs section #197 2021-11-18 20:09:07 -05:00
GitHub set-date Action 90fc972716 Update date 2021-11-19 01:01:05 +00:00
rusefillc b16f970dcb automation around outputs section #197 2021-11-18 19:46:17 -05:00
rusefillc 12fda6be9f automation around outputs section #197 2021-11-18 19:34:46 -05:00
rusefillc 1268129028 better error handling 2021-11-18 19:33:20 -05:00
rusefillc 7b99df46d0 docs 2021-11-18 19:19:22 -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
rusefillc 27d8061625 automation around outputs section #197
wow huge step!
2021-11-18 00:19:11 -05:00
rusefillc 5c20e1d52c automation around outputs section #197 2021-11-18 00:05:27 -05:00
rusefillc 4e78a7f2d6 better error handling 2021-11-18 00:04:19 -05:00
rusefillc 29469f02d0 automation around outputs section #197 2021-11-17 23:51:58 -05:00
rusefillc 877535b8ff proportional spark cut #3427 2021-11-17 23:35:26 -05:00
GitHub build-firmware Action bd57251977 Auto-generated configs and docs 2021-11-18 04:30:54 +00:00
rusefillc 54a9b62de1 automation around outputs section #197
packing & making my job easier
2021-11-17 23:22:08 -05:00
rusefillc cb300ec985 automation around outputs section #197
refactoring
2021-11-17 23:16:15 -05:00
rusefillc 9ec38c7cdd Bells & whistles: board-specific image into console splash screen #3498 2021-11-17 22:26:24 -05:00
rusefillc 59a0f643d4 Bells & whistles: board-specific image into console splash screen #3498 2021-11-17 22:18:46 -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 ba8bd0a704
Add a lock for scheduleOrQueue events. (#3572)
Ignition callers are all tooth based, but aux valves calls it from both the microsecond timer and
the main initialization thread.  HPFP will also soon call it from both those places too.
2021-11-18 05:08:32 +03:00
GitHub set-date Action 8ad9a169ef Update date 2021-11-18 01:00:51 +00: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
rusefillc c44e28bef1 Better Windows build-in DFU #3338 2021-11-17 08:03:35 -05:00
rusefillc ca5118eff5 Better Windows build-in DFU #3338 2021-11-17 07:57:58 -05:00
rusefillc b579b33082 Startup Pin State Error - maybe hardware damage of STM32 pin connected to a 12v-powered TC4427? #3558 2021-11-17 04:45:55 -05:00
rusefillc d688f72c3e proportional spark cut #3427 2021-11-17 04:06:22 -05: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 70ad9724c0
Make engine* and friends be const pointers in production. (#3564)
This allows the compiler to see through the pointer and make accesses faster.
It saves 1336 bytes of text.
2021-11-17 03:53:17 -05:00
Scott Smith 8dbdeb7773
Remove a bunch of macros from engine_ptr.h (#3562) 2021-11-17 10:01:39 +03:00
Matthew Kennedy a29933d7f8
simulator gets a heap (#3563) 2021-11-17 10:00:12 +03:00
GitHub set-date Action 5b1f6dd4b1 Update date 2021-11-17 01:00:29 +00: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
rusefillc dad00adc28 helping launch enter simulator 2021-11-16 16:45:14 -05:00
rusefillc 6e9db86b38 helping launch enter simulator 2021-11-16 16:34:23 -05:00
rusefillc 678a756275 helping launch enter simulator 2021-11-16 16:31:35 -05:00
Andrey a61043e570 proportional spark cut #3427 2021-11-16 13:23:08 -05:00