Commit Graph

1687 Commits

Author SHA1 Message Date
Matthew Kennedy 3412d8fe64 move f4 board.h (#2313)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 15:29:07 -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 c0757a7d13 simplify MCU selection (#2308)
* 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
2021-02-08 02:11:44 -05:00
Matthew Kennedy 63c9612602 implement lps25 (#2301)
* bb

* implement

* tweaks

* s

* comment, format

* guard

* implement lps25

* headers and comment

* sensor works

* headers

* guard

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-06 23:59:44 -06:00
Matthew Kennedy a5f269d733 implement bit-banged I2C driver (#2289)
* bb

* implement

* tweaks

* s

* comment, format

* guard

* headers and comment
2021-02-06 16:59:06 -06:00
Andrey G 04c7ad67aa Some fixes prior to board pull request (#2291)
* ChibiOS: add support for STM32F765

This chip is used on Subaru EG33 p'n'p RusEFI board from Dron_Gus

* drivers: gpio: mc33810: commulative update

- use BIT macro
- fix wake-up method
- fix order of arguments in _add function

* port: stm32f4/7: detectCanDevice check for enabled interfaces only

* ADC: fix internal array size

internalAdcIndexByHardwareIndex should be EFI_ADC_LAST_CHANNEL size
couse adc_channel_e is used as index

* status LEDs: support status LEDs that driven by low level
2021-02-06 12:22:57 -05:00
rusefillc 4936b9fab3 reducing code duplication 2021-02-06 00:46:40 -05:00
rusefillc 83d8bd9369 H7 compilation #2284 2021-02-06 00:37:12 -05:00
rusefillc 7c107a6551 reducing code duplication 2021-02-06 00:25:13 -05:00
rusefillc 0573d29b22 reducing code duplication 2021-02-06 00:18:47 -05:00
rusefillc 096c67b4de H7 compilation #2284 2021-02-05 23:57:28 -05:00
rusefillc 3be5714e94 H7 compilation #2284 2021-02-05 23:37:18 -05:00
rusefillc bb7af93e66 let's build for h7 2021-02-05 22:29:23 -05:00
rusefillc c549a13c1f let's build for h7 2021-02-05 22:10:59 -05:00
rusefillc d824f3d12a let's build for h7 2021-02-05 21:37:33 -05:00
rusefillc 5afcb400a7 let's build for h7 2021-02-05 21:09:36 -05:00
Matthew Kennedy 3cf6b67b87 fix #2269 (#2272)
* fix #2269

* cleanup
2021-02-03 08:04:22 -06:00
rusefillc 11aa253ae9 vvt/cam events to pass index 2021-01-31 22:24:45 -05:00
rusefillc 845ad4e53d trigger: exti: callback parameter is now index 2021-01-31 22:10:10 -05:00
rusefillc 1243225c07 code style 2021-01-31 22:02:01 -05:00
rusefillc b571feffac code style 2021-01-31 21:45:01 -05:00
Matthew Kennedy 9d86488e07 USB reports real STM32 Serial Number (#2254)
* mpu util data

* implementation
2021-01-30 14:51:11 -05:00
rusefillc f8f90cbffb No hablo inglés 2021-01-28 20:43:23 -05:00
rusefillc cbca40dec0 fixing port I 2021-01-25 00:29:48 -05:00
rusefillc fc15eb979b fixing port I 2021-01-22 23:31:21 -05:00
rusefillc 673de10118 Hellen needs text representation of GPIOI
H7 dreams are asking for J and K
2021-01-22 01:25:05 -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
rusefi c0abf52bd8 OMG we are not using java yet?! 2021-01-18 19:00:53 -05:00
rusefi 4dcd8a6308 https://refactoring.com/catalog/replaceMagicLiteral.html 2021-01-18 18:54:18 -05:00
Matthew Kennedy 4e6c841729 boost fixes (#2230)
* fix boost pin reinit

* call boost from periodic slow

* ui

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-01-18 07:04:14 -05:00
Andrey G d134fabc51 Simplify Makefile, unify board.mk files (#2229)
* Proper way to add lis302 driver

* Proper way to add license directory to includes

* Makefile: simplify

All ChibiOS stuff is accumulated in ALLCSRC, ALLINC and so on.

* board.mk: append sources and includes to ALLSRC, ALLCPPSRC, ALLINC

* Cypress: fix CANv2 includence into build
2021-01-17 09:32:06 -05:00
Andrey G 052e2e558b Supress annoing unused warnings (#2216) 2021-01-11 08:49:20 -05:00
rusefillc 5eeb48be51 cherry pick from https://github.com/dron0gus/rusefi/tree/ChibiOS-20 2021-01-09 19:15:50 -05:00
rusefillc ef44f47d5b Lcd fix (I hope) #2211
there is still an issue :(
2021-01-09 17:30:39 -05:00
Andrey G 75098a0d4b Lcd fix (I hope) (#2211)
* LCD: check if settings are valid on each access

* Lada Kalina: remove duplicate code

All LCD pins are set to GPIO_UNASSIGNED in disableLCD()

* Remove duplicate code

* We still need to know when invalid gpio is used...

This reverts commit 9c12c4dd44.
2021-01-09 17:16:10 -05:00
rusefillc 9c12c4dd44 dron0gus please help 2021-01-09 15:31:09 -05:00
Andrey G b61ae75fe2 gpio helper (#2195)
* gpios: isBrainPinValid helper

* LCD HD44780: do not touch pins if DM_NONE or invalid gpio

* Fix isEnabled checks for GPS and Joystick

* LCD HD44780: writePad use this method wider
2021-01-08 20:01:26 -05:00
rusefillc 5a75c69b8e knock v12 2021-01-06 19:42:07 -05:00
Andrey G f962a7bd64 Gpio cleanup #2 (#1530)
* pin repository: PIN_USED size in now equal to brain_pin_e enum size

expect special values...

* smart gpios: register gpio chip to given base (no auto-allocation)

* drivers: gpio: core: add gpiochip_unregister()

* drivers: gpio: MC33810 intergation

* smart_gpio.cpp: cleanup ifdef mess, minor cleanups

* gpio: core: additional check for gpio ranges overlaps

* unit test: gpio chip: fixed and extended
2021-01-06 18:29:47 -05:00
Andrey G 12728ccd82 Call startSmartCsPins when applying new settings (#2194)
Only stopSmartCsPins was called from applyNewHardwareSettings.
This cause lost of CS pins for external gpio chips
2021-01-06 08:59:13 -05:00
Andrey G 71fe582ce5 Adc isAdcChannelValid helper (#2188)
* Guard define argument

* ADC: isAdcChannelValid

Check for both <= EFI_ADC_NONE and >= EFI_ADC_LAST_CHANNEL
Also check for value out of enum range (corrupted settings)

* Fix unit tests
2021-01-05 16:02:20 -05:00
Matthew Kennedy 279f8bad03 use limp mgr for trigger disable (#2145)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-26 18:12:36 -05:00
Matthew Kennedy 9a1217a128 actually use button name (#2126)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-24 07:30:56 -05:00
rusefi 4c347026ff Proteus is compiled without VSS feature #2122 2020-12-22 21:28:51 -05:00
rusefi 06e72d6676 trigger and start button pins not displayed by "pins" command #2084 2020-12-22 21:20:57 -05:00
rusefi a06c58d916 trigger and start button pins not displayed by "pins" command #2084 2020-12-22 21:05:49 -05:00
rusefi a65a5330de trigger and start button pins not displayed by "pins" command #2084 2020-12-22 20:54:28 -05:00
rusefi da70fdced4 trigger and start button pins not displayed by "pins" command #2084 2020-12-22 20:53:05 -05:00
rusefi 6ddfff8fd9 Proteus is compiled without VSS feature #2122 2020-12-22 20:50:01 -05:00
rusefi 1e4ae3868c trigger and start button pins not displayed by "pins" command fix #2084 2020-12-22 20:42:30 -05:00
Matthew Kennedy d3a24c568a gpio unit tests (#2099)
* fix unregister api for gpio

* consumers

* guard with a critical section

* index

* guard less

* unregister under lock

* fix reinit

* dead flag

* fix most tests

* initialize properly

* initialize properly

* assertions in tests

* fix message

* move gpio mocking

* test gpios

* we must lock earlier to be truly safe

* this was using huge memory

* devirtualize

* test deinit
2020-12-18 17:19:02 -05:00
Matthew Kennedy 30fd52d82d Fix gpio reinit race condition (#2098)
* fix unregister api for gpio

* consumers

* guard with a critical section

* index

* guard less

* unregister under lock

* fix reinit

* dead flag

* fix most tests

* initialize properly

* initialize properly

* assertions in tests

* fix message

* we must lock earlier to be truly safe

* this was using huge memory

* devirtualize
2020-12-18 17:18:12 -05:00
rusefillc 33bc6b7957 HW CI is flaky :( #2063
more detailed error messages
2020-12-17 20:22:04 -05:00
rusefillc 39a292a46a trigger and start button pins not displayed by "pins" command fix #2084 2020-12-16 22:53:26 -05:00
rusefillc 88bb2f4569 trigger and start button pins not displayed by "pins" command fix #2084 2020-12-16 22:24:19 -05:00
rusefillc f147aabcd7 trigger and start button pins not displayed by "pins" command #2084
progress but not complete fix yet
2020-12-16 22:00:42 -05:00
Andrey G 119ac4f6f5 TLE8888: temp fix of #2065 (#2079) 2020-12-14 15:33:27 -05:00
Matthew Kennedy 27e4d89f5a add support for ext ids (#2060)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-12 16:34:21 -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
Matthew Kennedy ce2e7d3cbe fix mock pins array (#2050)
* fix

* fix probably
2020-12-10 00:10:58 -05:00
rusefillc 2f15c08498 basic hw in the loop - pwm self validation #2028 2020-12-08 04:52:49 -05:00
rusefillc 3a3586f730 basic hw in the loop - pwm self validation #2028 2020-12-07 20:42:47 -05:00
rusefillc 89cebd7d72 basic hw in the loop - pwm self validation #2028 2020-12-07 20:26:47 -05:00
rusefillc ee9aaf4e0d basic hw in the loop - pwm self validation #2028 2020-12-07 20:01:05 -05:00
rusefillc 93e69bea93 refactoring 2020-12-06 19:04:23 -05:00
Andrey G 4980fc49d9 Fixes after clenup (#2019)
* We still need consoleEventListener for boards with EFI_CONSOLE_SERIAL_DEVICE

* MC33810: add MC_ prefix for command defines

As CMD_PWM define is now used by console command
2020-12-05 11:54:09 -05:00
Andrey G f31731d380 ADC: correctly calculate cache invalidate range for STM32F7xxx (#2021)
Bug was introduced in 5d421f7ffa when
sample buffer was moved out of class. So sample become adcsample_t*
instead of adcsample_t[] and sizeof returns 4.
2020-12-05 10:14:33 -05:00
Andrey G 040e07ec48 adc: fix CPU temperature read for STM32F76x/77x (#2020) 2020-12-05 09:58:23 -05:00
Matthew Kennedy b34759f3c9 fix warnings (#2003)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-03 07:27:27 -05:00
Matthew Kennedy c442f1f785 fix gpio the right way (#1990)
* fix the right way

* use the api

* explain

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-11-27 00:24:41 -05:00
rusefillc 5390fccada Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:55:39 -05:00
rusefillc 7b8d20108f Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:41:22 -05:00
rusefillc fa3410ec07 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 00:24:15 -05:00
rusefi ab98e15f01 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 00:16:59 -05:00
rusefillc 3cbb33c763 avoid float -> int64 conversion #1977
cherry picking...
2020-11-24 20:33:51 -05:00
Matthew Kennedy ebb8ede1da squash warnings (#1984)
* warnings

* unused

* a few more

* too much

* uint16_t-ify
2020-11-23 09:43:16 -05:00
Matthew Kennedy eb7a26be14 Port-ify microsecond_timer hardware implementation (#1964)
* move to folder

* extract hardware part of microsecond_timer

* dead ST forum link

* de-volatile

* simulator build

* guard
2020-11-22 20:39:32 -05:00
rusefi 954d214919 adc fixed #1979
partial revert
2020-11-22 15:31:33 -05:00
rusefillc b1510791c5 ADC: fixes: #1979
better error handling?
2020-11-22 13:42:24 -05:00
rusefi ba97b22236 ADC: fixes: #1979
more detailed error message
2020-11-22 12:57:04 -05:00
Andrey G 005a5daa74 ADC: fixes: (#1979)
* ADC: fixes:

-use enums
-internalAdcIndexByHardwareIndex array should be adc_channel_e size
-add sanity checks
-save few bytes of RAM

* ADC: use logical OR instead of math add
2020-11-22 12:23:27 -05:00
Andrey G 83f5c8e6b6 Typo fix (#1978) 2020-11-22 08:27:03 -05:00
rusefillc 12187b4254 Starter is engaged on start-up in pull-up configuration #1969
maintainability
2020-11-20 00:18:38 -05:00
shadowm60 e69d103461 Launch control unit tests update (#1972)
* testable launch start

* extract base class

* add a test

* fix ts debug

* Launch control unit_tests

updated launch control for a better split
VSS mock for unit tests

Co-authored-by: Matthew Kennedy <matthewkennedy@outlook.com>
2020-11-19 21:14:38 -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
rusefillc dbdfd87c6d Starter seems to be engaged forever fix #1965 2020-11-18 23:54:30 -05:00
rusefillc 3a38c837cc Starter seems to be engaged forever #1965 2020-11-18 22:45:37 -05:00
rusefillc 9f94205b2b Starter seems to be engaged forever #1965 2020-11-18 21:45:17 -05:00
Matthew Kennedy 776dd75a8a consolidate to common (#1962) 2020-11-18 16:22:19 -05:00
Matthew Kennedy 786aaf2e3c put getTimeNowLowerNt in to mpu_util (#1950)
* put getTimeNowLowerNt in to mpu_util

* move GPTDEVICE to port_mpu_util

* and remove from efifeatures
2020-11-18 14:17:00 -05:00
rusefi 5a249e1b8f better MC33816 start-up status 2020-11-18 01:07:09 -05:00
Andrey G 39bc608ce5 TLE8888: disable diagnostic for OUTPUT8..13 (#1956)
Enabled pull-down affects analog inputs that shares same pins.
Disable it.
DOTO: enable diagnostic if ouput requested through tle8888_setPadMode
2020-11-17 18:33:37 -05:00
rusefillc ecbdfe379e docs 2020-11-17 08:25:50 -05:00
Matthew Kennedy 319384143e read SD card config exactly once (#1955)
* only read mmc device once

* format

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-11-17 07:48:43 -05:00
Matthew Kennedy e0d0727896 adjust microsecond_timer api (#1952)
* change timer api

* don't need all that
2020-11-16 18:50:13 -05:00
Matthew Kennedy d9f625c8ba prevent MMC preemption by TS thread (#1949)
* prevent preemption by TS thread

* didn't need that
2020-11-15 20:44:36 -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
Andrey G 2f891cc23a Tle8888 stepper (#1936)
* TLE8888: enable PP mode for OUT21..24 in case of useTLE8888_stepper

* Lada Kalina is a test mule for stepper idle
2020-11-10 14:16:46 -05:00
rusefi 9f237d963b debounce unintended auto-increment bug (was: Proteus TCU gear shift configuration) #1927
refactoring
2020-11-07 00:46:59 -05:00
rusefi 55065781f8 debounce unintended auto-increment bug (was: Proteus TCU gear shift configuration) #1927
undoing brain fart
2020-11-07 00:43:42 -05:00
rusefillc 89a20a20b0 Proteus TCU gear shift configuration #1927 2020-11-06 23:48:35 -05:00
Matthew Kennedy e8bb0cfd00 extract idle hardware to its own file (#1923)
* extract idle hardware

* should fix the build
2020-11-03 18:06:32 -05:00
rusefi 4dc5c61f60 Output pin init/deinit needs a linked list #1803
trying to make things more consistent & smarter
2020-11-03 00:46:03 -05:00
rusefi 8dcb2fe55f this stuff is just too dead 2020-11-02 23:46:41 -05:00
Andrey G e14fa4b189 Tle8888 small update (#1908)
* TLE8888: add support MR switching from SW

Main Relay has limitation - it is always active while KEY=1. When
KEY=0 MR can be switched on from SW.

* TLE8888: support reading of KEY and WAKE inputs

* Rusefi enums: add new TLE8888 pins
2020-11-01 22:19:55 -05:00
Matthew Kennedy 4c3046a707 remove spiMtx (#1907) 2020-10-25 17:26:46 -04:00
Matthew Kennedy 5fc47d0153 oops (#1899) 2020-10-23 15:45:44 -04:00
Andrey G 88e830d635 Tle8888 big update 1 (#1892)
* smart gpio: fix tle8888 direct pin mapping for MRE

* MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888

* TLE8888: cleanup

* TLE8888: do not reset driver private data on WD/undervoltage reset

* TLE8888: diagnostic updates

* TLE8888 driver: BIG driver rework

* TLE8888: check SPI answers for abnormal states

Reply with other than requested register can be a sign of:
-Power-On-Reset, then OpStat0 will be replyed
-WatchDog reset, then FWDStat1 will be replyed
-Invalid communication frame, then Diag0 will be replyed

Keep tracking last accessed register and check with the next reply.

* TLE8888: debug clean-up

* TLE8888: implement spi array write

This reduce CS inactive state time between two consequent accesses
from 8.8 uS to 1.4 uS

* TLE8888: fix PP outputs in OD mode

* TLE8888: cleanup register definitions

* TLE8888: run separate driver thread for each chip instance

Calculating poll interval for few chips become more complex, avoid
this running thread for each device.

* TLE8888: fix cypress and kinetic compilation

Both platforms define its own MAX and cause redifination error if
common.h is included in driver.

* MRE: update mapping.yaml and fix direct pin mapping for TLE8888

* TLE8888: diagnnostic: disable switch off in case of overcurrent

For all output, use current limiting instead

* TLE8888: check for overvoltage on OUT8..OUT13

* TLE8888: add TODO note about how to recover from failure condition

Currently TLE8888 automaticly recovers only from overcurrent and
(may be) overtemperature conditions.
Short to bat cause output disable (bit in OECONFIG is reset) and
needs driver/host intervention.

* TLE8888: save few bytes of RAM

* TLE8888: Lada Kalina is test mule for IDLE stepper on TLE8888

Don't forget to enable PP mode for TLE8888 outputs 21..24:
uncomment line 1087 in tle8888.c

* TLE8888: reorder code, cleanup

* TLE8888: mode all debug/statisctic to per-chip struct

* TLE8888: rework poll interval calculation

* MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888 #2
2020-10-23 12:25:30 -04:00
Matthew Kennedy dbdeca93b0 implement fuel pressure sensors (#1897)
* add

* remove old

* remove more old

* makefile

* fix init

* patch up other stuff

* actually fix it this time

* raw output channels

* gauges, UI

* scaled channel

* fix field ordering
2020-10-23 07:31:47 -04:00
Matthew Kennedy e4c891f328 no sd enable (#1894)
* no sd enable

* add assert

* Revert "no sd enable"

This reverts commit fd997381ee884c890fe7664e56ed2b0f0caef2ff.
2020-10-22 20:51:28 -04:00
Matthew Kennedy 8f6982dd54 disable i2c, other unused features (#1891)
* dead

* more
2020-10-20 22:24:32 -04:00
rusefi 69e48e1e44 code style 2020-10-19 22:47:09 -04:00
rusefi ca89cf9b95 GDI Epic #1448 2020-10-19 22:04:06 -04:00
Matthew Kennedy c73978310f Remove trigger listener list (#1886)
* avoid 64b on hot path

* no tooth log when fast

* use crit section locker

* final

* only flip pins if not also self stim

* only trace if doing work

* slightly drop lateDelay

* trace if not bailing out

* remove listener array
2020-10-17 08:00:11 -04:00
Matthew Kennedy f6f3e514d2 trigger/scheduler perf improvements (#1885)
* avoid 64b on hot path

* no tooth log when fast

* use crit section locker

* final

* only flip pins if not also self stim

* only trace if doing work

* slightly drop lateDelay

* trace if not bailing out
2020-10-16 11:04:27 -04:00
Matthew Kennedy eac2b179c7 fix temp sensor & validate it (#1879)
* fix temp sensor & validate

* smaller here should work
2020-10-14 22:39:16 -04:00
Matthew Kennedy 4868068e2f start using BufferedWriter (#1878)
* do the part up to actual usage

* borrow some memory for now
2020-10-14 20:06:05 -04:00
rusefi 9de3031378 GDI Epic #1448 2020-10-11 23:39:40 -04:00
Matthew Kennedy 540fca8cc9 use expected for event queue next event (#1859)
* use expected for event queue next event

* minor cleanup

* tests
2020-10-05 13:53:34 -04:00
Matthew Kennedy c1cb48ed12 switch (#1839)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-10-01 01:36:33 -04:00
Matthew Kennedy 3374db1658 Remove dead & useless config (#1834)
* remove dead config

* remove enum
2020-09-29 06:34:39 -04:00
David Holdeman e6f6c43767 switch to pass by reference (#1832) 2020-09-28 19:17:17 -04:00
andreika-git 2d4d34291c Hellen says fix cypress build (#1818)
* fix compilation

* fresh generated files

* more files

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2020-09-23 14:06:22 -04:00
David Holdeman 88d08cf1a8 Fix debounce (#1814)
* 1,2,4,7,9

* 6

* fix type mismatch

* change field

* comment

* Revert "comment"

This reverts commit f7ce8ed48d015490ed82d692270198817569b5a3.

* Revert "Revert "comment""

This reverts commit 99f2d5cadcbf444bf58acf9e57a6fed61355d5be.

* Revert "change field"

This reverts commit 55ec050cd947696cdffccae6b29fe48d95ab5f17.

* rename var

* comments

* use func in init

* default values

* remove redundant check

* check

* use bool

* mark false when done

* pointer

* check GPIO_UNASSIGNED

* wat

* merge carnage

* oops, accidentally downgraded submodule
2020-09-21 18:25:24 -04:00
rusefi 4fccd51722 ADC progress 2020-09-21 06:10:25 -04:00
Matthew Kennedy 2c492cae48 guard against ADC buffer overrun (#1812) 2020-09-21 12:37:51 +03:00
rusefi 889335111a reorder ADC channel index #1763
we forgot about something
2020-09-20 14:20:08 -04:00
David Holdeman 9536590a25 Debounce refactor (#1809)
* 1,2,4,7,9

* 6

* fix type mismatch

* change field

* comment

* Revert "comment"

This reverts commit f7ce8ed48d015490ed82d692270198817569b5a3.

* Revert "Revert "comment""

This reverts commit 99f2d5cadcbf444bf58acf9e57a6fed61355d5be.

* Revert "change field"

This reverts commit 55ec050cd947696cdffccae6b29fe48d95ab5f17.

* rename var

* comments

* use func in init

* default values

* remove redundant check
2020-09-20 14:01:00 -04:00
David Holdeman 02a12d76f3 fix type mismatch (#1808)
* fix type mismatch

* comment

* change field

* switch to efitimesec16_t

* add typedef

* add type to configdefinition

* build
2020-09-19 17:17:44 -04:00
Matthew Kennedy d23a48fc53 Dedicated sensors for wastegate + idle position (#1805)
* config

* add sensor

* listen to new adc channels

* fix

* add gauges to TS

* add gauge values

* TS UI
2020-09-18 10:04:07 +03:00
rusefi c98e78640a Hellen says merge #1772 hardware.cpp 2020-09-15 15:01:31 -04:00
rusefi 0e370f87aa Merge remote-tracking branch 'origin/master' into master 2020-09-15 14:49:01 -04:00
andreika-git af20e08ccf porting adc_inputs.cpp (blindly) (#1792)
Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2020-09-15 14:48:32 -04:00
Matthew Kennedy a62089e590 proteus SD card defaults (#1796)
* proteus SD defaults

* disable serial console pins
2020-09-14 10:54:25 +03:00
Matthew Kennedy 36234961c1 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 ead14bd1ca Revert "logging simplification: switch bare functions to member functions (#1788)"
This reverts commit 39280fb2
2020-09-12 04:36:24 -04:00
rusefi 8612f4de30 Merge remote-tracking branch 'origin/master' into master 2020-09-12 04:03:23 -04:00
rusefi 875651b471 Hellen says merge #1772 adc.h 2020-09-12 04:03:11 -04:00
Matthew Kennedy 39280fb2c6 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
David Holdeman e8e2cf2cfd DebounceButton A/C switch (#1782)
* change acSwitch name, add mode

* fix

* remove some adc stuff

* remove some adc stuff

* semicolon stupid

* left behind

* add readpinstate

* wrong var name

* add functions back

* fix name

* bool, not void, plus fix name

* move

* not sure what I broke

* try setMockValue

* namespace

* whoops missed one

* switch values because adc was set up for pullup

* try 5

* comment for now

* comment for now

* uncomment tests, add function to mock, add mock to efiReadPin

* fixes

* for F's sake

* if

* add defy

* pass params

* use ASSERT_TRUE/FALSE

* advance time

* remove ifdef from readPin

* try moving if

* move to separate func

* move extern

* move include

* try engine_test_helper

* am confuse

* move func to else

* include hal

* add efi prod check

* remove include

* try extern

* move include

* semicolon stupid

* move extern again

* include

* move mockPinStates

* size

* add if

* add comment

* clean on instantiation
2020-09-10 22:16:20 -04:00
rusefi a5644782d6 Merge remote-tracking branch 'origin/master' into master 2020-09-09 17:25:09 -04:00
rusefi 7fa7ac6c37 Merge remote-tracking branch 'origin/Hellen_fork_point' into master
# Conflicts:
#	firmware/Makefile
#	firmware/hw_layer/smart_gpio.cpp
2020-09-09 17:19:41 -04:00
David Holdeman e7af7cd391 Debounce pin state function (#1780)
* add readpinstate

* wrong var name
2020-09-09 17:18:54 -04:00
rusefi 91f9079f82 Hellen says merge #1772 smart gpio 2020-09-09 17:16:51 -04:00
rusefi 86bac639b0 Merge remote-tracking branch 'origin/Hellen_fork_point' into master
# Conflicts:
#	firmware/hw_layer/digital_input/trigger/trigger_input.h
#	firmware/hw_layer/hw_layer.mk
#	firmware/hw_layer/ports/stm32/stm32f0/hw_ports.mk
#	firmware/hw_layer/ports/stm32/stm32f1/hw_ports.mk
#	firmware/hw_layer/ports/stm32/stm32f4/hw_ports.mk
#	firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk
2020-09-09 16:55:27 -04:00
rusefi 882c8d8dbf Hellen says merge #1772 helping merge - Kinetis?! 2020-09-09 16:38:18 -04:00
rusefi a3c9871d58 Hellen says merge #1772 helping merge 2020-09-09 14:35:01 -04:00
rusefi 918d987366 Hellen says merge #1772 helping merge 2020-09-09 14:20:54 -04:00
rusefi 03ce326123 Hellen says merge #1772 helping merge 2020-09-09 13:43:18 -04:00
rusefi d3d5c1474a Hellen says merge #1772 more about ports 2020-09-09 13:39:51 -04:00
rusefi d3567c23f6 Hellen says merge #1772 trigger h 2020-09-09 10:21:14 -04:00
rusefi 6b3eadb082 Hellen says merge #1772 backup ram.h 2020-09-09 10:20:21 -04:00
rusefi c930071203 Hellen says merge #1772 more about ports 2020-09-09 10:18:58 -04:00
rusefi 7f3eb65f4d Merge remote-tracking branch 'origin/master' into master 2020-09-09 08:58:54 -04:00
rusefi 81e83d0474 Hellen says merge #1772 more ports 2020-09-09 08:58:12 -04:00
rusefi 9ca4906c4c Hellen says merge #1772 more ports 2020-09-09 08:53:11 -04:00
rusefi bd5ee9477c Hellen says merge #1772 tle header 2020-09-09 08:52:14 -04:00
David Holdeman ffb5e0b1e4 switch start/stop to ButtonDebounce (#1777) 2020-09-09 08:22:15 +01:00
Andrey G 5d421f7ffa Adc improvements (#1765)
* ADC: move DMA buffer outside of AdcDevice (save few bytes)

* ADC: inlcude fast channels to debug output

* ADC: save some CPU ticks (disabled until fully tested)

* ADC: simplify
2020-09-08 17:20:55 -04:00
David Holdeman 001e56e3a1 use EFI_UNIT_TEST, add check (#1774) 2020-09-08 14:27:23 -04:00
David Holdeman 65b60df172 Debounce pin management (#1760)
* add linked list

* macros, and use in buttonshift

* unit_tests macros

* add extern

* add parens

* move extern

* move extern

* move buttonDebounceListHead

* move buttonDebouncePointerHead

* merge gore

* undo

* reduce unused size

* don't store pointer if already initialized

* few changes

* remove oldPin

* fix merge conflict

* merge in changes commited to wrong branch

* fix definition

* out of class?

* brute force programming

* fix few problemos

* am confuse

* am confuse

* am confuse

* am confuse

* oldPin snuck in

* move to public?

* define again

* try constexpr

* def in cpp

* remove constexpr

* fix def

* fix?

* update active

* fix a few things
2020-09-08 11:29:38 -04:00
rusefi f70c4b7a54 Merge remote-tracking branch 'origin/Hellen_fork_point' into master
# Conflicts:
#	firmware/controllers/algo/engine_configuration.cpp
2020-09-07 15:55:43 -04:00
rusefi 7e4e20cc85 Hellen says merge #1772 ADC flexibility 2020-09-07 15:50:37 -04:00
rusefi 16f53aecd1 Hellen says BOARD_DRV8860_COUNT 2020-09-07 15:38:34 -04:00
rusefi 5243811711 Merge remote-tracking branch 'origin/Hellen_fork_point' into master
# Conflicts:
#	firmware/controllers/algo/engine.h
#	firmware/hw_layer/drivers/drivers.mk
#	firmware/hw_layer/stepper.h
#	firmware/integration/rusefi_config.txt
#	firmware/tunerstudio/rusefi.input
#	simulator/simulator/efifeatures.h
2020-09-07 15:02:11 -04:00
rusefi f6d735cdd2 Hellen says merge #1772
Hellen says stepper

(cherry picked from commit 4bc18ee475)
2020-09-07 14:45:41 -04:00
rusefi d80f0dcd1d Hellen says misc
(cherry picked from commit bae9324d34)
2020-09-07 14:43:12 -04:00
rusefi 4bc18ee475 Hellen says merge #1772
Hellen says stepper
2020-09-07 14:41:04 -04:00
rusefi bae9324d34 Hellen says misc 2020-09-07 14:09:00 -04:00
rusefi e795da5498 Hellen says drivers
(cherry picked from commit d4d36f9153)
2020-09-07 12:02:40 -04:00
rusefi 080559f703 Hellen says ports
(cherry picked from commit ae08b287f0)
2020-09-07 12:02:34 -04:00
rusefi d4d36f9153 Hellen says drivers 2020-09-07 12:00:16 -04:00
rusefi ae08b287f0 Hellen says ports 2020-09-07 11:57:20 -04:00
rusefi 8ba9a47c59 microRusEFI used as Body Control Module BCM BCU
got stack too low warning with DBG_CAN
2020-09-06 21:45:17 -04:00
rusefi 70ddde6418 microRusEFI used as Body Control Module BCM BCU 2020-09-06 21:30:14 -04:00
rusefi bc2aa6601e microRusEFI used as Body Control Module BCM BCU 2020-09-06 20:21:01 -04:00
Matthew Kennedy 4802a47d23 reorder ADC channel index (#1763)
* change config

* correct logic

* clearing these no longer needed

* test expected this to be set
2020-09-06 18:25:26 -04:00
Matthew Kennedy fc02c2bdf4 fix broken master, inject engine ptr to rpmcalculator (#1759)
* fix

* oops
2020-09-05 18:49:42 -04:00
rusefi c476cd3b95 refactoring 2020-09-03 19:29:15 -04:00
David Holdeman 0f10703649 [TCU] GearController and TransmissionController base classes (#1749)
* add tcu ts outputs

* accidental change?

* add tcu base classes

* rearrange

* accidental change?

* add files

* missing backslash

* undo accidental change

* buttonshift includes, targets, and init

* Revert "buttonshift includes, targets, and init"

This reverts commit 1b0630511e1948f3d330d74be5bff6c087f118fb.

* use unused bit

* add return documentation

Co-authored-by: rusefillc <48498823+rusefillc@users.noreply.github.com>
2020-09-02 15:39:50 -04:00
dron0gus af0c427a8b Adc cleanups (#1743)
* ADC: remove ADC_TwoSamplingDelay*

1. it is related to double or triple interlived mode only
2. it should be writen to CCR register, not CR1

* ADC: use designated initializers
2020-09-01 07:38:35 -04:00
Matthew Kennedy 0f95d8fd71 fix #1740 the right way (#1741)
* fix

* put that back
2020-08-31 21:05:04 -04:00
rusefi e052c2b1e4 dead code 2020-08-31 20:52:25 -04:00
Matthew Kennedy 6293945b0f generated for pt2001 (#1666)
* generated for pt2001

* don't unicode
2020-08-30 15:38:56 -04:00
NOx-z 992a517907 Mc33 ucode (#1734)
* mc33 flash check

* DI sanity checks for setting HV config

* mc33816 microcodee source code update for what we got running on the r0.4 board w/ pt2001

Co-authored-by: Christopher W. Anderson <gitstuff@pswitch.com>
2020-08-29 22:24:11 -04:00
rusefi 72060dd68f VVT support for VAG trigger #883 2020-08-29 18:13:00 -04:00
rusefi e6a5a49805 OBD CAN sensors #1733 2020-08-29 14:36:23 -04:00
Matthew Kennedy 1b07647e72 Software knock detection (#1730)
* s

* science

* set pin mode

* turn stuff off so it fits

* filtering maybe

* filtering actually works

* generate filter parameters internally

* shorter window

* guard behind enable flag

* use checked in filter

* add biquad reset

* tracing

* const

* exec order

* do it from a thread

* smaller buffer, comment

* configure with header

* only for proteus

* oops

* unused

* not needed

* guards

* pin config

* don't need that include

* precook filter steady state

* define sample rate

* config enable switch
2020-08-28 21:13:50 -04:00
rusefi bdbee0d38b VVT support for VAG trigger #883 2020-08-24 02:01:50 -04:00
rusefi 7299c79810 more fixing build? 2020-08-21 22:07:55 -04:00
Matthew Kennedy 8ab4c5c765 Analog input filtering (#1680)
* improve biquad

* cleanup

* add filtering to subscriptions

* config sensors

* comment

* doesn't need to be that fast

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-08-21 19:47:12 -04:00
rusefi 4cd5f146f4 bugfix - PPS second channel was not initialized 2020-08-19 00:46:57 -04:00
Andrei 178c55e62b vss_exti untested 2020-08-13 18:27:31 +03:00
rusefi a7edab2db6 disable trigger_hw_input should work for PAL and VVT 2020-08-09 00:20:01 -04:00
rusefi 528d03a90b trigger and VSS hw integrated testing #1668 2020-08-08 18:28:43 -04:00
rusefi 2051551617 TS SD integration #1653 2020-08-07 17:20:16 -04:00
rusefi 6eecba28b1 TS SD integration #1653 2020-08-07 16:37:36 -04:00
rusefi 6e114a9a23 TS SD integration #1653 2020-08-07 16:27:21 -04:00
rusefi 09ffc1a8e6 TS SD integration #1653 2020-08-07 15:53:11 -04:00
rusefi 7ce6eb2e1b TS SD integration #1653 2020-08-07 15:01:25 -04:00