Commit Graph

380 Commits

Author SHA1 Message Date
rusefi c5a0da2db7 consistency 2020-04-18 22:46:22 -04:00
Matthew Kennedy 4d24fdd57d
Fuel/ign correctino on new temp sensors (#1318)
* corrections

* test

* adv map

* tests

* cleanup

* lcd

* fsio

* unneeded

* more math

* last consumer

* cleanup

* fix kinetis
2020-04-18 18:45:30 -04:00
Matthew Kennedy bc15e0826d
CLT consumer: fsio (#1302)
* idle

* CLT test prep

* idle target

* header

* air interpolate

* ancient comment

* fuel cut

* fuel cut, idle tests

* cleanup

* fsio test help
2020-04-15 16:20:45 -04:00
Matthew Kennedy 044766ec70
New clt consumers part 1 (#1301)
* idle

* CLT test prep

* idle target

* header

* air interpolate

* ancient comment

* fuel cut

* fuel cut, idle tests

* cleanup
2020-04-15 09:48:17 -04:00
rusefi 697055bd9f fixing master 2020-04-14 12:55:39 -04:00
Matthew Kennedy e1301f3c47
fix maf (#1287) 2020-04-12 15:52:29 -04:00
Matthew Kennedy 8006c0a548
CLT/IAT/Aux in the new sensor world (#1269)
* hook up clt

* init test

* probably fix test

* aux temp

* relax checking

* more significant figures

* remove old aux temp

* hand generate

* claim RAM

* move to ccm

* subscribe

* info printing

* warnings

* raise high voltage failure threshold

* fix test

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-07 16:07:09 -04:00
Matthew Kennedy 200bfe3f80
Deadband helper & tests (#1267)
* deadband

* header

* comment
2020-04-06 09:16:26 -04:00
Matthew Kennedy 595df15dfd
fix (#1268) 2020-04-06 09:00:26 -04:00
Matthew Kennedy 345bf61bd5
Goodbye, old TPS (#1266)
* clear out tps

* boost control

* aux valves

* launch, aux valves

* unused field
2020-04-05 19:33:33 -04:00
Matthew Kennedy 7d5df29fbd
yet more tps consumers (#1258)
* advance_map

* tests

* unneeded

* idle

* use driver intent instead

* and obd and lcd

* engine load

* ve lookup

* unused

* oops we needed that

* oops needed that too

* mocking

* test mocks

* oops

* helps to use the right sensor

* and cylinder cleanup

* fuel math

* typo

* old tests

* kill dead stuff

* cleanup

* more

* fix

* test

* s

* fix signature

* fix test

* comment

* priming pulse

* remove mock tps

* remove more dead

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-05 09:11:25 -04:00
Matthew Kennedy 3186741ddc
TPS Initialization Testing (#1264)
* test support

* stub for tests

* plumbing so we can test this

* add test

* comments
2020-04-05 09:10:08 -04:00
Matthew Kennedy bc3f0c6b27
More TPS consumers: VE lookup (#1256)
* advance_map

* tests

* unneeded

* idle

* use driver intent instead

* and obd and lcd

* engine load

* ve lookup

* unused

* oops we needed that

* oops needed that too

* mocking

* test mocks

* oops

* helps to use the right sensor

* and cylinder cleanup

* fuel math

* typo

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-04 08:41:09 -04:00
Matthew Kennedy 9f75c0cea6
TPS consumers: idle and ignition and obd2 and lcd (#1254)
* advance_map

* tests

* unneeded

* idle

* use driver intent instead

* and obd and lcd

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-03 19:59:08 -04:00
Matthew Kennedy b197c6ff07
run ETB on new TPS (#1248)
* run ETB on new TPS

* why did we include all those...?

* init tps for etb test

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-02 21:33:49 -04:00
shadowm60 ea4cfa9046
E30 M3 Tach output solution #907 (#1203)
* Update tachometer.cpp

Initial implementation of E30 M3 Tach output solution #907, unit_test plus debugging next

* tacho unit tests

First successfull unit test for tachometer

* RAM adjustment so it would link

* refactoring tacho, broken!

* starting to make some progress...still fails after a few seconds

* Rework with SW PWM

* Update after code review

* unit_test update

* First working unit_test

* Update .gitignore

* Update engine_controller.cpp

* Update engine_controller.cpp

* Update tachometer.h

* Update test_tacho.cpp

Co-authored-by: rusefi <rusefi@users.noreply.github.com>
2020-04-02 15:20:04 -04:00
Matthew Kennedy b015ec5944
Add redundant sensor (#1249)
* add redundant sensor

* add tests

* add configure, info printing

* tests

* tests

* casing

Co-authored-by: Matthew Kennedy <matthew@mck-mbp-15.local>
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-02 08:55:21 -04:00
Matthew Kennedy 22267e5479
Replace hasPedalPositionSensor (#1245)
* remove

* add Sensor::hasSensor

* consume in etb

* remove unused state

* don't use it there either

* format

* fix up tests

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-02 08:04:12 -04:00
rusefi a47dce4025 code style 2020-04-01 21:32:21 -04:00
Matthew Kennedy 50cd6549a2
Fully switch acc pedal to new sensors (#1212)
* proxy sensor

* header

* idle

* can

* settings

* remove old mocking

* remove old impl

* etb

* oops, gotta actually register it

* fix test

* structured bindings ftw!

* driver intent for stepper

* tear out old

* oops too much
2020-04-01 20:21:03 -04:00
Matthew Kennedy 483d4a2204
Debuggability in the new sensor world (#1238)
* rename to avoid conflict

* fix efilib

* add sensor printing

* makefile

* that check was already there

* const

* const

* fix tests

* formatting

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-30 18:29:42 -04:00
Matthew Kennedy 53679fab54
Finally rename injector_central to bench_test (#1229)
* bench test rename

* rename consumers

* good lord what are all of these externs doing

* fix tests
2020-03-26 08:03:55 -04:00
Matthew Kennedy a5d4d06868
Multispark implementation (#1192)
* multispark prototype

* only multispark if not cut

* typo

* do some reasonableish math

* consume cfg

* todo

* bad merge

* move math out of engine2.cpp

* engine state config

* consume generated

* use new

* hand generate

* doc, debugging

* debug channel names

* don't depend on rpmcalc

* safer, fix math

* tests

* default multispark config

* remove todo

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-26 01:49:36 -04:00
rusefi 1955af0b6c random code inspired by Ola 2020-03-24 19:50:04 -04:00
Matthew Kennedy d5600995e2
fix (#1202)
* fix test

* shrink memory
2020-03-19 20:02:49 -04:00
rusefi a33d479683 CLT stops working when using 2-0 custom trigger wheel #1171 2020-03-06 01:31:04 -05:00
Matthew Kennedy 40b0783205
Split out EtbHardware (#1168)
* start tear out motor

* fix

* nuke reconfig

* guard for test

* test fixing

* format, condense headers

* fix todos

* undo todo

* format
2020-03-03 17:56:50 -05:00
rusefi 04a4e2bca3 ETB: expand automated testing #115 2020-02-22 23:18:02 -05:00
rusefi e9a3b218c4 miata vvt trigger decoding is broken #1145 2020-02-14 13:02:27 -05:00
rusefi a2c4b36edc Merge remote-tracking branch 'remotes/origin/2019.12.25_release_1.19.12_xmas' 2020-02-14 10:51:26 -05:00
rusefi ed2b7578a5 Merge remote-tracking branch 'remotes/origin/2019.12.25_release_1.19.12_xmas' 2020-02-14 10:50:50 -05:00
rusefi 243a532f84 miata vvt trigger decoding is broken #1145 2020-02-14 10:49:22 -05:00
rusefi 9790052596 miata vvt trigger decoding is broken #1145 2020-02-14 09:33:29 -05:00
rusefi 75d9417131 miata vvt trigger decoding is broken #1145 2020-02-14 00:37:36 -05:00
rusefi 4e8f9f0d30 cam/vvt decoder test progress 2020-02-05 01:08:39 -05:00
Matthew Kennedy c7dce2e38b
Rescale TPS (#1112)
* fake adc ticks

* consumers

* fix test 1

* fix tests
2020-02-01 16:41:07 -05:00
rusefi d63dae9301 this test is even better now! 2020-01-31 13:45:15 -05:00
rusefi f6e7e8871a VVT refactoring & assertions for VVT test 2020-01-31 01:49:10 -05:00
rusefi b6e0bc7ed1 date & VVT test progress 2020-01-31 01:23:01 -05:00
rusefi b6fe6555e0 lovely tiny bug which mostly affects NB2 with an impossible one tooth crank trigger wheel 2020-01-30 01:47:34 -05:00
rusefi d9b96fe509 extracting class & codes clean-up 2020-01-28 00:16:33 -05:00
rusefi 282cd8e1ac trigger refactoring 2020-01-26 14:20:55 -05:00
rusefi 51ab9f5b57 reducing code duplication 2020-01-26 06:28:33 -05:00
rusefi db2ab72d12 refactoring trigger 2020-01-26 03:33:45 -05:00
rusefi 9d0c5540d8 refactoring 2020-01-22 00:40:26 -05:00
rusefi bb217b01dd happy new year unification 2020-01-13 21:57:43 -05:00
rusefi 0bab01369a refactoring: no need to specify parameter manually 2020-01-12 10:43:02 -05:00
Matthew Kennedy d3d088676b Add timeout + raw value access for sensors (#1098)
* timeout

* inject stamp

* allow getting raw value

* plumb timeout

* fix tests
2020-01-12 03:25:23 -05:00
rusefi 645f51a038 better method names 2020-01-10 23:17:58 -05:00
Matthew Kennedy 851c6041b1 Inject timestamps in to hwHandleShaftSignal (#1090)
* injection

* injectors
2020-01-09 21:19:11 +03:00
rusefi b83a5310be happy new year 2020-01-08 00:02:40 -05:00
Matthew Kennedy 95a7a9a8e1 Strongly typed action constructor (#1087)
* strong typing

* maybe we needed that one
2020-01-07 18:10:31 -05:00
Matthew Kennedy 5c85d53e16 Pass action_s instead of callback/param (#1084)
* change action

* consumers

* fix test

* didn't mean to add those

* simplify

* fix simulator

* fix sim for real

* oy

* maybe this time the simulator will actually be fixed, for real

* don't rely on undefined behavior
2020-01-07 00:41:18 -05:00
rusefi cb9fc19f92 that's not a worth a file 2019-12-24 00:03:53 -05:00
Matthew Kennedy b9454790c7 Add new sensor function types (#1065)
* add functions

* add tests

* add chain tests

* float suffix
2019-12-17 09:06:29 -05:00
rusefi bd1bcccc19 this stuff is pretty dead 2019-12-15 21:59:25 -05:00
rusefi aa1b7e2c6b and finally a unit test, like it shoud be! 2019-12-13 14:55:20 -05:00
rusefi 236d952335 progress towards ETB controller mocking 2019-12-13 13:52:34 -05:00
rusefi af4f20551b getting rid of boardConfiguration / binary compatible change 2019-12-11 17:48:55 -05:00
rusefi 05ab778396 clean-up 2019-12-10 01:03:02 -05:00
rusEfi 1cc71ef8ec dual-ETB progress 2019-12-10 00:07:46 -05:00
rusefi c5cfd21a70 just a trivial massive rename: TriggerState > TriggerWaveform 2019-12-08 01:09:39 -05:00
rusefi d6471a84bc Refactor Trigger System #635
injecting callback via parameters instead of nasty "bool isInitializingTrigger" field
2019-12-06 01:57:11 -05:00
rusefi 717abd6b67 Refactor Trigger System #635
injecting callback via parameters via magic and potentially broken field manipulation
2019-12-06 01:05:19 -05:00
rusefi 813b6aa6ce The Big Refactoring of 2019: folder structure #723 2019-12-04 01:11:10 -05:00
rusefi eb305f0265 #490 2019-12-03 00:29:12 -05:00
rusefi 955b2b5c3f misc clean-up 2019-12-02 13:53:31 -05:00
rusefi 4dafc65d69 misc clean-up 2019-12-02 10:18:13 -05:00
rusefi 0b4f624b2a cj125 unit test progress! 2019-12-02 01:52:54 -05:00
andreika-git 1808642af1 Starter relay + Hardcoded 'FSIO' + simulator fix (#1032)
* Starter Relay: gui + built-in FSIO impl.

* Hardcoded 'FSIO' replacement for RAM-limited boards

* fix simulator
2019-11-25 20:08:01 -05:00
rusefi 1cb2f92142 more correct variable names 2019-11-23 23:49:39 -05:00
rusefi 7ee657d238 aux valves unit test 2019-11-23 22:55:21 -05:00
rusefi ab744af14b header cleanup 2019-11-23 21:41:17 -05:00
rusefi af60a46229 making progres on angle-based scheduling 2019-11-23 20:36:40 -05:00
rusefi 7b7b46a2a2 refactoring 2019-11-23 18:38:16 -05:00
rusefi f0c4817e1b 'triggerEventAngle' not really needed 2019-11-23 17:44:44 -05:00
rusefi aa4967383a explicit list field to simplify code navigation 2019-11-23 17:04:51 -05:00
Matthew Kennedy 9ee8616cb0 Use templated array references (#1027)
* update defs

* consumers, use default params

* setArrayValues in tests

* floats

* test fixing
2019-11-22 23:27:24 -05:00
rusefi 6c012ba0e4 v12 2019-11-18 23:54:08 -05:00
rusefi ebe6a4b981 v12 done right 2019-11-17 09:32:12 -05:00
rusefi fb7cba96b6 code formatting 2019-11-17 09:03:20 -05:00
rusefi 25298e2392 32 bit vs 64 bit compiler challenge for floats in unit tests 2019-11-10 13:57:27 -05:00
andreika-git b996190707 Industrial PID Controller (#1002)
* Implement Industrial PID controller

* Test-Use PidIndustrial in alternator

* Meaningful unit-tests for PidIndustrial
2019-11-10 13:04:27 -05:00
rusefi df291f4421 Missing dwell altogether in some corner cases fix #796 2019-11-06 00:31:24 -05:00
rusefi c9552f29bb Missing dwell altogether in some corner cases #796
getting closer!
2019-11-06 00:01:08 -05:00
Matthew Kennedy 10a6d6eb8b fix wwae (#980) 2019-10-17 00:06:54 -04:00
rusefi 88c8363f82 I guess we can simply change the magic number 2019-10-16 23:02:37 -04:00
rusefi 344136eea9 preparing for #973 2019-10-16 22:10:38 -04:00
rusefi f9fb4143a5 preparing for #973
wall wetting was not covered by any unit test?!
2019-10-16 16:46:34 -04:00
rusefi 96f432fb4c Coil duty cycle ignores dwell #977 2019-10-15 05:30:38 -04:00
rusefi 938d7739a6 Coil duty cycle ignores dwell #977
test-driven is the way to go
2019-10-15 05:16:30 -04:00
rusefi 12137fc7cd preparing for #974
code comments & refactoring
2019-10-14 06:18:08 -04:00
rusefi 5cb90d0e1b preparation for #961
more unified access to pre-calculated value
2019-10-13 09:59:06 -04:00
rusefi ca6e49dcbc preparation for #961
macro as a syntax sugar for method invocation
2019-10-10 07:28:52 -04:00
rusefi 4574aaccce I got carried away, but DEAD CODE?! 2019-10-08 03:14:21 -04:00
rusefi fbbf8995e4 wow, dead field 2019-10-08 02:17:32 -04:00
rusefi 2b59940161 really not clear what is the best place for these classes 2019-10-08 02:13:52 -04:00
rusefi 1ab488e4b4 refactoring: better field name(s) 2019-10-08 01:03:57 -04:00
rusefi ca67249522 refactoring: better field name 2019-10-08 00:54:19 -04:00
rusefi fdfd2244ce One cylinder, 4 stroke, only crank sensor needs special wasted_mode spark control #968
just a unit test for now
2019-10-07 23:12:29 -04:00
rusefi e6f5a6e3f4 refactoring: all events are now validated in relation to current timestamp 2019-10-07 23:02:47 -04:00
rusefi 0380d4d709 refactoring 2019-10-07 21:54:03 -04:00
Matthew Kennedy d1da567b85 fix gm 24x decoder (#963)
* fix gm

* fix

* fix default config, tests
2019-10-05 08:27:30 -04:00
Matthew Kennedy faa2a481ea Simplify thermistor config (#962)
* simplify thermistor config

* fix test
2019-10-02 21:00:10 -04:00
rusefi 7f9e912ea4 pid limits / etb limits 2019-09-29 14:56:18 -04:00
rusefi 3201df7fbe extracting pid test to separate file 2019-09-29 14:36:41 -04:00
Matthew Kennedy 4db887361c Fix sensor mock spill, again (#957)
* actually reset

* add test

* doh
2019-09-27 21:40:36 -04:00
rusEfi dfd5b11c8f Revert "Fix sensor mocking bug (#956)"
This reverts commit 217081c1
2019-09-27 20:33:45 -04:00
Matthew Kennedy 217081c174 Fix sensor mocking bug (#956)
* actually reset

* add test
2019-09-27 20:21:50 -04:00
rusefi 92ee072687 reducing copy/paste in unit tests 2019-09-25 09:09:32 -04:00
rusefi 45ca9d19bf reducing copy/paste in unit tests 2019-09-25 08:55:18 -04:00
rusefi 3da60a406a Merge branch 'master' of https://github.com/rusefi/rusefi 2019-09-25 08:40:56 -04:00
rusefi bc572bef51 reducing hell in unit tests 2019-09-25 08:40:33 -04:00
Matthew Kennedy ee5643f1bf Hmm, that didn't quite work right (#955)
* maybe that wasn't a good idea

* we don't need a copy because you can't clear the func after setting it

* no longer a template - move logic to cpp

* fix tests

* rename to avoid object collision
2019-09-25 07:26:56 -04:00
Matthew Kennedy 3bd1ddcc1f Sensors: composition >> inheritance (#953)
* functional sensors

* format

* tests

* sim makefile

* eol

* format tests
2019-09-24 21:11:41 -04:00
rusefi 567bd7dd58 absolute fuel pressure flow calculation #954 2019-09-24 18:39:26 -04:00
rusefi 4f33dff0a1 ETB target is using integer values fix #945 2019-09-22 18:15:00 -04:00
rusefi e7b658547b ETB target is using integer values #945
now we have a unit test! now we can fix the issue :)
2019-09-22 17:58:27 -04:00
rusefi 533087f475 ETB target is using integer values #945
refactoring - ADC mocking is a mess
2019-09-22 09:56:06 -04:00
rusEfi 9b98446846 ETB target is using integer values #945
first we will write a unit test
2019-09-22 07:58:03 -04:00
Matthew Kennedy f629ec038b add sensor framework, tests (#929)
* add framework, tests

* move oil pressure to new way

* add init logic

* brackets on the same line

* spaces -> tabs

* spaces -> tabs for tests

* bracket on same line

* hook up sensor mocking

* add nan check

* fix nan check

* I wrote an essay

* casing

* only init if we have a sensor to init

* style, actually call init

* format

* fix casing

* typo

* implement linear sensor

* wire up producer

* smarter limiting

* setup comments

* add reporting

* doxyfile

* oops

* add adc subscription

* clarity

* fix logic

* multiply voltage

* test styling

* test guards

* remove dependencies

* linear sensor test

* remove unused

* fix merge

* format, implicit convert op

* explicit

* format tests

* fix merge
2019-09-21 14:33:38 -04:00
rusefi a72d2834fb unit tests progress 2019-09-20 00:46:35 -04:00
rusefi 87875d8825 unit tests progress 2019-09-20 00:34:42 -04:00
rusefi 154092bbf5 unit tests progress 2019-09-19 22:56:54 -04:00
rusefi c59d8164c6 unit tests progress 2019-09-19 21:41:52 -04:00
rusefi bda089011c unit tests progress 2019-09-19 08:05:23 -04:00
rusefi f48f60bb36 unit tests progress 2019-09-18 21:48:46 -04:00
rusefi dfc0743e9a Delayed A/C compressor switch #922
unit tests skeleton
2019-09-12 07:31:13 -04:00
rusefi 2349ea237a Delayed A/C compressor switch #922 2019-09-11 19:30:36 -04:00
rusefi 2804b31e7e cranking fuel live data #911 2019-08-26 23:41:04 -04:00
rusefi c3d9330696 unit_tests are failing under 32 bit mingw-w64 fix #905 2019-08-25 17:38:08 -04:00
rusefi 9161703598 reducing unit test noise 2019-08-25 02:01:09 -04:00
rusefi eedf2dffcb reducing unit test noise 2019-08-25 01:19:23 -04:00
rusefi ee41d37c08 code style/type safety/docs/typos 2019-08-10 11:13:41 -04:00
rusefi f0c318aafd WTF is wrong with MRE_miata_na6 config? operationMode complexity fix #898 2019-08-08 23:11:56 -04:00
rusefi e0acec2a63 WTF is wrong with MRE_miata_na6 config? operationMode complexity #898
fatal error is the best I can come up with quickly
2019-08-08 22:57:22 -04:00
rusefi 539cd8b1c7 current toolchain does not work great with current rusEfi code, two methods with same name are hard for full text search :( 2019-08-08 22:33:52 -04:00
rusefi 121ad9b786 fixing build & taking a safer route 2019-08-08 22:12:51 -04:00
rusefi 7d73c6a8a9 WFT is wrong with MRE_miata_na6 config? operationMode complexity #898
fancy smansy unit test with some C++11
2019-08-08 21:27:57 -04:00
rusefi 643cc24931 WFT is wrong with MRE_miata_na6 config? operationMode complexity #898
more refactoring
2019-08-08 00:32:31 -04:00
rusefi f8a3d900dc migrating to google test 2019-07-25 00:28:04 -04:00
rusefi 4210754280 removing least useful engine configurations 2019-07-25 00:18:39 -04:00
rusefi 358a50a961 setDefaultBoardConfiguration shouldn't have Frankenso pinout #852 2019-07-24 22:33:30 -04:00
rusefi aca4081507 FIRMWARE_ID 2019-07-13 14:08:08 -04:00
rusefi 7cc040afe0 better variable names & fixing build 2019-07-13 08:19:00 -04:00
rusefi 04bc1128df support multiple VVT sensors #885
new fields & packing configuration. bumping configuration version
2019-07-12 14:24:45 -04:00
Matthew Kennedy 77075fce3d Fix some maf logic (#880)
* fix maf

* thank you vscode for mangling ANSI -> utf8
2019-07-10 09:14:47 +03:00
rusefi 452455fc99 Missing dwell altogether in some corner cases #796
skeleton
2019-07-01 15:04:39 -04:00
rusefi 37a9e66bc1 Annotations in C++ code to produce formulas in rusEfi console #807 2019-06-19 22:34:11 -04:00
rusefi 9b1d57adf6 I like static_cast 2019-06-17 10:22:43 -04:00