Commit Graph

443 Commits

Author SHA1 Message Date
Matthew Kennedy fcd3d991ee
trigger tweaks cleanup (#4278)
* simplify some math

* we say yes to the todo

* and put back that test

* test
2022-06-23 23:11:29 -04:00
rusefi 271dddf61e verbose trigger sync should reuse engineSnifferRpmThreshold fix #4259 2022-06-18 15:18:45 -04:00
rusefillc 9a9047c3f9 more info verbose trigger/vvt 2022-06-17 22:11:09 -04:00
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 720c463ffb
trigger decoder returns a result (#4206) 2022-05-28 09:01:45 -04:00
Matthew Kennedy ae91b2aea8
don't rely on triggerStateListener to detect trigger errors (#4164)
* Write proper TriggerDecoder tests

* Improve logic around sync loss

* these tests I understand

* these I sort of understand....

* the one error in the noiseless decoder is gone!
2022-05-13 18:48:26 -04:00
Matthew Kennedy 170d574a5d
move logic in to trigger decoder (#4162)
* move logic in to trigger decoder

* status loop

* minor cleanup

* s
2022-05-10 23:55:28 +03:00
Matthew Kennedy d4509cab8a
TriggerState -> TriggerDecoder (#4157) 2022-05-10 11:41:39 +03:00
Matthew Kennedy 7e0f2d8337
switch back to flag (#4155) 2022-05-10 07:52:29 +03:00
Matthew Kennedy 7f5672aaec
encapsulate stuff properly (#4154) 2022-05-09 15:46:36 -04:00
rusefillc 32d46d1f09 synchronized Phase handling improvements fix #4099 2022-05-09 04:36:03 -04:00
rusefillc d5e131b1d0 m_hasSynchronizedSymmetrical handling improvements #4099
API progress
2022-05-09 04:04:38 -04:00
rusefillc 88a6b34577 helping build 2022-05-08 09:14:50 -04:00
rusefillc bd8459875d refactoring: bringing method names up to date 2022-05-08 09:04:27 -04:00
rusefillc bd9639b91d Remove value copy from controller into outputChannels #4095 2022-05-08 08:50:27 -04:00
rusefillc 1ceabed6a5 humans need humane warning messages 2022-04-18 11:35:19 -04:00
rusefillc 06e899e1bb very random progress 2022-04-16 17:07:57 -04:00
Matthew Kennedy 7d657106d7
warning cleanup (#4020) 2022-03-22 16:53:24 -04:00
rusefillc b1de262520 toothed previous time #4019 2022-03-21 20:41:09 -04:00
Andrey 26c2d76f6c migrating to SensorType::Rpm API 2022-01-20 23:36:09 -05:00
Andrey cda2b711cf migrating to SensorType::Rpm API 2022-01-20 23:32:59 -05:00
Matthew Kennedy d5c4b79b1a
Nb2 crank sync special case (#3727)
* extract isSyncPoint

* test because why not

* check vvt resync nb2

* custom nb decoder

* test only resyncs once!

* good job valgrind, you found a bug!
2021-12-31 15:47:25 -05:00
Matthew Kennedy b3de217c1b
adjustment to #3722 (#3723)
* s

* behold, another bug a test caught

* test

* test generates usable trigger pattern so it works correctly

* comment

* don't need that
2021-12-31 01:21:21 -05:00
Matthew Kennedy 4981eb43d0
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 95ad75318d
improved noFiringUntilVvtSync logic (#3696)
* s

* poke

* poke again for science

* kick for science

* kick

* kick

* comment kick

* s

* don't try to compare the array decay pointer to 0 (!)

* collateral damage

* adjust miata sync

* reset trigger states correctly on engine stop

* s

* nissan MR too
2021-12-27 12:09:38 -05:00
rusefillc f826fe13aa MAP phase sensing #3544
trigger sync better gauges/logging
2021-12-06 17:04:05 -05:00
rusefillc 934b005acb trigger sync better gauges/logging 2021-12-06 13:08:41 -05:00
rusefillc 5c0795f034 random note 2021-11-26 15:48:42 -05:00
Andrey c2fa1cea78 minor progress 2021-11-24 22:35:56 -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
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
Scott Smith dac67235c4
Don't keep a separate MultiChannelStateSequence for the trigger emulator, version 2. (#3517)
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-10 07:01:20 -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
rusefillc ea87d9c9be Whatever we call it, no matter how we do it - we need live data / remote view into rusEFI actual state #3353
dead code
2021-10-14 15:17:09 -04:00
Matthew Kennedy 0d983855b9
instant rpm uses full engine cycle (#3077)
* instant rpm uses full engine cycle

* turn off fast spinup for this test
2021-07-30 08:18:24 -04:00
Matthew Kennedy b52d50bbf2
Use pch in lots of files (#3066)
* most engine.h

* most engine_configuration

* more

* more

* more

* more

* more

* moooooore

* ok I'm done for now

* oops
2021-07-26 01:05:17 -04:00
Andrey 6fc693aea2 VVT position of first cam is off on first cycle fix #2987 2021-07-22 01:02:37 -04:00
Andrey 24cfbeba35 Nissan VVT trigger decoder #2887 2021-07-21 23:08:56 -04:00
Andrey f2cb242090 simplify quad vvt test #3018
better parameter name and explicit constraint clarification
2021-07-21 17:45:35 -04:00
Matthew Kennedy 5f3464b204
Fix prepareEventAngles for symmetrical crank triggers (#2982)
* fix and make code legible

* update test to check every tooth

* symmetrical crank

* simplify findTriggerPosition

* make getAngle intelligable
2021-07-17 23:27:20 -04:00
Matthew Kennedy 2ce7777865
don't require EXTERN_ENGINE in every file (#2969)
* move enginePins

* no more extern engine

* uses

* more

* extern config too

* put this where it belongs

* include correct header

* merge
2021-07-16 18:13:33 -04:00
Andrey 8e30c513da unit tests pass on Linux fail on Windows fix #2902
reducing code duplication
2021-07-05 23:51:13 -04:00