Commit Graph

241 Commits

Author SHA1 Message Date
Matthew Kennedy a0d8ae3f4f
use libfirmware for a few things (#4351)
* use libfirmware

* unit tests

* crc

* missed one

* bootloader
2022-07-16 02:22:51 -04:00
rusefillc 7cbe3692e8 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 3c062e02bc
Lua hooks for gear detection (#4328)
* implement

* sim has vss

* write a test

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

* icu vestiges

* changelog
2022-07-07 15:27:59 -04:00
Matthew Kennedy a95bc3ad03
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 88b061dd2c stealing from David 2022-06-26 19:42:08 -04:00
rusefillc 2202c223fe helping simulator a bit 2022-04-30 13:08:53 -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
rusefillc f4fe1ce310
Explicit fw (#3968)
* explicit FW ID

* explicit FW ID

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

* do these do /anything/?
2022-02-03 20:43:34 -05:00
Matthew Kennedy 10be2d5f40
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 736c7f33d9
make the simulator smaller (#3869)
* small sim

* o2 is ok
2022-02-01 16:19:46 -05:00
rusefillc fcdb7b340d mk files refactoring
saving build
2022-01-06 22:19:00 -05:00
rusefillc 04ab6a0488 mk files refactoring 2022-01-06 21:48:48 -05:00
rusefillc a13a0a2cc9 mk files refactoring 2022-01-06 20:32:39 -05:00
rusefillc 7f0357ffcb mk files refactoring 2022-01-06 20:06:31 -05:00
rusefillc 7c0fd37dfe Live Data progress 2022-01-06 19:02:35 -05:00
Scott Smith a87be43c53
Update the simulator TS port macros to match the rest of the product. (#3600) 2021-11-23 19:15:09 -05:00
Matthew Kennedy 178ccdeb4d
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 3334a6963c
oh my god we've had no asserts (#3595) 2021-11-22 17:52:03 -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 d40ca0f581
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 cdd27abb09
turn on c++ 20 (#3579)
* set flags

* emit initializers

* jar
2021-11-19 22:19:34 -05:00
Matthew Kennedy a29933d7f8
simulator gets a heap (#3563) 2021-11-17 10:00:12 +03:00
rusefillc 6e9db86b38 helping launch enter simulator 2021-11-16 16:34:23 -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 37da55c920
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 d4132fdf01
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 95b5c6fcf9
dead vss flag (#3499) 2021-11-07 14:36:46 -05:00
Andrey 0e6a51e5c0 export board-specific macro for stm32 pins based on board yaml #3298
meta progress
2021-10-26 10:27:10 -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
rusefillc 392c91ef69 progress 2021-10-17 18:40:05 -04:00
Matthew Kennedy 9806373dac
dead map (#3316) 2021-10-04 18:33:10 -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
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 3518da97a7
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 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
Andrey a926357a01 making code more testable 2021-07-14 22:37:05 -04:00
Matthew Kennedy 5bd3ae3aaa
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 43e6cef77d
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 995ed02ff7 helping build? 2021-07-05 11:36:23 -04:00
Matthew Kennedy 1fd5b4560b
don't debug info (#2798) 2021-06-07 09:17:56 +03:00
Matthew Kennedy f3ff40724a
simulator usability (#2794)
* simulator

* simulator is debuggable

* s

* format
2021-06-04 01:34:49 -04:00
Matthew Kennedy 5cb659a7b0
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 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 0ea1f15ca3
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 54eeac2c10
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 8ac3de90fd
Hw layer rearrangement (#2705)
* Fix simulator compilation

* HW_SENSORS_SRC -> HW_SENSORS_CPP
2021-05-16 14:11:28 +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