Commit Graph

65 Commits (spacecruft)

Author SHA1 Message Date
Willem Melching 9a82ba3892
Disable interrupts in early() (#641)
* Disable interrupts in early()

* enable interrupts before going into DFU mode
2021-04-22 11:24:03 +02:00
Adeeb Shihadeh 8b41ed3b81
Deprecate ESP (#592)
* remove unused wifi tests

* remove that one too

* no bootmode from ESP

* clean that up

* remove two more wifi tests

* remove boardesp and esptool

* esp_gps -> gps

* missed those

* remove esptool refs

* remove esp certs

* no more wifi

* that was old

* cleanup jenkins dockerfile

* fix linter

* remove more wifi refs

* clone panda jungle from github

* no copy

* always default esp to off
2020-08-26 15:37:50 -07:00
Riccardo df4159c846 Revert "Revert "Register readback on most modules. Still need to convert the other ones (#396)""
This reverts commit 56ec215024.
2019-12-05 14:19:29 -08:00
Riccardo 56ec215024 Revert "Register readback on most modules. Still need to convert the other ones (#396)"
This reverts commit 893e486194.
2019-12-05 13:55:20 -08:00
robbederks 893e486194
Register readback on most modules. Still need to convert the other ones (#396)
* Added an initial working implementation of the register readback and applied it to the LLCAN registers. Also fixed an init bug in CAN.

* Locally disable pylint import error

* Reverted change to CAN-obj->FA1R setting

* Fixed misra compliance

* Changed hash function name

* Fixed CAN filter setting

* Added voltage health test

* Converted ADC to register functions

* Converted clock to use register setters

* Added check to see if fault status is zero after running test

* Converted DAC to use register setters

* Converted fan to use register setters

* Converted gmlan bitbanging to use register setters

* Changed over interrupt driver to use register setters. Also moved some includes and definition places for critical sections

* Fixed build

* Converted LLGPIO to use register setters

* Converted pwm to use register setters

* Fixed cold boot

* Fixed health fault check in automated tests

* Added comment for the future (issue #367)

* Converted RTC driver to use register setters

* Converted SPI to use register setters

* Converted timer driver to use register setters

* Fixed register fault on white pandas and disabled showing of fault for release

* Bump version
2019-12-04 20:42:57 -08:00
rbiasini d229f8dcd3
ESP forced off in EON build. this prevents ESP to be turned on when e… (#387)
* ESP forced off in EON build. this prevents ESP to be turned on when exiting power mode: 0.5W power save! Also, boardd does not need to set ESP to off anymore

* don't touch ESP uart

* Refactored ESP/GPS initting

* Fixed white detection
2019-11-19 18:41:59 -08:00
robbederks d68508c79a Gpio race condition fix (#263)
* Fixed pedal not initializing

* Interrupt changes

* More changes
2019-08-28 12:53:51 -07:00
rbiasini 59f5813173
Black (#254)
* late usb

* Added type support for black panda

* Added harness presence and orientation detection

* harness relay driving code

* Added intercept support in black panda code. Switched around can0 and can2

* Disable ADCs after orientation detection. Ignition interrupts via harness

* WIP: Hardware abstraction layer + black panda bringup

* Fixed bootstub build

* Fixed bootstub for pedal

* Fixed infinite loops

* Got CAN buses working on white again

* Fixed pedal build and black can interfaces

* Got CAN buses working on black panda

* Finished loopback test for black panda

* Erase all flash sectors on the panda. Increased binary limit. Added extra python functions.

* Fixed python

* Made new code MISRA compliant

* Cleaned up ignition. Fixed build

* Fixed health packet

* Fixed CAN mode on black bug. Changed OBD to switch on ELM mode

* Fixes from Github review

* Fixed MISRA issue for pedal

* Fixed failing gmlan tests

* ELM327 safety: allow diagnostic on all buses

* Cleaned up EON relay code

* delete only 3 sectors instead of 11 to allow a new build to be flashed. Much faster to flash

* Removed CAN only can0 output mode. Does not make sense on black panda due to reversibility issues.

* Added heartbeat logic for EON code on panda. Go to NOOUTPUT if EON does not send a heartbeat for 5 seconds.

* Remove all CAN buses live on EON startup. Shouldn't be necessary to have this separate case

* Formatting

* Added file I forgot to push

* Added heartbeat to testing code to make sure EON tests don't fail. Should probably find a better way to do this though. Heartbeat thread didn't work, concurrent USB connection issues...

* Safety: support black panda for Honda Bosch

* Disable OBD2 if setting to NOOUTPUT mode

* Run safety tests for all hw_types

* Fail test if subtest fails

* fix safety tests
2019-07-23 15:07:06 -07:00
Riccardo d9d0a62f2b Misra 5.5: missed this change from previous PR 2019-07-07 22:22:05 -07:00
rbiasini 3c3aba3dbc
Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240)
* Almost done with 10.4, a couple of non-obvious violations remaining
2019-07-04 01:04:58 -07:00
rbiasini 812ace5386
Misra 15_7: if … else if constructs should be terminated with an else clause (#230)
* Fixed all Misra 15_7 violations
2019-07-03 20:48:02 -07:00
rbiasini abd841e9be
Fix all 16_4 violations (#229) 2019-06-27 15:50:00 -07:00
Riccardo ec3d0386c2 refactor set_power_save_state 2019-06-26 18:24:21 -07:00
Riccardo c27e7848f3 fix conflicts 2019-06-26 16:17:30 -07:00
rbiasini 4886b6b984
Misra 12.1: The precedence of operators within expressions should be made explicit (#227)
* Fixed all misra 12.1 violations
2019-06-26 16:16:35 -07:00
Riccardo 52838e1c2a WIP 2019-06-26 14:47:06 -07:00
rbiasini 73ae4f6acf
Misra 14.4: The controlling expression of an if statement and the controlling expression of an iteration‑statement shall have essentially Boolean type (#225)
* Fixed 14.4 Misra violations
2019-06-26 13:13:16 -07:00
rbiasini e2d781380a
Strict compiler (#222)
have no Wall warnings from the strict compiler and enforcing it in the regression test.
2019-06-24 10:25:30 -07:00
George Hotz 1906a4b769 panda now draws below 100mw in power save mode 2019-05-23 12:39:54 -07:00
George Hotz a74f001ba7 refactor power savings to depend on car started bit 2019-05-23 12:39:54 -07:00
George Hotz 0a9f8eb581 remove many ifdef PANDA 2019-05-23 12:39:54 -07:00
George Hotz 3810452a02 WTF WHY WAS THIS SHIT PUT EVERYWHERE 2019-05-23 12:39:54 -07:00
George Hotz 6255097a10 new style power savings 2019-05-23 12:39:22 -07:00
George Hotz 8221927215 this is probably broken. refactor out llcan and clock 2019-05-23 12:39:22 -07:00
George Hotz 047bd725e0 fix tests and remove rev b support 2019-05-19 09:12:26 -07:00
Nigel Armstrong f8ab74a1cc L-line relay (#166)
* Initial version of L-Line Relay

* lline relay fix build, add to health

* Add lline relay to safety

* Lline relay fix build

* Fix tests

* Add lline safety init. Dont fwd with relay closed

* Turn on relay with CAN

* relay hook

* More reliable lline relay

* Longer LLine timeout

* Only turn on wifi if not eon

* Dont disable ESP in early

* Allow CAN to be turned off

 - CAN is turned off via USB.
 - CAN is turned on when either try to transmit or can is received
 - If only transmit is asleep, all messages should send okay
 - If receive is alseep, will miss first message while waking up
 - Sometimes will report error on second message while CAN perif wakes up
 - Saves 130mW!

* Power Saver Mode

 - Gray Panda power consumption 650mw -> 325mW
 - Turns off CAN, GMLAN, LIN, GPS when no activity for 10s
 - No acitvity is no CAN send, CAN Recv, Write to GPS

* Fix power_saving to better turn off can

 - On some cars when the can is turned off, it triggers a wakeup.
 Delaying the automatic wakeup seems to fix this

* Don't save power in pedal

* Fix relay clicking on startup

* Fix duplicate include

* consistent relay setting

* relay_status can be added when needed, as it's started_alt was consumed in other places

* need to skip forwarding only if relay control is claimed

* unneded change

* make lline_relay.h not depending on can.h

* less spaghetti I guess

* less lines

* reset pedal changes

* no unused input

* update version
2019-04-11 21:03:15 -07:00
Nigel Armstrong 4276c380e6
Additional Power saving (#170)
* Only turn on wifi if not eon

* Dont disable ESP in early

* Allow CAN to be turned off

 - CAN is turned off via timeout
 - CAN is turned on when either try to transmit or can is received
 - If only transmit is asleep, all messages should send okay
 - If receive is alseep, will miss first message while waking up
 - Sometimes will report error on second message while CAN perif wakes up
 - Saves 130mW!

* Power Saver Mode

 - Gray Panda power consumption 650mw -> 325mW
 - Turns off CAN, GMLAN, LIN, GPS when no activity for 10s
 - No acitvity is no CAN send, CAN Recv, Write to GPS

* Fix power_saving to better turn off can

 - On some cars when the can is turned off, it triggers a wakeup.
 Delaying the automatic wakeup seems to fix this

* Don't save power in pedal

* Cleanup power saving
2019-04-01 22:45:00 -07:00
Nigel Armstrong 20c76ad592 Power Saving (#169)
* Only turn on wifi if not eon

* Make sure esp is disabled on eon

* Dont disable ESP in early
2019-03-13 20:58:00 -07:00
George Hotz e21447765e use timer for can bitbanging 2018-06-11 10:06:10 -07:00
Firmware Batman 8a6f44bb07 pedal is sending messages 2018-03-01 10:55:02 -08:00
George Hotz eb1fd75cb9 add PEDAL adc sets 2018-02-27 21:42:24 -08:00
George Hotz 8d4d763146 debug console works 2018-02-27 20:14:27 -08:00
George Hotz bd09883eee comma pedal is building 2018-02-27 20:06:47 -08:00
George Hotz f415c9a303 grey panda detection 2018-01-23 20:04:41 -08:00
George Hotz e1dd404c9b add microsecond timer support 2017-10-26 18:44:25 -07:00
Firmware Batman 91e19756be bugfix for legacy board 2017-08-22 14:44:01 -07:00
Firmware Batman e30a712c21 first pass at charging state machine 2017-08-22 08:27:00 -07:00
Firmware Batman 748c2e45c4 style 2017-08-21 19:34:11 -07:00
Firmware Batman 1066c2d1b0 fixed SPI, so much subtlety 2017-07-29 19:19:43 -07:00
Firmware Batman 0ee6e4741c move llgpio to drivers 2017-07-29 17:53:39 -07:00
Firmware Batman 5630e71813 fixes during vegas trip 2017-07-27 14:33:49 -07:00
Firmware Batman 9a1c1b692f write soft flasher 2017-07-24 15:16:22 -07:00
Firmware Batman a2523f2d3a clean up flasher 2017-07-24 10:39:08 -07:00
Firmware Batman 66c0ba5ea4 fix bootstub 2017-07-22 14:28:11 -07:00
Firmware Batman 5fd041e011 tests pass, not building recover 2017-07-22 14:18:00 -07:00
Firmware Batman d9fc3b372c refactoring 2017-07-21 11:48:03 -07:00
Firmware Batman 2dd6c3f90c big refactor to drivers 2017-07-20 23:45:48 -07:00
Firmware Batman 65809f25f4 refactoring 2017-07-20 23:36:06 -07:00
Firmware Batman 64495a0018 all tests passing, clean up usb power 2017-07-18 23:07:19 -07:00
Firmware Batman 639ea617b8 cleanly put GMLAN on bus 3, love tests 2017-07-18 21:05:09 -07:00