Commit Graph

91 Commits

Author SHA1 Message Date
Matthew Kennedy 932f5e1f30
cam/crank sync improvements (#4152)
* clarify getOperationMode

* wait for phase synchronize to transition to sequential mode

* one test

* encapsulate vvtSyncCounter

* test

* Add option to stop VVT sync above some RPM

* getOrZero

* Revert "synchronized Phase handling improvements fix #4099"

This reverts commit 32d46d1f09.

* Revert "m_hasSynchronizedSymmetrical handling improvements #4099"

This reverts commit d5e131b1d0.

* remove synchronizedPhase

* only crank needs this

* changelog

* needsDisambiguation()

* test

* s

* bad merge

* put the timer back

* s

* s

* changelog

* test for new behavior

* correct parameter order

* spelling

* s

* s

* s

* tests merge happy

* bad merge

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2022-06-09 17:21:22 -04:00
Matthew Kennedy 4ada633206
Remove third trigger channel (#4226)
* remove third trigger

* clean up the honda mess

* there was nothing novel about this engine config

* include

* missed a few

* s

* x

* changelog

* don't set the third trigger input

* don't redefine the same thing 3 times

* only two inputs!

* test
2022-06-01 21:24:20 -04:00
Matthew Kennedy c0d8cbfef4
Trigger cleanup init (#4222)
* extra parameter

* name decoders in constructor

* s
2022-06-01 00:55:34 -04:00
Matthew Kennedy 70c2689f1e
remove trigger duty cycle calculation (#4213)
* This field was ignored.

* move pad out

* gone

* make trigger configuration a little clearer

* even simpler!

* format

* test fix

* remove duty cycle thing
2022-05-30 22:39:57 -04:00
Matthew Kennedy f945e6efc9
trigger configuration refactoring for clarity (#4212)
* This field was ignored.

* move pad out

* gone

* make trigger configuration a little clearer

* even simpler!

* format

* test fix
2022-05-30 19:36:47 -04:00
Matthew Kennedy 66fffee321
More trigger encapsulation (#4207)
* trigger decoder returns a result

* TriggerFormDetails

* s

* don't reach out and touch the engine
2022-05-29 13:49:00 -04:00
Matthew Kennedy d4509cab8a
TriggerState -> TriggerDecoder (#4157) 2022-05-10 11:41:39 +03:00
rusefillc e631988b22 Proper cam speed labels in triggers #4021 2022-04-03 12:22:47 -04:00
Andrey 9d335c1261 Trigger setup in TS is highly confusing: hide operation mode from users? #4031 2022-04-03 01:38:52 -04:00
rusefillc 086739d20a Refactoring, technical debt: export more of trigger attributes into triggers.txt file #2077 2022-04-02 19:08:22 -04:00
rusefillc 59f23e294b Refactoring, technical debt: export more of trigger attributes into triggers.txt file #2077 2022-04-02 18:32:40 -04:00
rusefillc ea94fc05ae Refactoring, technical debt: export more of trigger attributes into triggers.txt file #2077 2022-04-01 21:11:32 -04:00
rusefillc fda7a3a775 Engine phase wrap around in log #3645
refactoring & docs
2021-12-02 17:06:20 -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 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 ecac07f938 brave refactoring 2021-11-19 23:56:52 -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 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
Matthew Kennedy 8cdac4cac0
remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
rusefillc 0813266ee1 trigger refactoring & docs 2021-11-14 15:35:11 -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 d4c4db9a12
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
rusefillc 1db9a02f1d Revert "Don't keep a separate MultiChannelStateSequence for the trigger emulator. (#3513)"
This reverts commit 280dfa94e7.
2021-11-09 20:42:23 -05:00
Scott Smith 280dfa94e7
Don't keep a separate MultiChannelStateSequence for the trigger emulator. (#3513)
All it wants is to use the main trigger state, so don't bother copying it.  Instead, change
PwmConfig to take a const pointer to a Multi.*Sequence, then make all the users adapt.  Worse
fallout is that SimplePwm now has its own Multi.*Sequence, but PwmConfig is downgraded to a
pointer, so that's only a net +4 bytes.  And we can make the overhead of Multi.*Sequence much lower
using embedded arrays, which only the caller can do since it knows the maximum size... (for another
day...)

Also remove SimplePwm's 2nd copy of SingleChannelStateSequence.  It served no purpose.

Saves 1992 bytes of BSS and 24 bytes of RAM4 (latter probably due to SimplePwm change)
2021-11-09 14:35:07 -05:00
Scott Smith 158f719d95
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
Andrey 9ac1575777 reducing complexity 2021-11-07 01:57:32 -05:00
rusefillc 5de6c2a270 typo 2021-11-07 01:51:05 -05:00
rusefillc 20784db801 refactoring - magic constant bad
cypress and kinetis both have this macro already
2021-11-07 01:34:16 -04:00
rusefillc 0af09f596c refactoring - magic constant bad
cypress and kinetis both have this macro already
2021-11-07 01:28:28 -04:00
rusefillc 656b8c3429 refactoring - magic constant bad 2021-11-07 00:03:16 -04:00
Andrey a6a969390f Honda K cam wheels #3405 2021-10-28 19:26:59 -04:00
Andrey de350131e6 Honda K cam wheels #3405 2021-10-28 11:40:31 -04:00
Matthew Kennedy c72bd07179
enable address sanitizer (#3217)
* enable asan

* lua

* this is dead and leaky

* leaky nissan

* fix pwm generator use-after-stack

* initializers

* prevent problems in case of invalid trigger shape

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-09-05 05:56:59 -04:00
Andrey 9345e5d2e0 NB2 trigger shape does not seem to match JimStim #2980
only first steps of unit test
2021-07-17 17:47:32 -04:00
Andrey f54b3cd1b2 refactoring 2021-07-17 00:46:39 -04:00
rusefillc 090725d273 reducing warnings 2021-07-13 14:50:10 -04:00
Andrey eaff083377 refactoring - explicit read method 2021-06-26 22:17:07 -04:00
Andrey a5eeb19c4d refactoring - explicit read method 2021-06-26 22:07:45 -04:00
Andrey 17f07b6b0e Override trigger gaps feature #2734 2021-05-23 19:51:00 -04:00
Matthew Kennedy a70f113b77
finish it off: remove scheduleMsg (#2575)
* finish it off

* one more logger ptr

* fwd decl

* Revert "one more logger ptr"

This reverts commit a21fb0087ddc748978d716db2710800cf26e437b.

* unused

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 15:33:40 -04:00
Matthew Kennedy c26987b96b
Destroy all shared logger (#2574)
* most of shared logger

* a few more

* one more

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 14:28:48 -04:00
rusefillc 7eb5816c33 GM/Daewoo 60/2/2/2 Trigger Pattern #2264 2021-02-01 23:44:14 -05:00
rusefi 10e980e293 Revert "Save more space in the angle cache (#2228)"
This reverts commit c7ca1b2e
2021-01-18 18:53:00 -05:00
Matthew Kennedy c7ca1b2ef4
Save more space in the angle cache (#2228)
* store event angles in a scaled field

* tests

* comment
2021-01-18 18:31:06 -05:00
Matthew Kennedy 6a1b9db952
save 1440 bytes (#2226) 2021-01-16 21:22:30 -05:00
Matthew Kennedy 60f70a3721
clean up some includes (#2227)
* cleanup

* make c happy
2021-01-16 09:45:45 -05:00
rusefillc e6bfd9a2ed trigger lifecycle 2020-12-09 12:19:25 -05:00
rusefillc be2a34a956 refactoring: magic constants 2020-12-04 16:24:19 -05:00
rusefillc 2524b7b8c2 6.1 Hemi V8 decoder #2010 2020-12-04 16:03:27 -05:00
rusefillc e730c2c0b1 6.1 Hemi V8 decoder #2010 2020-12-04 15:33:07 -05:00