Commit Graph

319 Commits

Author SHA1 Message Date
Matthew Kennedy ff98133f34 scripts 2023-02-22 15:29:48 -08:00
Matthew Kennedy 5d7a30ce2b no qc 2023-02-22 14:53:31 -08:00
Matthew Kennedy 00f3067185 idle pid cic 2023-02-20 23:01:59 -08:00
Matthew Kennedy 495b5aebc7 mcp3208, hip9011 2023-02-20 22:40:31 -08:00
Matthew Kennedy 0e12622371 cdm ion 2023-02-20 22:37:14 -08:00
Matthew Kennedy 961950dbcc gps 2023-02-20 22:07:21 -08:00
Matthew Kennedy 61c17791b8 joystick, lcd 2023-02-20 21:54:10 -08:00
rusefillc 8730782cd3 Refactoring: less confusion macro names around serial/uart/etc in connectivity fix #4999 2023-01-23 05:26:59 -05:00
rusefillc 3aa9ffca60 Refactoring: less confusion macro names around serial/uart/etc in connectivity #4999 2023-01-23 05:09:32 -05:00
rusefillc 886ec74442 antilag and anti-lag #2403
TurboMarian is the ALS boss
2022-12-21 20:12:00 -05:00
rusefillc 1f08781383 Update readme.md 2022-11-19 20:15:21 -05:00
rusefillc 0efe42e07e Update readme.md 2022-11-19 19:34:23 -05:00
rusefillc f08b483a20 Create readme.md 2022-11-19 18:53:43 -05:00
Nathan Schulte 877fa21bd8 fix simulator build (via MinGW) (#4799)
* firmware: kill -9 dead hipLastExecutionCount

* firmware: pin_repository C includes efi_gpio.h

* firmware: controllers: tidy #endif comments

* firmware: primary_pins logic depends EFI_GPIO_HARDWARE

* firmware: only print ADC info if HAL_USE_ADC

* firmware: digital_input: tidy #endif comments

* firmware: digital_input logic depends on e.g. HAL_USE_ADC

* firmware: digital_input logic depends !EFI_SIMULATOR

* firmware: digital_input logic depends e.g. HAL_USE_ADC

* simulator: Makefile includes RUSEFI_LIB_C as CSRC

* Revert "GHA/build-firmware: pin agents to Ubuntu 20.04 (#4793)"

This reverts commit 51e368245b.
2022-11-18 23:43:43 -05:00
Nathan Schulte a4198e2486 simulator: use CC and CPPC for LD (#4794)
this allows to specify a different GCC when building
2022-11-18 21:15:13 -05:00
Nathan Schulte 2d394cceee simulator: compile.sh passes arguments to make 2022-11-18 10:19:54 -05:00
Nathan Schulte 199a892fb5 simulator: tweak case of rusEFI in compile.sh log 2022-11-18 10:09:53 -05:00
Nathan Schulte 814f69cd39 simulator: Makefile uses spaces ...
... tabs are reserved for recipes
2022-11-18 10:09:28 -05:00
Nathan Schulte a0c1b738e6 simulator: add missing stdc++ include to CAN HAL LLD (#4795)
for std::remove -- GCC 12 exposes this issue
2022-11-18 09:27:54 -05:00
rusefillc 359c682896 ingles lo hablas 2022-10-01 06:15:00 -04:00
rusefillc 35bf947f06 insist on setBoardConfigOverrides fix #4614 (#4615)
* insist on setBoardConfigOverrides fix #4614

* insist on setBoardConfigOverrides fix #4614

* insist on setBoardConfigOverrides fix #4614

* insist on setBoardConfigOverrides fix #4614

* insist on setBoardConfigOverrides fix #4614
2022-09-24 07:35:19 -04:00
Matthew Kennedy 91566b86d3 simulator reads/writes configuration (#4605)
* simulator reads/writes configuration

* c_str

* include order
2022-09-23 08:47:50 -04:00
Andrey 31dbf06c84 os_access.h dead? 2022-09-07 16:00:13 -04:00
rusefi 06552b6bee servo is truly not alive 2022-09-06 16:29:12 -04:00
rusefillc 07702cab5d Issue 4115 (#4518)
* efiPrint NaN handling #4115

* fresh chibi

* efiPrint NaN handling #4115
2022-09-01 23:13:23 -04:00
Andrey 1ffa98ba89 a bit of dead code 2022-09-01 11:47:56 -04:00
rusefi 21a1b022e7 efiPrint NaN handling #4115 2022-08-31 20:00:58 -04:00
Matthew Kennedy 5fc7000834 Pt2001 module (#4396)
* pt2001 uses module

* read flag0

* c

* libfirmware

* makefiles

* are unit tests happy?

* bootloader
2022-08-08 08:53:08 -04:00
Matthew Kennedy cd98ad35c2 use libfirmware for a few things (#4351)
* use libfirmware

* unit tests

* crc

* missed one

* bootloader
2022-07-16 02:22:51 -04:00
rusefillc 8d250448e0 Detail on how to set up iDrive or equivalent CAN button control #226
boost lua progress
2022-07-14 12:59:09 -04:00
Matthew Kennedy 68fb838641 Lua hooks for gear detection (#4328)
* implement

* sim has vss

* write a test

* guard
2022-07-07 23:16:56 -04:00
Matthew Kennedy 6267b8621a big delete ICU (#4270)
* big delete

* icu vestiges

* changelog
2022-07-07 15:27:59 -04:00
Matthew Kennedy 2c80b8cf19 implement CAN driver for simulator (#4312)
* stub simulator CAN driver

* comments

* CAN sensor

* maybe implement?

* s

* fix

* tx and rx actually work!?!?!

* check_can_isr

* modify chibios

* Sim has no CAN on Windows (for now?)

* safer init/deinit, enable assertions

* smarter handling of missing CAN device

* better guards

* guards for windows
2022-07-03 08:25:24 -04:00
rusefillc ce1d80ec33 stealing from David 2022-06-26 19:42:08 -04:00
rusefillc 78c520ac06 helping simulator a bit 2022-04-30 13:08:53 -04:00
Matthew Kennedy a2e1a079b8 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
rusefillc 95168053f0 Explicit fw (#3968)
* explicit FW ID

* explicit FW ID

Co-authored-by: rusefillc <sdfsdfqsf2334234234>
2022-02-27 00:49:47 -05:00
Matthew Kennedy 31c0afc79f remove mock adc (#3888)
* remove mock adc

* do these do /anything/?
2022-02-03 20:43:34 -05:00
Matthew Kennedy 57525283ac Remove FSIO, byeeeeeeeee (#3865)
* vestigial config

* replace last functionality

* engine/board configs include

* files that didn't need to include this

* remove FSIO implementation

* stragglers

* random little bits

* s

* s

* ConfigDefinition

* jar

* s
2022-02-02 02:03:31 -05:00
Matthew Kennedy 95541ce8cf make the simulator smaller (#3869)
* small sim

* o2 is ok
2022-02-01 16:19:46 -05:00
rusefillc 0335802d7e mk files refactoring
saving build
2022-01-06 22:19:00 -05:00
rusefillc d447e34344 mk files refactoring 2022-01-06 21:48:48 -05:00
rusefillc 47f0423b73 mk files refactoring 2022-01-06 20:32:39 -05:00
rusefillc 1955c5a3c2 mk files refactoring 2022-01-06 20:06:31 -05:00
rusefillc 433ff5c62e Live Data progress 2022-01-06 19:02:35 -05:00
Scott Smith 43e4e09d70 Update the simulator TS port macros to match the rest of the product. (#3600) 2021-11-23 19:15:09 -05:00
Matthew Kennedy e7417ef0c0 simulator writes binary log (#3598)
* simulator writes log

* replace the file

* check that the sim actually fails

* put it back

* did the sim really not fail?

* good, asan does catch it
2021-11-23 11:42:45 -05:00
Matthew Kennedy 9bd8a19564 oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -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
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
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
Matthew Kennedy a79b0c424c turn on c++ 20 (#3579)
* set flags

* emit initializers

* jar
2021-11-19 22:19:34 -05:00
Matthew Kennedy 26502351f1 simulator gets a heap (#3563) 2021-11-17 10:00:12 +03:00
rusefillc 4807c0bf87 helping launch enter simulator 2021-11-16 16:34:23 -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 7367aa5b8a Compile each project's PCH to a separate file to reduce developer friction. (#3505)
Having to remove the precompiled header when switching from firmware to simulator to unit_tests and
back again is annoying.  Use a directory to store the precompiled header output.  Turn off
precompiled header warnings as GCC still complains even if it finds a valid one eventually.
2021-11-08 15:52:58 -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
Matthew Kennedy 7f4b91809e dead vss flag (#3499) 2021-11-07 14:36:46 -05:00
Andrey 29851fe219 export board-specific macro for stm32 pins based on board yaml #3298
meta progress
2021-10-26 10:27:10 -04:00
Matthew Kennedy 56afeb17c8 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
rusefillc f970a135db progress 2021-10-17 18:40:05 -04:00
Matthew Kennedy b84df3dda8 dead map (#3316) 2021-10-04 18:33:10 -04:00
Matthew Kennedy 4e6b61234f 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 d3ec2b21d1 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 f44a84b40c set up precompiled header (#2971)
* ignore

* set up precompiled header

* makefile

* fixes

* cleanup

* only depend cpp on pch

* efifeatures in pch

* f7 efifeatures

* consolidate

* simulator

* proteus build

* error handling is a good one

* bootloader pch

* don't auto include pch

* dirs

* delete on clean

* bootloader cleans

* clean.sh deletes pch

* disable in bl for now

* there was a typo so maybe it'll work now

* remove todo

* don't need that any more

* don't need these parts

* don't need this part

* undo changes

* use a different cpp as example

* s

* Revert "cleanup"

This reverts commit 8de8698490f5d09c2df753f00a89751aa898be9a.

* also unnecessary now

* buh

* comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-25 21:23:23 -04:00
Matthew Kennedy e3849b95d5 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
Andrey 122ef9f637 making code more testable 2021-07-14 22:37:05 -04:00
Matthew Kennedy 16dac2e47c Disable closed loop idle during cranking->running taper (#2900)
* implement

* dead file?

* implement tests

* new phase
2021-07-06 08:47:06 -04:00
Matthew Kennedy a3d3638232 more graceful chibios assertion failure (#2859)
* no custom assert hook

* dead

* setjmp/longjmp

* always call tid hook

* tests get threadid

* simulator threadid

* kick

* stubs for kinetis

* make it happier

* noreturn

* oops

* comments

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-05 18:18:58 -04:00
rusefillc 683d70fa99 helping build? 2021-07-05 11:36:23 -04:00
Matthew Kennedy 1c9fe3b4af don't debug info (#2798) 2021-06-07 09:17:56 +03:00
Matthew Kennedy 86793c55b7 simulator usability (#2794)
* simulator

* simulator is debuggable

* s

* format
2021-06-04 01:34:49 -04:00
Matthew Kennedy 6bfaed64db lua pwm hooks (#2687)
* pwm hook

* dedicated pins

* write hook

* UI

* more info

* zero based, clamp

* memory

* don't compile lua in bootloader at all
2021-05-20 19:01:17 -04:00
Matthew Kennedy 4b0d75ff92 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 4b69e7d441 compile gpiochips as cpp (#2702)
* rename

* core

* structing

* more

* makefile

* structing

* 6240 compiles

* explicit cast instead of implicit narrowing

* 8888

* no extern C

* fix tests build

* extern "C"

* 33810

* 8860

* 33810

* linker

* unbreak master

* don't need that if compiling as C++

* bump config

* fix test

* tests

* unit tests bad merge

* build

* move subaru logic to cpp file

* cpp goodness

* hpp include

* this is probably the right thing to do

* simulator
2021-05-17 08:42:56 +03:00
Andrey G a441ff17a3 Hw layer rearrangement (#2707)
* Fix unit_tests

* simulator: fix redifinition of TS_PRIMARY_SERIAL warning
2021-05-16 15:19:34 +03:00
Andrey G 0faa8a0166 Hw layer rearrangement (#2705)
* Fix simulator compilation

* HW_SENSORS_SRC -> HW_SENSORS_CPP
2021-05-16 14:11:28 +03:00
Matthew Kennedy 1aed5c6ae2 remove intermediate buffer (#2668)
* remove define

* goodbye intermediate logging buffer

* free ram! woo!
2021-05-10 08:01:24 -04:00
Matthew Kennedy 5f0791f9fb Destroy all shared logger (#2574)
* most of shared logger

* a few more

* one more

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 14:28:48 -04:00
Matthew Kennedy 737ee444b8 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 8cfb63455d 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
Andrey G 112b4d1182 Hip9011 (#2512)
* hip9011: coexistance with other spi devices

* hip9011: rework so SPI transfer is invoked from thread

also use polling spi exchange to avoid cache problems

* hip9011: move calculations from ADC callback to thread

* hip9011: big cleanup

* hip9011: simplify spi communication

* No need to set knockBandCustom if it is not custom

HIP9011 calculates knockBand from cylinderBore same way

* hip9011: make unit test happy

* hip9011: fix unit test

* hip9011: remove duplicated initialization, reorder

* hip9011: just renames and data type adjustments

* hip9011: rename BAND() to HIP9011_BAND()

* hip9011: move some code from lookup.cpp to logic.cpp

* hip9011: move initEngineNoiseTable to engine_configuration.cpp

* hip9011: move lookup tables to hip9011_logic.c

* hip9011: remove empty files

* hip9011: additional checks
2021-03-30 10:56:25 -04:00
Matthew Kennedy 72dac58f9b fix multi-serial-port insanity (#2476)
* carve out UART specific

* implement channel

* config cleanup

* use new config

* bootloader

* dead code

* s

* h7 inherits f7

* oops

* ok now it's right

* tests

* cleanup

* call setup

* put that in its own file

* cleanup

* format

* guard

* not needed

* improve guarding

* portable

* allow override of uart mode

* fixes for bootloader

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-28 09:06:36 -04:00
Matthew Kennedy 60a7db4a06 dead 2021-03-15 17:12:01 -04:00
Matthew Kennedy ce3878949c stop trigger emulator PWM when disabled (#2443)
* simplify trig emulator

* spelling is hard

* fix various builds

* spelling again

* add command/button for external stimulation

* enable hw stim for HW-in-loop test

* s

* I does spelling good

* clear flag when disabled

* generate enough for console build

* don't disable that

* this test needs external stimulation enabled

* import

* ui improvements

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-11 08:38:52 -05:00
slowriot b70e39d425 update all compile scripts to use available cores rather than a hardcoded value (#2425)
* fix typos, spelling

* add two V8 firing orders

* use the available number of CPU cores, not just 4

* add new firing orders to config

* updating generated files to include new v8 firing orders

* reverting update of auto-generated files

* correct firing order labels for new firing orders

* update all compile scripts to use available cores rather than a hardcoded value
2021-03-06 12:55:46 -05:00
Matthew Kennedy 5cf2ad4968 build (#2399) 2021-02-24 21:55:51 -05:00
Matthew Kennedy 179a3cb89e use spiPolledExchange for small transfers (#2358)
* configure for no cache

* this doesn't need a setting

* now we don't need invalidate

* reorder and comment

* mmc

* sw knock

* use spiPolledExchange for small transfers

* mock spi

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-17 14:48:21 -05:00
Matthew Kennedy 55facb6613 use DECLARE_ENGINE_PTR for Engine class (#2365)
* engine cleanup

* do the cleanup

* one last spot

* expand_engine noop for firmware

* simulator
2021-02-16 16:58:54 -05:00
Matthew Kennedy 37fa81b5d0 include board.c from hw_ports.mk (#2311)
* set mcu type in hw_ports

* move f4 linker script

* move f7 linker script

* don't set default linker file in makefiles

* extra line

* prometheus actually didn't depend on anything special for f469

* dead line

* h7

* dead

* move board.c

* set explicit cpu type for simulator

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 07:52:31 -06:00
Matthew Kennedy e22a9e9d02 -g3 to -g (#2256)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-31 14:13:55 -05:00
Andrey G 27905c6817 Chibi os 20 (#2212)
* Update ChibiOS

* Fix Makefiles includes paths

* halconf.h: remove flash hack

* mcuconf: fix EXTI ptiorityes

* Digital Input: ICU: use designated initializers, initialize 'arr'

* ChibiOS: lis302dl fix

* ADC: update to new API

* UARTConfig: timeout_cb field, formating

* ChibiOS: remove _exit, _kill, _getpid

* Fix lis302dl

* Bump config versions

* chconfig_common: cosmetic changes

* stm32f4ems: commulative config update

* Update Simulator

* ALLCSRC already contain all needed ChibiOS files.

Same for ALLINC and ALLCPPSRC

* ChibiOS fix for Simulator

* ChibiOS: port lock/unlock hook and MMC over SPI timeout

* STM32F7: update configs

* STM32F7: update linker file

* Cypress: port ADC lld to ChibiOS-20

* Cypress: port SPI lld to ChibiOS-20

* Cypress: port CAN lld to ChibiOS-20

* Cypress: fix include path for rules.ld

* Cypress: update chconf.h and halconf.h for ChibiOS-20

* Kinetis: update ADC lld to ChibiOS-20

* Kinetis: update SPI lld to ChibiOS-20

* Kinetis: update UART lld driver for ChibiOS-20

* Kinetis: update chconf.h and halconf.h for ChibiOS-20

* Kinetis: fix include path for rules.ld

* Nucleo F746: update ld script

* Nucleo F746: fix compile

* Bootloader: fix compilation with ChibiOS-20, cleanup

* Bootloader: add way to pass crosscompiler using CROSS_COMPILE

* Debug build arguments

* Simulator: fix windows compilation

Exclude syscalls_cpp.cpp from compilation
2021-01-19 15:20:35 -05:00
Matthew Kennedy 7617b115de Partition configs by board type (#2106)
* remove old flag

* flags

* reorder switch

* oops
2020-12-22 21:54:40 -05:00
rusefillc 39a292a46a trigger and start button pins not displayed by "pins" command fix #2084 2020-12-16 22:53:26 -05:00
Matthew Kennedy 6f491cf5c4 switch stm32 scheduling to use PWM driver (#1983)
* move to folder

* extract hardware part of microsecond_timer

* dead ST forum link

* de-volatile

* simulator build

* guard

* switch stm32 to pwm timer

* comments

* f7 mcuconf

* simulator

* guard

* warning

* header, cleanup

* constant

* less magic

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-11 00:44:40 -05:00
rusefillc 315bfe6531 avoid float -> int64 conversion #1977
cherry picking...
2020-11-23 23:33:46 -05:00
Matthew Kennedy be71d06dfc remove (#1985) 2020-11-23 20:10:17 -05:00
Matthew Kennedy 2792828dce 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
Matthew Kennedy 6b0c533d2c consolidate EFI_UNIT_TEST and friends (#1940)
* restructure

* guard c++

* idle too

* status_loop.h

* consolidate definitions

* use 1/0 instead, check for existence

* missed a few

* dead define

* defs for bootloader
2020-11-11 20:34:39 -05:00
Matthew Kennedy 8f6982dd54 disable i2c, other unused features (#1891)
* dead

* more
2020-10-20 22:24:32 -04:00