Commit Graph

557 Commits

Author SHA1 Message Date
Matthew Kennedy e9d092f975
big delete ICU (#4270)
* big delete

* icu vestiges

* changelog
2022-07-07 15:27:59 -04:00
Matthew Kennedy 769f7ec558
get correct stamp (#4174) 2022-05-14 23:01:02 -04:00
rusefillc 500c443a15 Timestamp Error scheduleByTimestampNt too far #3395
improving error message
2022-05-14 21:24:19 -04:00
Matthew Kennedy 9b820cf1dc
remove suspicious cast that could maybe cause an overflow (#4169)
* suspicious cast

* don't print 64b

* explicit type
2022-05-13 06:40:37 +03:00
Matthew Kennedy e4a0979dc2
Brain pin is enum class (#4108)
* change most usages to Gpio::

* board configs

* engine configs etc

* isBrainPinValid, smart gpio

* generator

* generator

* generator

* connector yamls

* kinetis enums

* cypress txt

* kinetis config

* frankenso

* config generator

* actually do it for the others

* disable skips for pr ci

* fix tle8888

* misc

* weird cast from int

* needs this operator too

* this can be an unsigned subtract

* happy tests

* s

* kinetis isConfigurationChanged weirdness

* missed J/K

* cypress efifeatures

* build script mistake (!)

* mistake in smart gpio

* debounce

* eg33

* kinetis, so needy

* it's pretty green, we can skip these again
2022-04-28 17:32:39 -04:00
Matthew Kennedy bc6a87cadc
allow enum_class in rusefi_hw_enums.h (#4104)
* make things c++ friendly

* install various canaries in coal mines

* using is much clearer than typedef

* fixing builds

* lps25

* trigger includes were a mess

* c -> c++ cleanup

* os util

* why did so many include os_util.h?

* fwd declare

* cypress/kinetis

* s

* eg33 happy

* happy sim

* cypress usb

* pch

* cypress

* doesn't need to include all that

* h7
2022-04-25 20:38:16 -04:00
David Holdeman 7de7ea6ad0
TCU features and fixes (#4082)
* add tcc pwm freq field

* add pc fields, make trans fields conditional

* make button shift fields conditional, remove duplicates

* add 3-2 solenoid fields

* add PC curves

* try combining tcc curves

* try combining pc curves

* use airmass instead of tps for pc

* reduce airmass axis

* increase axis digits

* duplicate for per shift, change names

* add pc per shift arrays

* try moving tables

* move more tables

* init solenoid pins

* start adding pwm stuff, change some array names

* fix gear issue

* fix multiple shift issue

* fix transmission controllers not working

* fix transmission controllers not working 2

* rearrange and virtual some things

* make getMode const

* fix pwm
2022-04-18 20:09:27 -04:00
David Holdeman fe39f58022
Some untested TCC control (#4066)
* rebase

* save changes

* save changes

* fix whitespace

* try enum class

* change field name

* Add TCC pin fields

* add TCC tables

* add a bit of TCC control logic
2022-04-12 19:15:09 -04:00
rusefillc 014b8293a5 User board-specific terms in error messages #3886
progress
2022-02-03 12:45:26 -05:00
Andrey 08c1c5d969 Remove legacy check fix #3808 2022-01-18 16:01:27 -05:00
Andrey 7e007cc534 https://rusefi.com/forum/viewtopic.php?p=44100#p44100 2022-01-18 10:24:08 -05:00
rusefillc 64387689ff On m_event vs lobe vs scheduling #3804 2022-01-18 00:45:24 -05:00
rusefillc e76aa1cc60 https://github.com/rusefi/alphax-2chan/issues/14 2022-01-16 23:03:14 -05:00
rusefillc f43ef3a8b6 warning(CUSTOM_ERR_6586, "attempting to change unassigned pin") 2022-01-16 15:53:27 -05:00
rusefillc 7f0357ffcb mk files refactoring 2022-01-06 20:06:31 -05:00
Andrey 940b04ab24 Let's always have TS structure so that unit tests can check values in outputChannels, kind of making outputChannels a god dump for state but whatever since Live View is coming 2021-12-07 20:18:47 -05:00
rusefillc 4b8c5f1671 harley 2021-11-26 14:41:35 -05:00
rusefillc c29bb71556 spelling 2021-11-23 07:57:43 -05:00
Scott Smith ba4a00d3bb
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
rusefillc e54d3b9e06 On -fpermissive in Windows in unit tests #3581 2021-11-20 00:16:03 -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
Scott Smith 18c27a6e9c
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 b579b33082 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
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
Scott Smith 62daac73c7
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
Matthew Kennedy 145316c497
less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
rusefillc 22c872d8d8 Epic: Remove FSIO #2928 2021-11-14 10:57:19 -05:00
rusefillc eb1af46655 Epic: Remove FSIO #2928 2021-11-14 08:37:50 -05:00
Scott Smith d4c4db9a12
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
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
rusefi 22e78a97a5 nicer messages 2021-11-08 20:49:12 -05:00
Matthew Kennedy 0fe2721556
use name of pwm (#3393) 2021-10-22 15:23:53 -04:00
Matthew Kennedy efa08b329d
Fix simulator (#3360)
* fix simulator

* print out halt reason

* option to close simulator after time

* workflow calls it

* test with the bug still present

* ...and fix the bug
2021-10-17 20:07:25 -04:00
Andreika bc4a068c9c
[DRAFT] IAC H-Bridge Microstepping (#3213)
* fix for stepperHbridgeHardware

* new config fields for microstepping

* add stepper dir pin mode to the dialog

* refactor stepper hw dialog & add microstepping panel

* microstepper modes enum

* stepperDcInvertedPins needed by Hellen

* add sleep() for stepper and divisor for pause()

* microstepping impl.

* make unit-tests more happy

* small progress

* fix etb-stepper dlg conflict

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2021-10-06 13:57:04 -04:00
Andrey 2a2722c3cc SPARK_EXTREME_LOGGING 2021-10-01 23:50:32 -04:00
rusefillc 3ff9568521 more details into CUSTOM_OBD_LOW_FREQUENCY message 2021-09-05 14:21:02 -04:00
Matthew Kennedy da5aaeda2b
detect "not scheduled" faster (#3200)
* fatal if not found

* handle not-scheduled

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-08-27 11:46:01 +03:00
Matthew Kennedy 0c6297e926
add cancel to scheduler (#3201)
* fw

* for tests

* simulator

* sim

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-08-27 11:30:06 +03:00
Matthew Kennedy 98a98e920d
init the timer before we try to use it (#3205)
* init the timer before we try to use it

* format

* guard
2021-08-27 10:59:00 +03:00
Matthew Kennedy cf5d4cbe1c
add & test remove from linked list (#3199) 2021-08-26 23:03:09 +03: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
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 2ec8c3090f trailing spark outputs #2931 2021-07-21 20:51:51 -04:00
Matthew Kennedy e2a01b4c3e
force init LEDs even with fatal (#2998) 2021-07-20 17:09:52 -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
rusefi 7945faa93a FATAL on NB2 tune jim stim input signal #2965 2021-07-14 17:45:54 -04:00