Commit Graph

27 Commits

Author SHA1 Message Date
Matthew Kennedy a50fdf34d4 avoid UB in tests 2024-03-23 07:54:27 -04:00
rusefi 415b3d55df Technical debt: ENUM_32_BITS #3874
poking the bear
2023-06-01 01:45:53 -04:00
Andrey 66178285b1 making test stronger 2023-02-20 22:25:24 -05:00
rusefillc 24cdca5515 refactoring: method name 2022-12-27 00:13:13 -05:00
rusefillc e189d6517b random Frankenso clean-up 2022-12-14 19:29:01 -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 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
Matthew Kennedy 8cdac4cac0
remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
Matthew Kennedy 9797d25b7c
getOrZero (#3319) 2021-10-05 19:59:07 -04:00
Matthew Kennedy db12cdbe19
put MAP in the sensor model (#3292)
* map averaging in sensor model

* deadly, deadly code!

* mpxh

* Revert "deadly, deadly code!"

This reverts commit 346fe25267.

* comments

* sensor types

* last sensor

* channel init

* correct spot

* deinit properly

* simplify

* fix

* mocks

* map init test

* showInfo

* comment

* singleton identity function

* sensor info print

* multiple cylinder averaging buffer

* comments

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-04 17:18:08 -04:00
Matthew Kennedy a18b86a09b
start allowing ADC change while running (#3100)
* allow re-register of the same sensor

* add api to unsubscribe

* do it for tps

* clear the pin

* happy test

* maybe make afr happy for now

* tests build

* happy simulator

* active configuration

* check valid

* we need vbatt now

* manage all pin init in init_sensors.cpp

* don't need that

* cleanup

* thermistors

* do two phase reinit in the right place

* config vs engine

* finally the tests are happy
2021-08-24 16:41:16 -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
Matthew Kennedy acdf6fdc85
Put map in the sensor model (#2161)
* hook up map

* check for init

* switch some consumers

* don't do limp for now

* oops

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-30 08:43:49 -05:00
Matthew Kennedy a08e79789d
second lambda (x-series CAN only, for now) (#2048)
* add sensor

* second sensor

* switch sensor name

* gobblin up your memory

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-09 20:26:23 -05:00
Matthew Kennedy 67269aa637
maybe fix sensor init checks (#2034)
* enums

* don't collide

* auto_generated_enums

* check based on new enum val

* maybe this will make generate tool happy

* add a test

* fix test

* fix and add another test

* make clang happier

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-06 23:19:57 -05:00
rusefillc b3d45b909f Revert "switch rpm calculator to use timer class (#2005)"
This reverts most of a26ed3eb5a commit.
2020-12-06 18:05:53 -05:00
Matthew Kennedy a26ed3eb5a
switch rpm calculator to use timer class (#2005)
* add api

* rpm calculator

* fix fsio

* fix float

* remove wrong comment

* fix timer

* clang didn't like this

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-06 16:01:45 -05:00
rusefillc 29141055ab one step back #2017 2020-12-06 08:50:10 -05:00
Matthew Kennedy 2d9be1077b
require TPS values to be different (#2017)
* require values to be different

* fix not

* oops

* missed another spot

* test negative cases too

* resets

* test no sensor case

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-06 00:41:49 -05:00
Matthew Kennedy 5fec6d0c04
move lambda in to sensor model (#1736)
* lambda sens

* fix init

* fix

* a test for good measure

* he's climbin in your windows, snatchin you ram up

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-09-01 16:22:31 -04:00
rusefi efdaef81af this does not go as planned :( 2020-08-31 08:02:29 -04:00
rusefi 24cf51e883 this does not go as planned :( 2020-08-31 07:54:45 -04:00
Matthew Kennedy 0290a268ab
Redundant accelerator pedal (#1470)
* add second boudns

* init logic

* test changes

* reconfigure correctly

* rams
2020-05-23 19:48:32 -04:00
Matthew Kennedy 9dda1a21bc
Redundant tps (#1427)
* add redundant sensor

* add tests

* add configure, info printing

* tests

* tests

* partial hookup

* fix

* fix

* bad makefile merge

* use second TPS config

* update test

* update test

* sensor names

* set second pin by default

* fix auto cal

* auto cal both sensors

* add reconfigure of secondary sensors

* gobblin' up your ram

* slow down write a little bit

* put split in debug gauge

* s

Co-authored-by: Matthew Kennedy <matthew@mck-mbp-15.local>
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-05-18 14:32:00 -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 595df15dfd
fix (#1268) 2020-04-06 09:00:26 -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