Commit Graph

1504 Commits

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