Commit Graph

7509 Commits

Author SHA1 Message Date
Andrey a42a52bb2e MAP phase sensing #3544 2021-11-24 22:35:56 -05:00
Andrey 4e45297145 minor progress 2021-11-24 22:35:56 -05:00
GitHub build-firmware Action 83fc9e21bd Auto-generated configs and docs 2021-11-25 03:31:35 +00:00
Matthew Kennedy 5752b4ba92 bye (#3609) 2021-11-24 22:03:17 -05:00
GitHub build-firmware Action fb372ea639 Auto-generated configs and docs 2021-11-25 02:45:07 +00:00
GitHub set-date Action 5fa859eacf Update date 2021-11-25 01:01:18 +00:00
Matthew Kennedy 5f01898dfd fix map avg logging (#3606)
* s

* s
2021-11-24 18:24:39 -05:00
rusefi b420052848 live data for wastegate #3588 2021-11-24 15:22:10 -05:00
rusefi 09d26c7b0b live data for wastegate #3588 2021-11-24 15:07:48 -05:00
rusefi 082bfa0eb6 live data for wastegate #3588 2021-11-24 15:03:06 -05:00
GitHub build-firmware Action 3a3022d7f3 Auto-generated configs and docs 2021-11-24 19:48:08 +00:00
Matthew Kennedy 1c8c22f9f1 map averaging usability (#3603) 2021-11-24 14:39:54 -05:00
GitHub build-firmware Action 4d66ab21cd Auto-generated configs and docs 2021-11-24 19:31:50 +00:00
rusefillc 6c23986cf0 MAP phase sensing #3544 2021-11-24 14:26:41 -05:00
GitHub build-firmware Action 602437ab93 Auto-generated configs and docs 2021-11-24 19:10:22 +00:00
rusefillc 3c1196c029 live data for wastegate #3588 2021-11-24 13:20:47 -05:00
rusefillc aa4e57ded6 live data for wastegate #3588 2021-11-24 13:18:07 -05:00
rusefillc 28c9d7555b live data for wastegate #3588 2021-11-24 12:59:57 -05:00
GitHub build-firmware Action d0ddd991a6 Auto-generated configs and docs 2021-11-24 13:02:01 +00:00
Matthew Kennedy 5274cffff3 main relay doesn't use fsio (#3580)
* fuel pump

* s

* call correct callback

* more dead

* test adjustment

* don't overflow

* don't need separate function

* java

* give it a name

* generated

* generated

* add to generate script

* import *

* this is so cheap we don't need a flag

* main relay

* plumbing

* dead fsio stuff

* test it

* by 100%, we mean 99.98%
2021-11-24 07:47:51 -05:00
GitHub set-date Action e10054a592 Update date 2021-11-24 01:00:22 +00:00
GitHub build-firmware Action 974e8928a1 Auto-generated configs and docs 2021-11-23 21:48:05 +00:00
rusefillc 09ed871dad well Lua wants to be BIG 2021-11-23 16:40:04 -05:00
GitHub build-firmware Action 16e025a7fc Auto-generated configs and docs 2021-11-23 21:00:29 +00:00
rusefillc 7760ddd8b6 live data for wastegate #3588
i want to persist state so no 'const' sorry
2021-11-23 15:52:43 -05:00
rusefillc 0b1b628fd3 live data for wastegate #3588 2021-11-23 15:51:30 -05:00
rusefillc cedc5f4e9c LUA CANbus expect 29bit ID by default #3592
not great quick fix
2021-11-23 15:41:43 -05:00
GitHub build-firmware Action ec7b493f6b Auto-generated configs and docs 2021-11-23 20:06:24 +00:00
rusefillc 9300866ba8 live data for wastegate #3588 2021-11-23 15:02:03 -05:00
rusefillc c5242fb720 live data for wastegate #3588 2021-11-23 15:00:47 -05:00
rusefillc fc10166f97 spelling 2021-11-23 07:57:43 -05:00
GitHub set-date Action 5a8eed86ee Update date 2021-11-23 01:00:35 +00:00
GitHub build-firmware Action 191b76f4dd Auto-generated configs and docs 2021-11-22 23:12:52 +00:00
Matthew Kennedy 9bd8a19564 oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -05:00
rusefillc 5271d9791a j1850 SAE crc8 Lua 2021-11-22 14:19:19 -05:00
GitHub build-firmware Action a2bc33b211 Auto-generated configs and docs 2021-11-22 18:42:24 +00:00
rusefillc 5d55b8538f unusedLogFormat 2021-11-22 13:37:06 -05:00
Scott Smith 467db16828 Move LuaThread to CCM, and shuffle a couple items out. (#3587)
Lua's stack probably doesn't need DMA.  Allows us to group more of our unused RAM together
in one place.
2021-11-21 20:35:03 -05:00
GitHub set-date Action 743ea73afd Update date 2021-11-22 01:01:34 +00:00
GitHub build-firmware Action 34c2fcc60d Auto-generated configs and docs 2021-11-21 13:16:25 +00:00
Scott Smith 9d61fb4cfd 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 b9f8409f59 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
GitHub set-date Action 6047404cfd Update date 2021-11-21 01:02:55 +00:00
Matthew Kennedy e2a4504728 rpm calculator refactoring, gm 24x test (#3585)
* data

* stub test

* use getTimeSinceSyncPoint

* s

* s

* no

* test

* stray ;

* those were 1/10 what they were supposed to be

* actually check something

* dead log line?
2021-11-20 14:59:02 +03:00
Scott Smith 04fa1fd410 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 569415930c 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 18aacc0ef6 On -fpermissive in Windows in unit tests #3581 2021-11-20 00:16:03 -05:00
rusefillc a3fc6d3e80 brave refactoring 2021-11-19 23:56:52 -05:00
GitHub build-firmware Action 10affa60db Auto-generated configs and docs 2021-11-20 04:16:43 +00:00
Scott Smith 07d30285fc 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
GitHub build-firmware Action f6730e32fe Auto-generated configs and docs 2021-11-20 03:34:23 +00:00
Matthew Kennedy e7956a53f6 fuel pump doesn't use fsio (#3576)
* fuel pump

* s

* call correct callback

* more dead

* test adjustment

* don't overflow

* don't need separate function

* java

* give it a name

* generated

* generated

* add to generate script

* import *

* this is so cheap we don't need a flag
2021-11-19 22:23:12 -05:00
GitHub set-date Action d0f92574a9 Update date 2021-11-20 00:59:29 +00:00
GitHub build-firmware Action a3b9af0951 Auto-generated configs and docs 2021-11-19 12:08:29 +00:00
rusefillc c441d7dd89 debug mode for skipped count for 4 cylinders #3570 2021-11-19 07:02:21 -05:00
Matthew Kennedy 739be57ac8 fast exti interrupt handoff (#3497)
* fast exti

* test code snuck in

* full interrupt disable :(

* do it the old fashioned way

* enable interrupt

* consume stored timestamp

* dead

* h7 maybe

* guard maybe

* non-stm32

* exti 16 wrong on f4/f7

* CORTEX_MAXIMUM_PRIORITY

* safer but uglier

* s

* chibios

* no const

* initializers

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-19 06:37:52 -05:00
GitHub build-firmware Action 6dc1e4dfcc Auto-generated configs and docs 2021-11-19 09:16:06 +00:00
Matthew Kennedy a0a1b5e6a0 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
Matthew Kennedy 7dee1e42eb adjust miata sync conditions (#3577) 2021-11-19 02:30:05 -05:00
GitHub set-date Action 3f54533821 Update date 2021-11-19 01:01:05 +00:00
Scott Smith aba4e5167e Separate out scheduleOrQueue into it's own standalone scheduler. (#3573)
It's a large enough entity that it shouldn't be buried in ignition logic.
2021-11-18 14:27:21 -05:00
rusefillc 82ffcad01f proportional spark cut #3427 2021-11-17 23:35:26 -05:00
GitHub build-firmware Action dc73fe3404 Auto-generated configs and docs 2021-11-18 04:30:54 +00:00
Scott Smith b3e0b28c75 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 a5b0604880 Add a lock for scheduleOrQueue events. (#3572)
Ignition callers are all tooth based, but aux valves calls it from both the microsecond timer and
the main initialization thread.  HPFP will also soon call it from both those places too.
2021-11-18 05:08:32 +03:00
GitHub set-date Action 2dae11b443 Update date 2021-11-18 01:00:51 +00:00
Scott Smith 659cc68be1 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 f9f13f0bad 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
rusefillc dfac1897e1 Startup Pin State Error - maybe hardware damage of STM32 pin connected to a 12v-powered TC4427? #3558 2021-11-17 04:45:55 -05:00
rusefillc 46d2b21ecc proportional spark cut #3427 2021-11-17 04:06:22 -05:00
Scott Smith 80091498a6 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 19f7fa8f89 Make engine* and friends be const pointers in production. (#3564)
This allows the compiler to see through the pointer and make accesses faster.
It saves 1336 bytes of text.
2021-11-17 03:53:17 -05:00
Scott Smith 14578ddae7 Remove a bunch of macros from engine_ptr.h (#3562) 2021-11-17 10:01:39 +03:00
GitHub set-date Action 05bef81735 Update date 2021-11-17 01:00:29 +00:00
Scott Smith dac2ae9b1d 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
rusefillc 774d96493e spelling 2021-11-16 16:46:54 -05:00
rusefillc 6fdb98e84f helping launch enter simulator 2021-11-16 16:45:14 -05:00
rusefillc ed1d24dbbe helping launch enter simulator 2021-11-16 16:31:35 -05:00
Andrey 1be12392c0 proportional spark cut #3427 2021-11-16 13:23:08 -05:00
Andrey c201b5b0ec proportional spark cut #3427 2021-11-16 05:56:15 -05:00
Matthew Kennedy 7296593448 remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
Scott Smith 2cfc4af998 Start the process of using a global engine ptr for unit tests. (#3551)
* Start the process of using a global engine ptr for unit tests.

Passing around the engine, config, and persistent state wasn't buying anything.  Instead, use
EngineTestHelper(Base) to correctly set and clear the global variables.  Add a dummy check in
case some test tries to set them manually.

* Fix OSX build

* Adapt PR to recently added code.
2021-11-16 00:23:14 -05:00
Scott Smith c354d30a71 Use Valgrind to detect unitialized variable references. (#3555)
* Use Valgrind to detect unitialized variable references.

Fix the edge cases that pop up

* Comment and disable Mac run
2021-11-15 23:42:23 -05:00
GitHub build-firmware Action b477365e7c Auto-generated configs and docs 2021-11-16 02:53:15 +00:00
Andrey b545743f7d Not all launch control options are used #3554 2021-11-15 21:13:01 -05:00
Andrey 349d224b5f technical debt: enableOverdwellProtection #3553
only documentation
2021-11-15 20:32:25 -05:00
Andrey 7b790d36f6 random refactoring: trigger central encapsulation 2021-11-15 20:22:05 -05:00
Andrey 4bc9343d0b refactoring launch 2021-11-15 20:09:03 -05:00
Andrey 837cdf2cfb refactoring launch 2021-11-15 19:55:04 -05:00
Andrey 0a956d96b4 refactoring launch 2021-11-15 19:55:04 -05:00
Andrey c8b733ea6e refactoring launch 2021-11-15 19:34:42 -05:00
Andrey c41dccb5ff refactoring launch 2021-11-15 19:24:00 -05:00
Andrey bc3befd0ac refactoring launch 2021-11-15 18:57:12 -05:00
Andrey bafd5e0e17 refactoring launch 2021-11-15 14:40:35 -05:00
Matthew Kennedy c1941f3a49 (void) -> () (#3550)
* static functions with (void)

* more

* Revert "more"

This reverts commit 246e53441f935451437df186ac92d7df26b62fb6.

* s

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

* s
2021-11-15 12:44:40 +01:00
GitHub build-firmware Action a29aa50cb0 Auto-generated configs and docs 2021-11-15 03:03:29 +00:00
rusefillc 8448b04078 MAP phase sensing #3544 2021-11-14 21:58:01 -05:00
GitHub build-firmware Action a7a89b74d5 Auto-generated configs and docs 2021-11-15 02:31:36 +00:00
rusefillc 9420c6d831 MAP phase sensing #3544 2021-11-14 21:24:59 -05:00
GitHub set-date Action b814015179 Update date 2021-11-15 01:00:10 +00:00
GitHub build-firmware Action ecf4a31095 Auto-generated configs and docs 2021-11-14 23:09:53 +00:00
rusefi 1f486a1e15 Lua: changing "table" API 2021-11-14 16:29:46 -05:00
rusefi 301bdf08a2 Something something Automatic Compression Release #3442 2021-11-14 16:04:44 -05:00
rusefillc 8cb1f2545c trigger refactoring & docs 2021-11-14 15:35:11 -05:00
Matthew Kennedy af78ab76cb math is fun (#3545)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-14 15:32:35 -05:00
rusefi 291f815b2d Something something Automatic Compression Release #3442 2021-11-14 15:04:10 -05:00
rusefi 924ae4b4a1 Epic: Remove FSIO #2928 2021-11-14 14:44:52 -05:00
GitHub build-firmware Action 98e2649f70 Auto-generated configs and docs 2021-11-14 19:42:17 +00:00
rusefi df4f122c0b Epic: Remove FSIO #2928 2021-11-14 14:14:43 -05:00
rusefillc 899a10c829 script settings need names! 2021-11-14 13:18:11 -05:00
GitHub build-firmware Action fde7fa93a1 Auto-generated configs and docs 2021-11-14 17:42:11 +00:00
GitHub build-firmware Action 33c12129a2 Auto-generated configs and docs 2021-11-14 16:51:07 +00:00
rusefillc a52a0a80c7 Epic: Remove FSIO #2928 2021-11-14 11:40:19 -05:00
rusefillc 1a3fb4a0db Epic: Remove FSIO #2928 2021-11-14 11:04:51 -05:00
rusefillc 3327b0d4e7 Epic: Remove FSIO #2928 2021-11-14 10:57:19 -05:00
GitHub build-firmware Action 41b9a37897 Auto-generated configs and docs 2021-11-14 15:53:06 +00:00
rusefillc 5f1aadf638 Epic: Remove FSIO #2928 2021-11-14 10:39:47 -05:00
GitHub build-firmware Action b223139c3b Auto-generated configs and docs 2021-11-14 15:07:50 +00:00
rusefi bdb6327ff9 Epic: Remove FSIO #2928 2021-11-14 09:49:02 -05:00
GitHub build-firmware Action 42c1db2109 Auto-generated configs and docs 2021-11-14 14:40:23 +00:00
GitHub build-firmware Action 756b9e2b3d Auto-generated configs and docs 2021-11-14 14:27:16 +00:00
rusefillc 8fd82af0cb Epic: Remove FSIO #2928 2021-11-14 08:37:50 -05:00
rusefillc 0fc4096213 Epic: Remove FSIO #2928 2021-11-14 08:33:19 -05:00
GitHub build-firmware Action 87202db62b Auto-generated configs and docs 2021-11-14 13:13:06 +00:00
rusefillc 94320910e9 Epic: Remove FSIO #2928 2021-11-14 07:30:26 -05:00
rusefillc eab7f670a2 Epic: Remove FSIO #2928 2021-11-14 07:24:50 -05:00
rusefillc 2080ae2148 script settings need names! 2021-11-13 23:10:38 -05:00
GitHub build-firmware Action a81574c7ad Auto-generated configs and docs 2021-11-14 03:54:30 +00:00
rusefillc 29670184e2 script settings need names! 2021-11-13 22:47:46 -05:00
GitHub build-firmware Action 2762268d58 Auto-generated configs and docs 2021-11-14 03:02:10 +00:00
Matthew Kennedy 8edc91f657 mercedes two lobe trigger testing (#3543)
* mercedes

* config

* break;

* I did the gap ratio math wrong

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-13 21:50:04 -05:00
GitHub set-date Action 7e1fe984f8 Update date 2021-11-14 01:02:27 +00:00
GitHub build-firmware Action 625eda6d09 Auto-generated configs and docs 2021-11-13 15:38:11 +00:00
rusefi d172961577 findTableIndex 2021-11-13 10:02:01 -05:00
rusefillc f7d1a3e542 lua can 2021-11-13 08:23:44 -05:00
rusefillc 731906b2be lua can 2021-11-13 08:20:30 -05:00
rusefillc 14281da180 lua can 2021-11-13 04:44:17 -05:00
GitHub build-firmware Action b702a7f419 Auto-generated configs and docs 2021-11-13 09:41:01 +00:00
rusefillc 4803a6def5 Something something Automatic Compression Release #3442 2021-11-13 04:24:53 -05:00
Matthew Kennedy 31848f5bf4 lua pid class (#3411)
* lua pid

* no luaaa stl

* update luaaa

* finality

* luaaa

* luaaa

* = default

* bad merge

* gitmodules

* lua

* proteus demo script

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-13 03:18:16 -05:00
Matthew Kennedy 569ec1013b update luaaa (#3540)
* lua update

* no stdlib mode

* turn off system luaaa for now since it makes luaaa sad

* let user heap do a little

* gitmodules

* memory shuffling

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-12 22:10:05 -05:00
GitHub build-firmware Action 015a07576d Auto-generated configs and docs 2021-11-13 03:01:55 +00:00
rusefillc d96755ec15 Proteus Harley 2021-11-12 21:56:07 -05:00
GitHub set-date Action 187f58078e Update date 2021-11-13 01:04:13 +00:00
GitHub build-firmware Action 44fc5651bf Auto-generated configs and docs 2021-11-12 04:15:01 +00:00
GitHub build-firmware Action 17a6f81365 Auto-generated configs and docs 2021-11-12 04:00:30 +00:00
GitHub build-firmware Action 8a5f3a3a0c Auto-generated configs and docs 2021-11-12 03:51:31 +00:00
Andrey 31b50ff021 Something something Automatic Compression Release #3442 2021-11-11 21:38:49 -05:00
Andrey db6a1ae7e2 docs 2021-11-11 21:31:24 -05:00
GitHub build-firmware Action cf7231a8a0 Auto-generated configs and docs 2021-11-12 01:54:56 +00:00
Andrey 37adc7e713 Bench Test IAC Valve fails #3534
that's not even funny
2021-11-11 20:39:01 -05:00
Andrey 06f7098cae Bench Test IAC Valve fails #3534 2021-11-11 20:31:46 -05:00
Andrey 5136d0b994 Bench Test IAC Valve fails #3534 2021-11-11 20:28:01 -05:00
GitHub build-firmware Action 132e70befe Auto-generated configs and docs 2021-11-12 01:22:13 +00:00
Andrey 1aca049c47 Something something Automatic Compression Release #3442 2021-11-11 20:16:46 -05:00
Andrey 7d3d93d469 dead line 2021-11-11 20:16:46 -05:00
Andrey 9aa98cd523 refactoring: less hacky implementation 2021-11-11 20:16:46 -05:00
GitHub set-date Action a5ca40bebe Update date 2021-11-12 01:01:37 +00:00
GitHub build-firmware Action c57174f2ac Auto-generated configs and docs 2021-11-11 23:37:47 +00:00
rusefillc 0db5f673dc Overflow in currentTimeMillis and getTimeNowSeconds #3531 2021-11-11 17:54:31 -05:00
rusefillc 29b21e6eb6 Overflow in currentTimeMillis and getTimeNowSeconds #3531
it now takes 1000 times longer to overflow
2021-11-11 16:43:41 -05:00
rusefillc 677a2ede70 Overflow in currentTimeMillis and getTimeNowSeconds #3531
it now takes 1000 times longer to overflow
2021-11-11 16:39:23 -05:00
Matthew Kennedy baf11a27b9 load lua libs correctly (#3529)
* fix lua lib loading

* test
2021-11-11 13:44:13 -05:00
Scott Smith 93d31c6c9b 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
rusefillc e117292d62 where are we now? 2021-11-11 11:11:40 -05:00
rusefillc ad7c5d9aae where are we now? 2021-11-11 10:36:31 -05:00
Scott Smith aec887efc8 Change users of MultiChannelStateSequence to use the API (#3524)
Better than reaching into members that should be private. I didn't feel like actually making
them private though, as one user validates pinStates isn't NULL.
2021-11-11 09:19:22 -05:00
rusefillc 1f415a0212 Idle valve outputs not available in TS #3523 2021-11-10 21:07:38 -05:00
GitHub build-firmware Action 17b786734c Auto-generated configs and docs 2021-11-11 01:46:41 +00:00
rusefillc 371f0ca72c Idle valve outputs not available in TS #3523 2021-11-10 20:40:42 -05:00
GitHub build-firmware Action 993a2111dd Auto-generated configs and docs 2021-11-11 01:09:25 +00:00
Scott Smith 1a299a3221 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
rusefi 35f6ac4305 open q 2021-11-10 19:24:17 -05:00
Scott Smith 5bd7d8e372 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 38ea0d1835 Revert "Don't keep a separate MultiChannelStateSequence for the trigger emulator. (#3513)"
This reverts commit 4e220dc163.
2021-11-09 20:42:23 -05:00
GitHub set-date Action 150019b0ed Update date 2021-11-10 01:00:05 +00:00
GitHub build-firmware Action 6b39c9f5f1 Auto-generated configs and docs 2021-11-09 20:43:52 +00:00
Scott Smith 4e220dc163 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 9b40e68155 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
GitHub build-firmware Action 3484c3270b Auto-generated configs and docs 2021-11-09 02:36:07 +00:00
GitHub build-firmware Action e63e942fb5 Auto-generated configs and docs 2021-11-09 02:26:06 +00:00
rusefi 99a90309ef why is meat allowed to touch machine?! 2021-11-08 20:49:12 -05:00
rusefi 8bab53c1fd nicer messages 2021-11-08 20:49:12 -05:00
GitHub build-firmware Action 464332e5be Auto-generated configs and docs 2021-11-09 01:26:41 +00:00
GitHub set-date Action 3168ccd62c Update date 2021-11-09 01:00:19 +00:00
rusefi 69a53c565f pid demo progress 2021-11-08 17:31:33 -05:00
GitHub build-firmware Action dbecc45968 Auto-generated configs and docs 2021-11-08 22:24:44 +00:00
Scott Smith 8639b7c7e4 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
Andrey 2166a5ba16 ETB: do not touch HW pins if function not selected, this way Lua can use DC motor hardware pins directly 2021-11-08 12:44:37 -05:00
Andrey 757cd10c1f docs 2021-11-08 12:23:00 -05:00
Scott Smith 2752c39d7f Change getTimeNowNt to be lock free. (#3502)
Track the top two bits of the 32-bit time field, along with the bits that comprise the top half of
the 64-bit time field.  We can detect when the 32-bit field is advancing or falling back from the
global time counter as long as the change is less than about 1 billion ticks.  This shows up as
either 01 or 11 in the top 2 bits of the 32-bit time field relative to the 64-bit field.  Or is
there is no change it shows up as 00.  Changes of 2 billion or more cannot be discerned as +2
billion and -2 billion both show up as 10.

Change the simulator to use this logic to make sure it gets some exercise.
2021-11-08 08:24:20 -05:00
GitHub build-firmware Action f6aac4b1f9 Auto-generated configs and docs 2021-11-08 03:23:43 +00:00
GitHub set-date Action db5ef62885 Update date 2021-11-08 01:02:17 +00:00
GitHub build-firmware Action 41fe16ed40 Auto-generated configs and docs 2021-11-07 18:40:19 +00:00
GitHub build-firmware Action 678f5db3b9 Auto-generated configs and docs 2021-11-07 15:30:54 +00:00
Andrey 49d4dea65e lua pid class #3411 2021-11-07 09:53:40 -05:00
Andrey c98bfecf11 lua pid class #3411 2021-11-07 09:49:47 -05:00
Andrey 94faa375e1 reducing complexity 2021-11-07 01:57:32 -05:00
rusefillc d0a8bbc974 typo 2021-11-07 01:51:05 -05:00