Commit Graph

1874 Commits

Author SHA1 Message Date
Andrey a8355dd28f Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:57:01 -04:00
Andrey 6da3696c4c Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:48:26 -04:00
Andrey 9629db799b Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:30:52 -04:00
Andrey c5044f16c9 Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:15:53 -04:00
Andrey a2aaaa7b55 Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:10:34 -04:00
rusefillc af2e54f02d more details into output 2021-07-30 19:33:31 -04:00
rusefillc 08cc30d7c1 RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 19:13:43 -04:00
Matthew Kennedy 58202a97f3 flash erase cache invalidate (#3073)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-30 16:52:55 -04:00
Andrey 77659443a1 RUSEFI MSD to contain bundle-specific URL #2848
refactoring and progress
2021-07-30 16:23:01 -04:00
Andrey cda52ee946 RUSEFI MSD to contain bundle-specific URL #2848
refactoring and progress
2021-07-30 16:07:37 -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
Andrey 379996bf81 todo 2021-07-25 12:45:28 -04:00
Andrey 230a5d46e7 Clutch switch inverted options do not invert detected pedal position
#3044
2021-07-24 18:44:13 -04:00
rusefillc 809ece6c91 Clutch switch inverted options do not invert detected pedal position #3044 2021-07-24 15:54:51 -04:00
Matthew Kennedy 098469b88c H7 ADC triggered by hardware timer (#3028)
* config

* allow changing adc speed

* timer triggered ADC

* ICU on nucleo

* turn that off too

* 10khz

* make those default for all h7

* I can't type
2021-07-23 14:50:35 -04:00
Matthew Kennedy 1a73dcc46e fast adc callback (#3031)
* fast adc callback

* guard

* missed one

* now cypress will be happy
2021-07-23 14:19:59 -04:00
Matthew Kennedy 0fde085a44 remove TS file read (#3004)
* remove

* more defines

* test

* lots of java

* s
2021-07-21 14:24:53 -04:00
Matthew Kennedy dfaac25df1 sd card indicators (#3001)
* sd bits

* rusefi.input
2021-07-20 21:29:24 -04:00
Matthew Kennedy 2255ce37b4 H7 turn off USB before reset (#2999)
* turn off USB before reset

* comment

* add link
2021-07-20 19:39:26 -04:00
Andrey fb30117acc Button to apply nDBANK #2996
still does not work
2021-07-20 15:42:57 -04:00
Andrey 8eb407627e Button to apply nDBANK #2996
it does not work, i give up for now time to install STM Cube :(
2021-07-20 14:15:58 -04:00
Andrey 668c342b34 Button to apply nDBANK #2996 2021-07-20 13:20:34 -04:00
Matthew Kennedy 7c2f20af49 osc detector on H7 (#2992)
* detect clock with TIM11 instead of TIM5

* s

* h7 has a different register name

* detect on H7

* cleanup

* comment

* use define

* f4 typo
2021-07-19 21:58:23 -04:00
Matthew Kennedy dec215f199 detect clock with TIM11 instead of TIM5 (#2989)
* detect clock with TIM11 instead of TIM5

* s

* h7 has a different register name

* s

* rename
2021-07-19 18:04:59 -04:00
rusefillc 79f04983eb New hardware testing commands #2978 2021-07-17 13:42:10 -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
Matthew Kennedy 45d185b09d lua hooks for CAN tx (#2967)
* CanTxMessage usable from unit test

* testLuaReturnsNil

* CAN hook and tests

* it helps if parameter names exist

* nameless params

* s

* redefinition of default argument

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-16 14:06:26 -04:00
Andrey 85d6d6c70d trigger signal debug pins - logic level output #2959
test driven development is still amazing
2021-07-15 09:29:14 -04:00
Andrey 8a49009f44 trigger signal debug pins - logic level output #2959 2021-07-15 02:12:57 -04:00
Andrey 0f7def86dc all aboard the God object! 2021-07-15 02:00:48 -04:00
Andrey aed7afa1d4 trigger signal debug pins - logic level output #2959 2021-07-15 01:56:04 -04:00
Andrey 8dff4c3c31 trigger signal debug pins - logic level output #2959 2021-07-15 01:49:07 -04:00
Andrey 050a009b3d trigger signal debug pins - logic level output #2959 2021-07-15 01:46:30 -04:00
Andrey 0f30fec7c2 trigger signal debug pins - logic level output #2959 2021-07-15 01:28:44 -04:00
Andrey 3327dc0199 progress 2021-07-15 01:18:38 -04:00
Andrey 1d2fdb0f04 progress 2021-07-15 01:17:42 -04:00
Andrey e4c498e042 trigger signal debug pins - logic level output #2959 2021-07-15 00:50:29 -04:00
rusefillc 8e8737d6ce trigger signal debug pins - logic level output #2959 2021-07-15 00:03:31 -04:00
Andrey d1b3eb065d trigger signal debug pins - logic level output #2959 2021-07-14 23:20:18 -04:00
Andrey bb38cc60eb trigger signal debug pins - logic level output #2959 2021-07-14 23:05:51 -04:00
Andrey b53b23b140 trigger signal debug pins - logic level output #2959 2021-07-14 22:51:08 -04:00
Andrey 122ef9f637 making code more testable 2021-07-14 22:37:05 -04:00
Andrey 072243370f making code more testable 2021-07-14 22:02:28 -04:00
Matthew Kennedy c08eb18ca7 Start on HSI clock (#2957)
* chibios uses HSI

* set pll to use HSE

* simplify capture

* even better logging

* string

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-14 15:20:38 -04:00
rusefi ad37021a0b printing autoDetectedPllMValue in console 2021-07-14 12:42:35 -04:00
Andrey 564c380851 trigger signal debug pins - logic level output #2959 2021-07-13 20:15:55 -04:00
Andrey 903c6e7305 refactoring - making method available 2021-07-13 19:28:03 -04:00
Andrey b3f33a1249 trigger signal debug pins - logic level output #2959 2021-07-13 18:16:32 -04:00
Matthew Kennedy 15931dd56c auto detect HSE clock speed (#2952)
* detect hse

* implementation

* these boards don't need to set their own HSECLK

* assertions

* name

* tweaks

* how did this compile?

* s

* biiiig comment

* this script doesn't need to set 25mhz any more

* ....or PLLM

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-12 20:51:35 -04:00
rusefillc b0bfff2c4d typo 2021-07-11 10:16:35 -04:00
Matthew Kennedy 1bba234920 inject (#2938) 2021-07-09 17:02:25 -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
Andrey G d508537374 Chibios-Contrib for stm32 (#2903)
* Add Chibios-Contrib for STM32F/H too

* ports: stm32: add community hal and cmu configs for STM32

* ports: stm32: community: disable CRC driver
2021-07-05 09:53:45 -04:00
Matthew Kennedy ee6f49e65f Consolidate hwHandleShaftSignal (#2875)
* consolidate trigger input

* merge functions

* comment

* dead

* hw vs. not hw

* stray comma

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-28 10:06:22 -04:00
Matthew Kennedy b0ef8313cd warnings (#2862)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-25 20:58:38 -04:00
Andrey G 77b9a9a99d Fixes eg33 (#2838)
* CAN HW: use designated initizalization

* board subaru eg33: set CAN transceiver EN to active state constantly

While FW does not handle CAN transceiver's EN signal
2021-06-20 08:18:16 -04:00
Andrey G 84856f3073 Fixes (#2807)
* tle6240: fix Matt's trap

* map: report some default value if no map sensor configured

Othervise user will get "unexpected MAP value" warning

Thread 2 hit Breakpoint 1, validateMap (mapKPa=3121.66162) at ./controllers/sensors/map.cpp:126
126		if (cisnan(mapKPa) || mapKPa < CONFIG(mapErrorDetectionTooLow) || mapKPa > CONFIG(mapErrorDetectionTooHigh)) {
(gdb) bt
 0  validateMap (mapKPa=3121.66162) at ./controllers/sensors/map.cpp:126
 1  0x002717dc in getMap () at ./controllers/engine_cycle/map_averaging.cpp:334
 2  0x0028175a in GetMapWrapper::getMap (this=0x2004214c <mapWrapper>) at ./init/sensor/init_map.cpp:12
 3  0x0028177c in operator() (__closure=0x0) at ./init/sensor/init_map.cpp:20
 4  0x002817a8 in _FUN () at ./init/sensor/init_map.cpp:21
 5  0x002811de in FunctionPointerSensor::get (this=0x20042150 <mapSensor>) at ./controllers/sensors/function_pointer_sensor.h:24
 6  0x002651c0 in SensorRegistryEntry::get (this=0x2003ddf0 <s_sensorRegistry+48>) at ./controllers/sensors/sensor.cpp:111
 7  0x002653e2 in Sensor::get (type=SensorType::Map) at ./controllers/sensors/sensor.cpp:208
 8  0x00261f38 in updateTunerStudioState (tsOutputChannels=0x2003d2e8 <tsOutputChannels>) at ./console/status_loop.cpp:637
 9  0x00262e48 in prepareTunerStudioOutputs () at ./console/status_loop.cpp:900
 10 0x00260914 in TunerStudio::cmdOutputChannels (this=0x20021a64 <tsInstance>, tsChannel=0x2003d4dc <usbChannel>, offset=0, count=340) at ./console/binary/tunerstudio_commands.cpp:24
 11 0x00260584 in TunerStudioBase::handleCrcCommand (this=0x20021a64 <tsInstance>, tsChannel=0x2003d4dc <usbChannel>, data=0x2003d4e1 <usbChannel+5> "", incomingPacketSize=5)
    at ./console/binary/tunerstudio.cpp:701
 12 0x0025fb3c in tsProcessOne (tsChannel=0x2003d4dc <usbChannel>) at ./console/binary/tunerstudio.cpp:537
 13 0x0025fbe2 in TunerstudioThread::ThreadTask (this=0x2003d608 <usbConsole>) at ./console/binary/tunerstudio.cpp:554
 14 0x0025f094 in ThreadController<1200>::StaticThreadTaskAdapter (thread=0x2003d608 <usbConsole>) at ./controllers/system/thread_controller.h:37
 15 0x0020035e in _port_thread_start () at ChibiOS/os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.S:201
2021-06-10 19:39:48 -04:00
Matthew Kennedy e3bf80b9d7 convert gpiochips to c++ (#2761)
* core

* basic header

* tests are happy

* tle6240

* tle8888

* 33972

* 33810

* tle8888_req_init

* unused warning

* warning

* unsigned

* 8888 debug

* fix

* don't qualify

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-10 04:11:01 -04:00
Matthew Kennedy e68d920a9b Assorted todos (#2762)
* gpiochip todos

* fuel computer

* this was already done
2021-05-30 19:23:29 -04:00
Matthew Kennedy 66ab47a8d2 remove old config override (#2763) 2021-05-30 13:31:36 +03:00
Andrey G 032fa6c435 mc33810: set ignition outputs to GP mode (#2756)
IGN mode does not want to fire Subaru ignitor
2021-05-29 05:07:04 -04:00
Matthew Kennedy ca625e7935 non blocking flash on f7 dual bank 2MB (#2749)
* f7 dual bank flash

* only start thread if necessary
2021-05-29 08:05:29 +03:00
Andrey G b4dce2c26d Flash fix erase check (#2750)
* Fix flash erase error formating

* Flash F7: do magic calculation with local copy of sector number

* Falsh stm32: simplify

* typo?
2021-05-28 20:35:54 +03:00
Andrey 4085e5be00 mkfs.fat phase kills gen_config #2736 2021-05-24 15:35:35 -04:00
Andrey 4db545a241 mkfs.fat phase kills gen_config #2736 2021-05-24 09:04:37 -04:00
David Holdeman 68da5c279e Doxygen titles (#2728)
* move addRow call

* undo submo bump

* add header titles
2021-05-22 22:10:58 +03:00
Matthew Kennedy c7cc5471ad Lua on f407, try again (#2725)
* lua on f4

* move perf trace to efifeatures

* check that it's defined

* cypress and kinetis

* it would help to define the correct thing

* disable buffer if not used

* we can work with 2k

* turn off ramdisk on mre qc

* wow strncpy is useless for truncated strings

* turn off for bootloader

* lto bootloader

* memory

* memory
2021-05-20 23:05:18 +03:00
Andrey 57a015e6fb refactoring magic constant STOICH_RATIO 2021-05-20 02:36:55 -04:00
Matthew Kennedy be41a96511 actually fix F7 flash this time (#2719)
* f7 sector sizes

* loop dsb

* correct sector index on f7
2021-05-18 17:40:59 -04: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 0faa8a0166 Hw layer rearrangement (#2705)
* Fix simulator compilation

* HW_SENSORS_SRC -> HW_SENSORS_CPP
2021-05-16 14:11:28 +03:00
Andrey G 6d849d05c7 Hw layer rearrangement (#2703)
* max31855: move to sensors

* uart GPS driver: move to sensors and rename

* i2c_bb: move to drivers

* LCD HD44780: move to drivers

* ping?
2021-05-16 06:01:00 -04:00
Matthew Kennedy b38a58fffb don't expose private state (#2696)
* don't expose private state

* fix tle init
2021-05-14 14:56:45 -04:00
rusefillc cd573a5f9d hiding 8888 mess under the rug
making LPS25 one step more available to Hellen
2021-05-14 10:54:40 -04:00
Andrey G 636c68efe2 Adc fixes (#2691)
* ADC: save few bytes

* ADC: fix limit checking, add note for futher users

* ADC: not used anymore
2021-05-13 15:51:18 -04:00
Andrey G f9d2694dfd mc33810 (#2684)
* mc33810: ENABLE outputs

* mc33810: enable Dwell time control
2021-05-11 18:17:06 -04:00
Matthew Kennedy 10de5ca77a s (#2683) 2021-05-11 15:45:35 -04:00
Matthew Kennedy da1d8edfa1 no sd if early fatal (#2680) 2021-05-10 14:31:40 -04:00
Matthew Kennedy 3dd6b2efc9 move FSIO aux analog inputs to sensor model (#2669)
* sensor entries

* init

* non-explicit for list init to work

* switch fsio

* no longer need this lua hook

* init
2021-05-09 19:47:37 -04:00
rusefillc 591b2b3c6c Revert "lua on f407 (#2646)"
This reverts commit e35e99f5
2021-05-09 18:25:50 -04:00
Matthew Kennedy e35e99f52d lua on f407 (#2646)
* lua on f4

* move perf trace to efifeatures

* check that it's defined

* cypress and kinetis

* it would help to define the correct thing

* disable buffer if not used

* we can work with 2k

* turn off ramdisk on mre qc

* wow strncpy is useless for truncated strings

* turn off for bootloader

* lto bootloader
2021-05-09 16:25:38 -04:00
Matthew Kennedy 870538bc63 move ADC pin initialization (#2660)
* set the pin in adc subscription land

* remove from adc_inputs

* more subscriptions

* use our lib instead
2021-05-09 14:36:11 -04:00
Matthew Kennedy 33fc8a7185 ini drive contents update (#2665)
* add shortcuts

* move readme

* nozip version of readme

* scripts

* set the filename
2021-05-09 12:18:55 -04:00
Matthew Kennedy 03ea9fa13a Support STM32F7 1MB devices (#2659)
* modify linker script for 1MB devices

* handle null flash address

* actually support 1MB F7

* comment
2021-05-09 09:19:20 -04:00
Andrey G dd46591ad5 hip9011 (#2658)
* hip9011: isolate debug stuff

* hip9011: renames

* hip9011: start sensing knockDetectionWindowStart degres from fire

* engine: more realistic values for knock window

* hip9011: remove magic CS toggling

* hip9011: EFI_HIP_9011_DEBUG should depend on EFI_HIP_9011
2021-05-08 18:43:55 -04:00
Andrey G ea870c4869 hip9011 (#2654)
* Move HIP states enum out of rusefi_enums.h

-this is internal driver stuff. No need to have it defined globaly.

* Auto-generated configs and docs
2021-05-08 10:08:18 -04:00
Andrey G dd2f8fe457 hip9011 update (#2653)
* hip9011: add check for SPI reply in advanced mode

* hip9011: read value over SPI in advanced mode
2021-05-08 09:50:28 -04:00
Matthew Kennedy 37a3de07cf remove stateChangeCallback from simplepwm (#2644)
* remove callback parameter from cj125

* remove from ext

* remove stateChangeCallback

* alt doesn't need that

* demorgan

* remove call

* bad cut/paste

* check the actual pin in the test
2021-05-07 09:38:41 -04:00
Matthew Kennedy ea6cb14780 move some stuff in to ccm (#2645)
* stuff in ccm

* used memory
2021-05-07 09:35:57 -04:00
Andrey G f2a194e035 Kill warnings (#2623)
* dead code

* rtc_helper: clean-up warnings

* kill unused
2021-05-04 18:55:27 -04:00
Matthew Kennedy 088ed3c28e interactive lua (#2614)
* interactive lua

* unnecessary pop

* print return value

* enable f7 lua

* match f7 chconf
2021-05-03 17:46:12 -04:00
Andrey G 2176d1656b ADC: internalIndex should be used as getAvgAdcValue argument (#2618)
* ADC: internalIndex should be used as getAvgAdcValue argument

-plus output messages re-formated

* ADC: logger -> efiPrintf
2021-05-03 16:44:19 -04:00
rusefi 24a15646bd Proteus QC build 2021-04-30 13:57:33 -04:00
Matthew Kennedy a470c1eec1 lua 5.4 (#2590)
* thread priority

* build

* makefile prep

* call startup

* lua 5.1

* mk

* 5.3

* mk

* I guess lua does something?

* extract hooks, builds for tests

* a bit of error handling

* guard

* bootloader makefile

* remove lua

* submodule

* submodule update

* builds with submodule

* disabled by default

* h7 chconf

* tweaks

* add a useful hook

* move luaconf

* perf trace lua

* test helpers

* lua unit tests

* include to satiate clang
2021-04-28 22:41:25 -04:00
Andrey G 605378f829 Subaru board update (#2600)
* board: subaru eg33: linker script: stack, bss and heap to ram0

* Board: Subaru EG33: clean-up configs

* board-subaru-eg33: fix board config

* engine: subaru: eg33: fixes
2021-04-28 20:25:33 -04:00
Andrey G 28f0e3b0f6 Mc33972 update (#2599)
* MC33972: update

-per-instance thread
-enable pull-ups for enabled pins only

* smart-gpio: mc33972: uses 8-bit spi frames

3 bytes are sent to make 24-bit frame
2021-04-28 18:29:35 -04:00
Matthew Kennedy 7c8c14fee2 Baro config (#2591)
* adjust API to allow i2c init to fail

* init

* proteus config

* 🎠🎠🎠

* buh

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-27 15:29:22 -04:00
Matthew Kennedy addf97ee08 prep for lua (#2589)
* thread priority

* build

* makefile prep

* call startup

* s
2021-04-27 07:57:08 -04:00
rusefillc e4c0336cea F429 MCU says it's too cold #2552 2021-04-25 09:11:57 -04:00
shadowm60 4ea719c60c Handle can message cyclicity (#2573)
* Handle can message cyclicity

update of canDash to support different cyclicity of messages

* review updates
2021-04-23 20:16:27 -04:00
rusefi be0f2210c5 improving QC process 2021-04-22 21:23:20 -04:00
Andrey G 38a9e92b53 HD44780: start pins on init (#2576)
This fixes bug introduced in 75098a0d4b
Sorry!
2021-04-21 15:33:58 -04:00
Matthew Kennedy b6fc9befc8 finish it off: remove scheduleMsg (#2575)
* finish it off

* one more logger ptr

* fwd decl

* Revert "one more logger ptr"

This reverts commit a21fb0087ddc748978d716db2710800cf26e437b.

* unused

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 15:33:40 -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
Matthew Kennedy 967383dd8e remove simple cases of LoggingWithStorage (#2569)
* remove simple cases

* more simple

* serial

* s

* more

* try memory

* easy

* mmc acc

* that's how much memory

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-19 08:11:59 -04:00
Matthew Kennedy 992c16b4af logging cleanup 2: sensors, pid, etb, etc (#2567)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 20:02:32 -04:00
Matthew Kennedy babb43013f rewrite text logging system (#2439)
* minor cleanup

* enable mailboxes

* priority

* implement new logger

* more cleaning

* signature

* remove debug

* put the assertion back in

* remove debugging

* spelling

* doy

* tweaks & comments

* cleaning

* size_t

* guard more

* test build now

* needs more ram until we can remove LogginWithSTorage

* hunt for memory

* bootloader

* unused

* stub simulator

* it would help to get the signature right

* geez kinetis only has 64k ram

* more guarding because kinetis

* that's now very legal and very cool

* templatify

* s

* force null terminate

* probably fix

* const

* write a test

* disable sensor chart for now

* hide SC ui

* oh nope that breaks many things

This reverts commit c3c1bb324fb484c3d9cc44b7715c234bc0392e1e.

* missed one

* reset after scheduleLogging

* we can't print out the full message because it contains commas which break parsing

* force terminate long buffers

* let's see how much memory we have to play with

* a lot, is the answer

* real thread name

* shrink this for now before its deleted

* turn that back on

* biiig comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 18:46:47 -04:00
rusefillc 57dcc927c9 flush SD log 10x faster #2558 2021-04-15 09:42:22 -04:00
Matthew Kennedy a5d6cb9337 flush 10x faster (#2558)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-15 09:31:38 -04:00
rusefillc b5ac82913b nothing happens here 2021-04-13 23:32:32 -04:00
Matthew Kennedy 6a2a6da67f multiple mass storage (#2535)
* driver

* plumbing

* guard adjust

* read correct lun

* de-template

* rearrange

* guard

* guard

* memory

* headers

* memory

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-10 08:35:41 -04:00
Andrey G a0053d5845 hip9011 and friends (#2527)
* engine math: extrant getFiringOrderTable for reuse

* engine math: getNextFiringCylinderId helper

* introduce knock_logic: first member is getCylinderKnockBank()

moved from software_knock.cpp

* hip9011: support two inputs/banks

* fix CI

* Board Subaru EG33: populated with TPIC8101 with Advanced mode

* hip9011: test communication in advanced mode

* hip9011: handle situation when chip is already in advanced mode

* Board Subaru EG33: cylinder to knock bank mapping

* hip9011: count spi transactions in advansed mode too

* hip9011: reset incalid responce counter after chip initialization

* hip9011: make debug output more structured
2021-04-04 18:13:21 -04:00
Matthew Kennedy b7aacbe622 h7 dfu and comments (#2522) 2021-04-03 21:58:29 -04:00
rusefi 53689d91aa explicit status for MSD SD mode 2021-04-03 19:42:54 -04:00
rusefi 1d9ba89273 SD init: document or fix unlock SPI fix #2516 2021-04-01 16:21:19 -04:00
rusefi da64802066 SD init: document or fix unlock SPI #2516 2021-04-01 16:20:08 -04:00
Matthew Kennedy 761e65c710 make board config override actually usable (#2508)
* new function

* hellen

* MRE

* proteus

* put those function declarations in a reasonable place

* put the comment back

* weak

* move that to a reasonable place

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-31 14:46:50 -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 ff12c4d214 speed up boot by 48 ms (#2506)
* speed up boot

* two
2021-03-29 22:59:38 -04:00
Matthew Kennedy 1b69ae320e enable serial pins on proteus (#2507)
* enable serial on proteus

* make h7 happy
2021-03-28 17:03:14 -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
Andrey G 5fda278503 hip9011: get callback from spark on each cylinder (#2499)
* hip9011: get callback from spark on each cylinder

* hip9011: cleanup unused
2021-03-27 14:12:49 -04:00
Matthew Kennedy ce142907a0 replace print/printMsg with scheduleMsg (#2497)
* start cleaning

* disabled feature means don't print that it's disabled

* cli

* usages

* printMsg -> scheduleMsg

* this is alllll dead now

* no crlf please

* all hope is lost if you manage to hit this line

* tests

* tests

* ok we did actually need that part

* sim

* d

* kinetis

* it did ifdef, not if

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-26 17:23:26 -04:00
Matthew Kennedy 368415972e read configuration from flash exactly once (#2481)
* early hw init

* s

* read configuration exactly once

* cleanup

* housekeeping

* test friendly

* ugh bad merge

* that is a noop

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-25 18:16:26 -04:00
Matthew Kennedy 2839c6f069 use cpp (#2493) 2021-03-25 18:12:17 -04:00
Matthew Kennedy 53a579abbf move some initialization steps earlier (#2480)
* early hw init

* s

* Revert "s"

This reverts commit 10d3039168613cfb2b0cf1c960d2f18894745ce3.

* bor

* I can't type

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-25 16:22:03 -04:00
Matthew Kennedy 92d249918b rename setBoardConfigurationOverrides (#2479)
* rename

* proteus

* comments

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-22 14:15:09 -04:00
Matthew Kennedy e38aa3aa8c fix (#2478) 2021-03-20 22:07:52 -04:00
Andrey G aa05ff195d Hip9011 and cleanups (#2477)
* hip9011: move hipCs out of EnginePins to hip9011 driver

* hip9011: cleanup debug output, save few RAM bytes

* Supress few signed vs unsigned warnings
2021-03-20 08:40:36 -04:00
Matthew Kennedy d65190b8a5 embiggen MSD stack (#2475) 2021-03-19 19:56:47 -04:00
Matthew Kennedy 7cdad67f3f USB uses its own channel, add implementations for serial channels (#2472)
* USB uses its own channel

* revise channels

* put serial ports in their own file

* h7 uart incompatible for now

* guard for sim
2021-03-19 17:05:04 -04:00
Matthew Kennedy cb33bb77ae Dedicated code path for USB console/TS (#2465)
* new apis

* dedicated USB path

* move decl

* init

* don't init usb twice

* guard

* check that we're initialized before using TS

* comment

* guard

* guard USB

* brain doesn't go good

* make tests happy

* dead define

* cypress

* ifdef != if

* s

* include priority

* don't start a thread we know we don't need

* bad-ish merge

* const

* why did this code exist...?

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-18 14:07:22 -04:00
Matthew Kennedy 925a6ca086 harden against various no-boot scenarios (#2468)
* zero length trigger

* validate config

* validate cylinder count

* wrong type on cylinder count

* invalid comment

* invalid SPI
2021-03-17 09:24:13 -04:00
Matthew Kennedy c168c748ea dead code, warnings (#2461) 2021-03-15 10:23:19 -04:00
Matthew Kennedy 910f46267f VVT uses closed loop controller framework (#2453)
* vvt uses framework

* builds

* rename, update headers

* s

* testable

* write some basic tests

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-14 19:31:46 -04:00
Matthew Kennedy 540b9000d5 implement ads1015 driver (#2458)
* first approximation of ads1015

* fix ads

* misc

* comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-14 19:02:42 -04:00
Matthew Kennedy 5cc2efc3e5 use full memory on STM32F42x (#2450)
* linker script

* hook it up
2021-03-13 07:26:58 -05:00
Matthew Kennedy 19e77b31f4 put back (#2452) 2021-03-13 06:59:33 -05:00
GitHub build-firmware Action c9c39ed728 Auto-generated configs and docs 2021-03-13 02:26:53 +00:00
GitHub build-firmware Action d5e0f7a016 Auto-generated configs and docs 2021-03-12 05:52:29 +00:00
GitHub build-firmware Action 5b25a39955 Auto-generated configs and docs 2021-03-12 05:18:18 +00:00
GitHub build-firmware Action 17c2ecc227 Auto-generated configs and docs 2021-03-12 04:19:00 +00:00
rusefillc 9f90387d09 vBatt -> SensorType::vBatt fix #2260 2021-03-11 23:07:18 -05:00
rusefillc 98eae45094 vBatt -> SensorType::vBatt #2260 2021-03-11 22:52:34 -05:00
GitHub build-firmware Action d94ed8a45a Auto-generated configs and docs 2021-03-11 19:11:45 +00:00
GitHub build-firmware Action 08081f179f Auto-generated configs and docs 2021-03-11 13:40:39 +00:00
GitHub build-firmware Action 55caa17ac8 Auto-generated configs and docs 2021-03-11 04:22:28 +00:00
GitHub build-firmware Action 035d783120 Auto-generated configs and docs 2021-03-11 02:16:35 +00:00