Commit Graph

614 Commits

Author SHA1 Message Date
Scott Smith cbc7c61b3e
Fix potential buffer overrun in cyclic_buffer. (#3583)
This exposed a buffer overrun, so double the size of the buffer (to account for 720 degree engine
cycle vs 360 degree crank events).

Also use proper numeric limits when computing min/max.
Finally, add a lock around the call to cyclic_buffer that actually caused the contention.
2021-11-20 03:01:11 -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
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
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
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 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
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
Andrey c18204325c refactoring launch 2021-11-15 19:34:42 -05:00
Matthew Kennedy cb032fb1ea
(void) -> () (#3550)
* static functions with (void)

* more

* Revert "more"

This reverts commit 246e53441f.

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-15 13:02:34 +01:00
Matthew Kennedy 145316c497
less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
rusefi c8d666c5a1 Lua: changing "table" API 2021-11-14 16:29:46 -05:00
rusefi fcf0d68849 more API 2021-11-14 14:53:44 -05:00
rusefillc 825a57e33a Overflow in currentTimeMillis and getTimeNowSeconds #3531
it now takes 1000 times longer to overflow
2021-11-11 16:39:23 -05:00
rusefillc fe25b24050 dead code 2021-11-08 19:01:18 -05:00
Scott Smith 13c496b79b
Make getTimeNowNt even faster (#3504)
The last version is already much better than the original, mostly because it doesn't call
CriticalSectionLocker, which has a ton of overhead due to debug tracking.  But this version is
another 4 instructions / 12 bytes shorter.  Does as much match in 32-bit land as possible, and
avoids math operations that span 64-bits (i.e. either operate on the lower half or upper half, but
not both).  The result is only 3 instructions not including the necessary 4 loads (ptr to now, now,
ptr to upper, upper), 1 store (upper), and 1 return/branch.
2021-11-08 14:24:31 -05:00
Scott Smith 6d38fe1eb3
Allow scaled_channel to have both multiplier and divisor (#3468)
Disallow scaled_channel for float.  I can't think of a reason to allow it, and it gets in the way
of rounding.

Add separate template param to setTable; let the compiler sort out whether assignment can happen
between TElement and VElement without forcing them to be the same at function call time.
2021-11-05 17:34:22 -04:00
racer-coder 31539035b7
Create an interpolate3d function to match the interpolate2d, but for 3d tables. (#3459)
Remove some implicit C array to pointer conversions in Map3D by adding
(), *, and & where appropriate.  This allows us to remove getBinPtr.

Call interpolate3d from Map3d so there's no code duplication.
2021-11-04 14:07:37 -04:00
Matthew Kennedy 24224729a3
support autoscale on table axes (#3452)
* scale map Y axis

* allow different row/col types

* scaled channel detector

* interpolation

* looks like this actually works

* tests, no manual scaling

* comment
2021-11-03 19:53:26 -04:00
Andrey b188c70823 docs 2021-11-02 23:34:44 -04:00
Andrey 747bbd9c6a warning(CUSTOM_PID_DTERM, "PID: unexpected dTime") 2021-10-29 18:31:43 -04:00
Matthew Kennedy 383d8caad9
Lua CAN RX (#3403)
* wiring

* static

* implementation

* comment

* unit tests happy

* guard

* guard smarter, not harder

* guard smarter not harder

* guard even smarter, not even harder

* don't need that
2021-10-24 08:37:04 -04:00
rusefillc 8f6420ba98 pid into lua 2021-10-21 19:43:30 -04:00
rusefillc 6bbabbf1fe refactoring 2021-10-20 21:47:49 -04:00
GitHub build-firmware Action 981fc58297 Auto-generated configs and docs 2021-10-17 01:13:47 +00:00
rusefillc 292173f818 progress - live doc generator works again! 2021-10-16 21:08:50 -04:00
rusefillc 4cc1c352c2 better file locations 2021-10-16 20:17:01 -04:00
Matthew Kennedy 0e2af73e9c
Knock count (#3240)
* knocky knocky

* check the right thing

* improve operator

* TS

* s

* bbbbb
2021-09-20 14:27:26 -04:00
Andrey 5afda5f2cc SD-card log fields improvement (warning counter & last code) #3162 2021-09-05 07:25:52 -04:00
Andrey 03ffa82d8e zero dwell warning at zero RPM #3153 2021-08-16 09:11:22 -04:00
rusefillc 32a650ebe8 zero dwell warning at zero RPM #3153 2021-08-16 04:20:32 -04:00
Matthew Kennedy 2ad4a9df1e
actually remove FSIO idle stuff (#3150)
* debug mode

* pid cleanup

* more dead

* more dead

* wow more dead

* much dead many death wow
2021-08-14 09:48:45 +03:00
Matthew Kennedy d24f1462e2
even more pch (#3112)
* s

* more

* s

* f7
2021-08-04 19:30:52 -04:00
Matthew Kennedy 25414ebdad
yet more pch (#3068)
* big pch energy

* put back ramdisk stub

* tests are happy

* h743 nucleo

* kinetis

* I love deleting code!

* make stepper happy

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-08-03 22:05:01 -04:00
rusefillc caea5283ae Faster enginePins.stopPins() #3070
refactoring: reducing magic constants
2021-07-28 14:14:51 -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 f6095b8339
fix nonlinear correction threshold (#3060)
* s

* macro

* test has to do the inverse
2021-07-25 20:42:26 -04:00
Matthew Kennedy 5e08907590
knock sensing peak detect (#2910)
* knock peak detect

* comments

* comment

* initialize

* test

* fix warnings while we're here

* those are functions, not values

* ram
2021-07-06 21:44:59 -04:00
Andrey G 0afd3c83df
Fix swap macro (#2904)
* convert swap macroses to inline functions

* clean-up workarounds
2021-07-04 18:03:17 -04:00
Andrey 8bd4a846ae more details into error message 2021-07-02 19:05:54 -04:00
Matthew Kennedy 219d9feaef
Check that table axes are ascending (#2866)
* templated interpolation check

* check tables
2021-06-26 15:02:25 -04:00
Matthew Kennedy 3ef969d743
warnings & assorted cleanup (#2793)
* lua hook

* validateBuffer

* tables

* simplify fsio table

* test

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-03 14:30:25 -04:00
David Holdeman 6d4060d824
Doxygen titles (#2728)
* move addRow call

* undo submo bump

* add header titles
2021-05-22 22:10:58 +03:00
Matthew Kennedy de7879b6e4
convert a table to scaled_channel (#2724)
* scaled VE table

* use setTable

* efi::clear

* ratio -> struct
2021-05-20 20:00:32 -04:00
Matthew Kennedy b398d03f5f
rewrite table3d (#2723)
* post cranking factor limits

* sensible defaults

* but not for tests

* add pointer version of get bin

* test via map3d

* put that back for a minute

* new impl

* fix order

* rename and fix table orientation

* flip the table to the correct orientation

* dead cleanup, rename

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-05-20 22:31:16 +03:00
Matthew Kennedy 5a5f25244a
make the simulator usable (#2717)
* these start themselves now

* dead

* configure ports

* start serial

* dead

* minimal pins

* simulator logging works

* why not enable lua

* speeeeeed

* start lua

* spammy print
2021-05-17 12:44:02 +03:00
Matthew Kennedy 84368cae10
Config generator jar (#2716)
* fix test

* jar

* kick config

* guard stuff

* nmea

* nmea

* nmea

* c++ is type safe, which is good

* c++ is type safe
2021-05-17 12:32:59 +03:00
Matthew Kennedy 6a060e5cae
remove intermediate buffer (#2668)
* remove define

* goodbye intermediate logging buffer

* free ram! woo!
2021-05-10 08:01:24 -04:00
Matthew Kennedy dd6105cfa3
shrink canned tables (#2651)
* helper

* use it miata

* do type safe copy

* miata vvt

* etb

* default iat correction

* magic is afoot here

* hunchback

* misc

* neon

* neon

* aspire

* citroen

* neon

* missed one

* dead

* festiva

* remove andreyism

* very dead

* no need for copy of that function

* cleanup
2021-05-09 14:37:16 -04:00
Andrey G e6cf82845b
Kill warnings (#2623)
* dead code

* rtc_helper: clean-up warnings

* kill unused
2021-05-04 18:55:27 -04:00
Matthew Kennedy a25773a11b
more Lua hooks (#2605)
* more hooks

* zero index

* test table hook

* test works

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-29 22:22:04 -04:00
Matthew Kennedy 830575a306
lua 5.4 (#2590)
* thread priority

* build

* makefile prep

* call startup

* lua 5.1

* mk

* 5.3

* mk

* I guess lua does something?

* extract hooks, builds for tests

* a bit of error handling

* guard

* bootloader makefile

* remove lua

* submodule

* submodule update

* builds with submodule

* disabled by default

* h7 chconf

* tweaks

* add a useful hook

* move luaconf

* perf trace lua

* test helpers

* lua unit tests

* include to satiate clang
2021-04-28 22:41:25 -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 a21fb0087d.

* unused

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 15:33:40 -04:00
Matthew Kennedy ad71016862
rip the bandaid: find-replace most of scheduleMsg (#2572)
* biiiig find replace

* more trivial find replace

* pwm

* almost all of them

* few more

* gpio

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 12:53:13 -04:00
Matthew Kennedy bd1c84fa62
Logging remove 3 (#2568)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

* vvt

* more

* idle

* missed one

* dynoview

* launch

* can

* console IO

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-20 14:09:41 -04:00
Matthew Kennedy 5145ee4b62
logging cleanup 2: sensors, pid, etb, etc (#2567)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 20:02:32 -04:00
Matthew Kennedy e3fcbdc7c0
ts logger (#2566)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 19:13:48 -04:00
Matthew Kennedy 6b64db7f9c
rewrite text logging system (#2439)
* minor cleanup

* enable mailboxes

* priority

* implement new logger

* more cleaning

* signature

* remove debug

* put the assertion back in

* remove debugging

* spelling

* doy

* tweaks & comments

* cleaning

* size_t

* guard more

* test build now

* needs more ram until we can remove LogginWithSTorage

* hunt for memory

* bootloader

* unused

* stub simulator

* it would help to get the signature right

* geez kinetis only has 64k ram

* more guarding because kinetis

* that's now very legal and very cool

* templatify

* s

* force null terminate

* probably fix

* const

* write a test

* disable sensor chart for now

* hide SC ui

* oh nope that breaks many things

This reverts commit c3c1bb324f.

* missed one

* reset after scheduleLogging

* we can't print out the full message because it contains commas which break parsing

* force terminate long buffers

* let's see how much memory we have to play with

* a lot, is the answer

* real thread name

* shrink this for now before its deleted

* turn that back on

* biiig comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 18:46:47 -04:00
Matthew Kennedy b110e01638
constexpr-ify log field list (#2548)
* constexprify

* reclaim ram

* more constexpr

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-13 20:16:18 -04:00
Matthew Kennedy 5e2e18d2b9
improve sensor chart flush behavior (#2545)
* disable sensor chart

* type signature, guards

* we can't log the message as that confuses the parser

* dead

* this syntax was technically illegal

* more

* turn it back on

* remove config

* api

* implement

* ui

* java ui
2021-04-12 14:05:52 -04:00
rusefillc 6eb68aa4a1 helping us trace CUSTOM_INTEPOLATE_ERROR 2021-04-08 16:14:06 -04:00
Matthew Kennedy 4e3e95db2d
replace print/printMsg with scheduleMsg (#2497)
* start cleaning

* disabled feature means don't print that it's disabled

* cli

* usages

* printMsg -> scheduleMsg

* this is alllll dead now

* no crlf please

* all hope is lost if you manage to hit this line

* tests

* tests

* ok we did actually need that part

* sim

* d

* kinetis

* it did ifdef, not if

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-26 17:23:26 -04:00
Matthew Kennedy 95b08c433f
Implement nonlinear fuel level sender (#2473)
* table function

* config fields

* sensor type

* switch consumers

* init the sensor

* ui

* 1mv resolution

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-19 08:39:08 -04:00
Matthew Kennedy a931928a61 type signature, guards 2021-03-15 17:11:11 -04:00
rusefillc 490d3a6957 test_timer 2021-03-12 00:43:48 -05:00
Matthew Kennedy 990c3649ae
logging cleanup before refactor (#2438)
* minor cleanup

* more cleaning

* signature

* spelling

* doy
2021-03-09 08:43:29 -05:00
Matthew Kennedy 053835a1c0
error accumulator (#2434)
* error accumulator

* makefile
2021-03-08 07:40:46 -05:00
Matthew Kennedy 5a4c24f9a5
virtual zero timer (#2426)
* virtual zero timer

* it would help to call the correct function

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-07 15:32:41 -05:00
Matthew Kennedy 4a1d3de9a6
remove unused msg parameter (#2360)
* dead parameter

* last few
2021-02-16 09:32:16 -05:00
Matthew Kennedy 0e70d08a22
Add fallback map table (#2248)
* table

* sd math

* config

* debug channel name

* ptr vs not ptr

* actually use return value

* memory

* less magic
2021-01-31 17:19:06 -05:00
Matthew Kennedy 604b0cd527
templated interpolate2d (#2221)
* template table2d

* assertions

* oops

* tests

* test bins too

* more assert

* format

* explicitly handle and test NaN

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-11 08:00:15 -05:00
Matthew Kennedy d0c71d758b
update biquad (#2201) 2021-01-08 19:48:56 -05:00
rusefillc 43f37c677a RAM efficiency of VR crank trigger shapes #2182
Audi OEM 5-cyl trigger pattern aka "Tri-Tach" https://rusefi.com/forum/viewtopic.php?f=5&t=1912

fixing build?
2021-01-04 22:13:59 -05:00
rusefillc 9b5d45cb04 Audi OEM 5-cyl trigger pattern aka "Tri-Tach" https://rusefi.com/forum/viewtopic.php?f=5&t=1912 2021-01-04 21:05:16 -05:00
Matthew Kennedy 08e2e37b9f
simplify confirmation (#2131) 2020-12-24 16:54:22 -05:00
Matthew Kennedy 67d0d7b330
handle negative timer delta (#2110) 2020-12-21 06:16:58 -05:00
rusefillc b41ca74386 clang warnings again #2055 2020-12-11 12:50:10 -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
Matthew Kennedy ffae0cd335
round rpm instead of truncating (#2023)
* round rpm instead of truncating

* efiround is expensive

* Revert "efiround is expensive"

This reverts commit e5690f89e1.

* round is better than rintf

* testing

* it works now?!

* comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-06 00:11:57 -05:00
rusefillc e5ef8de2ae unit tests in clang #2012 2020-12-04 23:59:21 -05:00
Matthew Kennedy f1f64bd3e5
add timer since last trigger tooth (#2004)
* add elapsed time to timer

* store trigger time

* fsio method

* don't do a 64b divide

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-03 11:13:45 -05:00
rusefillc 7dbc9afa38 Avoid float -> int64 conversion #1993 2020-12-03 10:31:16 -05:00
rusefillc df5c33ea86 Avoid float -> int64 conversion #1993 2020-12-03 10:26:50 -05:00
Matthew Kennedy d48367d565
timer (#1994) 2020-11-30 19:35:06 -05:00
rusefillc 90e5630e60 avoid float -> int64 conversion #1977
cherry picking...
2020-11-23 23:33:46 -05:00
Matthew Kennedy 747b3d2fa8
fix #1968 (#1976)
* tanf

* name

* comment, add test
2020-11-22 08:26:17 -05:00
Matthew Kennedy f3b7a1d9da
Remove lockAnyContext, replace with CriticalSectionLocker (#1938)
* switch to CriticalSectionLocker

* that's just about all

* clean up last usage

* include hpp for sim

* need the cpp wrappers in the makefile too

* include dir

* include
2020-11-19 06:56:02 -05:00
rusefillc 4c9c8d42bf Starter seems to be engaged forever #1965 2020-11-18 19:51:51 -05:00
Matthew Kennedy 5d3d85d644
put getTimeNowLowerNt in to mpu_util (#1950)
* put getTimeNowLowerNt in to mpu_util

* move GPTDEVICE to port_mpu_util

* and remove from efifeatures
2020-11-18 14:17:00 -05:00
Matthew Kennedy 09b41bb1bb
Everything in lambda! (#1893)
* lambda

* default configs, fix build

* config, gauge, UI

* more digits

* change menu text

* fix that while I'm here

* doesn't need extra word

* todo note

* tests

* last test

* missed a config

* update java

* store target lambda

* more java

* format

* hopefully enough java for CI to pass
2020-10-26 18:15:17 -04:00
Matthew Kennedy 4e249889a6
implement fuel pressure sensors (#1897)
* add

* remove old

* remove more old

* makefile

* fix init

* patch up other stuff

* actually fix it this time

* raw output channels

* gauges, UI

* scaled channel

* fix field ordering
2020-10-23 07:31:47 -04:00
Andrey G 9359c15cc1
common.h: define MIN and MAX macro only if nod defined yet (#1896)
This fix compilation error for Kinetis and Cypress if common.h
is included after platform includes which also defines MIN MAX.
2020-10-22 08:41:44 -04:00
rusefi e12e3f9dc6 progress 2020-10-22 00:57:11 -04:00
Matthew Kennedy 2083b34cf9
simplify getTimeNowNt() (#1876)
* remove old impl

* add cpp wrapper to os_access

* clean up os_access

* remove touchTimeCounter

* new impl

* put comment about lock free impl

* include cpp wrappers for BL

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-10-15 08:57:13 -04:00
rusefi 9653eebe9d Trigger sync lost every 2^32 CPU cycles #1873
only a random code comment
2020-10-11 18:17:30 -04:00
Matthew Kennedy 6ac9aad358
display base fuel mass in milligrams (#1838)
* switch to mg

* use the correct thing

* gauge scaling

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-09-30 20:19:51 -04:00
Matthew Kennedy 97cb9f45bd
logging simplification: switch bare functions to member functions: try the second (#1794)
* first pass

* first pass

* const means we don't have to check!

* static

* test fixup

* fix sniffer
2020-09-13 11:49:25 +03:00
rusefi 256a4a2637 Revert "logging simplification: switch bare functions to member functions (#1788)"
This reverts commit d941bdc5
2020-09-12 04:36:24 -04:00
Matthew Kennedy d941bdc502
logging simplification: switch bare functions to member functions (#1788)
* first pass

* first pass

* const means we don't have to check!

* static

* test fixup
2020-09-12 03:08:11 +03:00
Matthew Kennedy 04877b8b95
define map3d functions in class (#1785)
* define in class

* don't keep an extra flag
2020-09-10 22:03:16 -04:00
Matthew Kennedy eebded8caa
scale tables using type system (#1776)
* store scale in the type

* efi ratio

* boost control scaling

* fix boost tests
2020-09-10 18:44:10 -04:00
rusefi d06690b3b6 Hellen says cyclic buffer 2020-09-07 11:35:02 -04:00
rusefi c6c0bcbd1a helping Kinetis? 2020-09-06 23:17:13 -04:00
rusefi 7d0c8b4870 microRusEFI used as Body Control Module BCM BCU
got stack too low warning with DBG_CAN
2020-09-06 21:45:17 -04:00
Matthew Kennedy 42737ef74e
fix expected (#1754) 2020-09-03 14:56:55 -04:00
Matthew Kennedy 1a55085bb6
Software knock detection (#1730)
* s

* science

* set pin mode

* turn stuff off so it fits

* filtering maybe

* filtering actually works

* generate filter parameters internally

* shorter window

* guard behind enable flag

* use checked in filter

* add biquad reset

* tracing

* const

* exec order

* do it from a thread

* smaller buffer, comment

* configure with header

* only for proteus

* oops

* unused

* not needed

* guards

* pin config

* don't need that include

* precook filter steady state

* define sample rate

* config enable switch
2020-08-28 21:13:50 -04:00
Matthew Kennedy 733008b9d0
Analog input filtering (#1680)
* improve biquad

* cleanup

* add filtering to subscriptions

* config sensors

* comment

* doesn't need to be that fast

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-08-21 19:47:12 -04:00
Matthew Kennedy c53979a017
Configurable stoichiometric ratio (#1710)
* configurable stoich ratio

* afr table always in gas afr

* default

* typo

* use defined ratio

* do it in config too

* missed a spot

* oops wrong one

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-08-21 19:43:30 -04:00
rusefi 8764693179 TS SD integration #1653 2020-08-07 00:59:00 -04:00
rusefi 526e02af53 TS SD integration #1653 2020-08-06 22:05:26 -04:00
rusefi ede4616614 Stack usage is still all over the place #1662 2020-08-02 11:39:20 -04:00
Matthew Kennedy aac641b1f4 don't use register keyword 2020-07-29 02:40:10 -07:00
Matthew Kennedy 5e7585501c even more dead 2020-07-29 02:36:47 -07:00
Matthew Kennedy 6d102fcdca more dead 2020-07-29 02:34:30 -07:00
Matthew Kennedy fc112d2526 dead code 2020-07-29 02:32:48 -07:00
Matthew Kennedy dbd2827f41 now unused table 2020-07-21 00:07:49 -07:00
rusefi 1ae1af46d8 Stefan, I want to drink from the same fountain of patience 2020-07-12 15:00:44 -04:00
rusefi 7735758ec5 PidIndustrial does not limit iTerm fix #1599 2020-07-11 15:30:40 -04:00
rusefi 88bbd25042 PidIndustrial does not limit iTerm #1599 2020-07-11 15:05:18 -04:00
rusefi 29e3c71df4 https://rusefi.com/forum/viewtopic.php?p=37401#p37401 2020-07-10 14:19:51 -04:00
rusefi c0bb907aa3 idle_min through FSIO not working as intended #1553
FSIO debug outputs progress
2020-07-04 21:32:12 -04:00
rusefi ffedbbe4d3 FATAL error: lsize mismatch 336/3342 #884 2020-07-04 00:31:29 -04:00
rusefi e9a949b09c FATAL error: lsize mismatch 336/3342 #884 2020-07-04 00:02:27 -04:00
andreika-git 1e8bebd5b3
Gen config refactor 2 (#1560)
* gen_config refactor, part II

* short board defines

* oops

* comment & undef

* define QUOTE

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2020-07-02 12:33:31 -04:00
rusefi 7d8384d7fa 1 byte issue in TuneReadWriteTest fix #1512 2020-06-18 23:29:08 -04:00
rusefi 31f01bf26b 1 byte issue in TuneReadWriteTest #1512 2020-06-18 22:51:07 -04:00
rusefi 8b4f6103de reducing constant dupliation 2020-05-31 13:40:48 -04:00
rusefi a4329169e9 better file name 2020-05-25 13:02:05 -04:00
rusefi 0a5cf07956 funny that THIS would happen 2020-05-23 22:11:09 -04:00
Matthew Kennedy 445f1c28f4
dead datalog code (#1439)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-05-16 00:11:52 -04:00
dron0gus e7991eacf8
Some bit, unaligned and different endian access helpers (#1436)
* util: add some common macros

* util: add unaligned access helpers
2020-05-15 15:55:06 -04:00
Matthew Kennedy e2974cfeda
short term fuel trim: part 2 (#1405)
* add tooltip

* add other direction to deadband

* add impl

* test partitioning

* makefile

* wrong comment

* fix include
2020-05-07 08:52:32 -04:00
rusefi 2cfb6bff38 steps towards tle8888 2020-05-06 19:15:52 -04:00
rusefi 62c89a39da class constructors are a great way to have simple initialization sequence 2020-05-03 11:49:06 -04:00
Matthew Kennedy 9779049238
actually use msg parameter (#1372) 2020-04-27 07:56:38 -04:00
Matthew Kennedy f128b33694
General purpose PWM: implementation & tests (#1366)
* config

* significant digits

* renumber enum, no need for a "none"

* ui

* impl base

* error handle MAP

* init & update

* don't need arg

* don't lie about sensor

* fix test build

* test stub

* initialize

* null check

* fix clamping

* test output

* types & enums

* don't need param

* test getOutput

* fix

* output pin instead of brain pin

* default config
2020-04-26 14:06:28 -04:00
Matthew Kennedy bfc6d10b5b
types & enums (#1367) 2020-04-25 18:26:29 -04:00
rusefi 656331ebe9 reducing code duplication 2020-04-20 15:57:03 -04:00
Matthew Kennedy 0619575716
ETB testing: output, position clamping (#1333)
* add clampf

* more tests

* public

* missed a mock

* fix output duty clamping

* do it that way

* more

* ah ha!

* test negative too

* clamp pedal

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-20 13:52:20 -04:00
Matthew Kennedy 75b009bbae
Closed loop controller base & ETB testing (#1322)
* closed loop controller base

* etb tps test

* closed loop controller tests

* test support

* update gtest

* fix for change

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-19 17:18:47 -04:00
Matthew Kennedy 0d699bcfe9
Improve unexpected (#1323)
* use type instead of value

* fix remaining initializer-list users

* impruv

* last consumer?

* consumer

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-19 08:37:43 -04:00
Matthew Kennedy 7f60384c75
add expected helper class (#1321)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-19 01:53:04 -04:00
Matthew Kennedy ff867b9301
fix warnings (#1282)
* warnings

* don't need to template those
2020-04-12 09:39:14 -04:00
rusefi 988ee244f3 lib function by Dron0Gus 2020-04-06 11:29:40 -04:00
Matthew Kennedy 200bfe3f80
Deadband helper & tests (#1267)
* deadband

* header

* comment
2020-04-06 09:16:26 -04:00
rusefi a47dce4025 code style 2020-04-01 21:32:21 -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 608cf45d26
TS cleanup pass (#1225)
* remove biquad config

* fuel pump clarity

* one code usage

* minimal generate for ci

* and don't build it either

* remove commented out code
2020-03-25 23:00:17 -04:00
rusefi ebe67b6be3 fine 2020-03-24 16:46:36 -04:00
rusefi ef6f3d567e simpler API? 2020-03-24 02:33:20 -04:00
rusefi 1fc22fcfae code style 2020-03-23 00:00:11 -04:00
Matthew Kennedy e605b39ab1
const (#1193) 2020-03-18 21:55:46 -04:00
Matthew Kennedy 0b72db0811
split out scaled channel header (#1156)
* split out scaled channel header

* update header
2020-02-24 16:47:10 -05:00
rusefi c2f0a30397 opening the door to boost controller! 2020-01-31 14:23:15 -05:00
rusefi d48a57d599 refactoring: extracting DEEP_IN_THE_PAST_SECONDS contant 2020-01-31 01:21:56 -05:00
rusefi 83b1ca00a4 code style 2020-01-21 01:40:11 -05:00
Matthew Kennedy ba0c48e0ac use NT_PER_SECOND instead of convert from microseconds (#1107)
* add NT_PER_SECOND

* missed a few

* inject tooth logger timestamp

* inject
2020-01-19 22:23:41 -05:00
rusefi bb217b01dd happy new year unification 2020-01-13 21:57:43 -05:00
Matthew Kennedy ecd240d6f2 AEM X-Series CAN Wideband Support (#1096)
* aem xseries

* parens to avoid operator precedence issues

* put in cfg

* disable that too

* fix sim/unit

* enough generated for ci

* this will guard correctly
2020-01-12 03:44:37 -05:00
rusefi b83a5310be happy new year 2020-01-08 00:02:40 -05:00
rusefi a08258ba8e style 2019-12-23 23:05:40 -05:00
rusefi 609865da0f hopefully useful macro? 2019-12-21 21:18:38 -05:00
Matthew Kennedy eb27bcf3d6 Terrible ADC3 hack for Proteus vbatt support (#1066)
* this is a great idea!

* typo

* simplify

* simplify, cache coherency

* enable adc3 in board file

* copyright

* fix tests, probably
2019-12-17 08:34:56 -05:00
Matthew Kennedy f90a5e48eb const (#1062) 2019-12-16 20:36:40 -05:00
Matthew Kennedy 00840d99ec copyArray helper (#1048)
* add functions

* uses

* use for proteus

* do it for warmup mult

* do it for cranking settings

* cleanup
2019-12-10 18:04:50 -05:00
andreika-git 2a39c69f51 iacPidMultTbl + EFI_IDLE_PID_CIC + kinetis_hysteresis (#1043)
* rename EFI_IDLE_INCREMENTAL_PID_CIC -> EFI_IDLE_PID_CIC

* Impl. IacPidMultTable

* Kinetis: Trigger Comparator Hysteresis settings (+adaptive mode)
2019-12-04 00:37:32 -05:00
rusefi 4305b4ce2f not needed since included in common_headers.h 2019-11-23 18:16:41 -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
Matthew Kennedy 3514eb313e const + fwd declare pid things (#1024) 2019-11-22 15:55:38 -05:00
rusefi 7dfdfc6378 docs & code formatting 2019-11-19 18:17:03 -05:00
andreika-git 9f33df9574 cisnan() warnings fix (#1008)
* Fix cisnan() macro warnings (strict-aliasing)

* Hey, we found a bug thanks to our fix! Let's fix it too!
2019-11-17 08:08:56 -05:00
Matthew Kennedy 8969efaffe fix (#1005) 2019-11-13 08:42:16 -05:00
rusefi 4b1c1e72ab time to panic and revert more 2019-11-12 21:42:44 -05:00
Matthew Kennedy 0570ef4c42 Fix (#1004)
* Revert "fixing build"

This reverts commit 22da8a7dfe.

* undo overzealous ifdef cplusplus
2019-11-12 01:13:13 -05:00
rusefi 22da8a7dfe fixing build 2019-11-12 00:50:30 -05:00
Matthew Kennedy 9ce18d11fe use static asserts (#1003) 2019-11-12 00:39:38 -05:00
rusefi f082ac48b1 refactoring: time to unify digital pin API 2019-11-11 23:04:27 -05:00
rusefi 669c75d44f trying to fix integration tests
[java] 2019-11-10_13_31_42_194<EOT>: msg,FATAL error: PID::isSame invalid,
     [java] 2019-11-10_13_31_42_194<EOT>: postMessage EngineState: FATAL error: PID::isSame invalid
     [java] 2019-11-10_13_31_42_289<EOT>: Sending packet 4F 00 00 64 01
     [java] 2019-11-10_13_31_42_289<EOT>: output channels header: waiting for 2 byte(s)
     [java] 2019-11-10_13_31_42_290<EOT>: IncomingDataBuffer: 256 byte(s) arrived
     [java] 2019-11-10_13_31_42_290<EOT>: output channels body: waiting for 361 byte(s)
     [java] 2019-11-10_13_31_42_291<EOT>: IncomingDataBuffer: 107 byte(s) arrived
2019-11-10 16:07:13 -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 42dc9e3662 fancy C++ s/NULL/nullptr/ 2019-10-08 01:26:35 -04:00
rusEfi 7c9a7d34b4 PID display in console was broken 2019-09-27 23:37:57 -04:00
Matthew Kennedy b4e176a9cb fix ltoa_internal: fix #948 (#949)
* fix ltoa_internal

* fix hex
2019-09-23 08:45:45 -04:00
rusefi 712eca7b15 typo in comment 2019-09-23 01:39:04 -04:00
rusefi 4f33dff0a1 ETB target is using integer values fix #945 2019-09-22 18:15:00 -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
andreika-git 21cbf1cf91 PID_CIC docs (#930) 2019-09-12 07:30:18 -04:00
rusefi a6fbc5036a Delayed A/C compressor switch #922 2019-09-11 20:46:50 -04:00
rusefi e30000f1ca OOP all the way, maybe too much OOP? :) 2019-09-11 20:23:25 -04:00
rusefi 917676b2da simulator crashes on any TS setting change fix #924 2019-09-09 20:49:16 -04:00
rusefi e79287f537 Delayed A/C compressor switch #922 2019-09-08 21:05:03 -04:00
rusEfi 8126b700de NB2 progress, ETB Live Docs progress 2019-09-01 19:37:58 -04:00
rusEfi f960587dc0 dead fields & better field name 2019-09-01 18:41:51 -04:00
rusefi 1ffaa8eea2 Live Data progress 2019-09-01 13:56:46 -04:00
rusefi ad2714c2b8 PID errorAmplificationCoef to LiveData 2019-08-30 17:11:12 -04:00
rusefi 9161703598 reducing unit test noise 2019-08-25 02:01:09 -04:00
rusEfi 6c9d684dfd MRE etb 2019-08-17 17:33:44 -04:00
rusefi efeb6eeadc ETB live docs 2019-08-15 21:01:04 -04:00
rusefi 9d32f2c40a refactoring: ChibiOS now offers native 'lockAnyContext' pattern 2019-08-11 15:23:15 -04:00
rusefi 91f9a50b3f F7 nucleo does not work?
funny, it was about some very unused feature
2019-08-02 01:36:02 -04:00
rusefi 90d6c37ff8 docs typo 2019-07-21 17:05:41 -04:00
rusefi 4b0ed3751f More than one aux pid #866
progress!
2019-07-12 08:31:38 -04:00