Commit Graph

211 Commits

Author SHA1 Message Date
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 8de8698490.

* 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
Matthew Kennedy c26987b96b
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 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
Andrey G 3d138958ce
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 f0cf4f38ff
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 cd4f367edd dead 2021-03-15 17:12:01 -04:00
Matthew Kennedy e0763c6994
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 47da1278e0
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 7b33ebfa9c
build (#2399) 2021-02-24 21:55:51 -05:00
Matthew Kennedy d933d18e29
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 39884f8934
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 b995e7bcaa
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 10c31c2955
-g3 to -g (#2256)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-31 14:13:55 -05:00
Andrey G 777979c3ca
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 55ebe223a7
Partition configs by board type (#2106)
* remove old flag

* flags

* reorder switch

* oops
2020-12-22 21:54:40 -05:00
rusefillc 26fbf0527a trigger and start button pins not displayed by "pins" command fix #2084 2020-12-16 22:53:26 -05:00
Matthew Kennedy 8ad2080df7
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 90e5630e60 avoid float -> int64 conversion #1977
cherry picking...
2020-11-23 23:33:46 -05:00
Matthew Kennedy 55379463c0
remove (#1985) 2020-11-23 20:10: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
Matthew Kennedy bb8650179c
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 e0bb7ad581
disable i2c, other unused features (#1891)
* dead

* more
2020-10-20 22:24:32 -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
rusefi adcf368cc9 Hellen says simulator 2020-09-07 12:19:17 -04:00
rusefi a6c7d60e5d a bit of flexibility 2020-08-26 23:12:08 -04:00
David Holdeman a0fbd8a81e
Properly catch simulator build failure (#1716)
* catch error

* file still returns 0 if not found
2020-08-21 22:46:00 -04:00
Andrei 068f21c616 vss_exti untested 2020-08-13 18:27:31 +03:00
rusefi 8764693179 TS SD integration #1653 2020-08-07 00:59:00 -04:00