Commit Graph

242 Commits (spacecruft)

Author SHA1 Message Date
George Hotz e70b44aa57 move that to main.c 2019-05-23 12:39:54 -07:00
George Hotz dfce5f6e36 minor fixes, and no more autobaud 2019-05-23 12:39:54 -07:00
George Hotz 96a7e3196f a soothing blue 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 506900576b remove nested includes and include guards 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 58ec63b31f oops, backward 2019-05-23 12:39:22 -07:00
George Hotz 6255097a10 new style power savings 2019-05-23 12:39:22 -07:00
George Hotz 1d2467756e refactor #ifdef EON 2019-05-23 12:39:22 -07:00
George Hotz 4af036e93a fixup puts 2019-05-23 12:39:22 -07:00
George Hotz 2c1e5f6325 the refactor continues 2019-05-23 12:39:22 -07:00
George Hotz 7517f2c174 remove ifdef PANDA from main 2019-05-23 12:39:22 -07:00
George Hotz aec40ae91c remove fan, as it was only for NEO board 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
rbiasini 1aa00c95ee
Misra c2012 (#192)
* Started making panda misra compliant: this fixes some of 12.1 warnings

* Also added a regression test for strict compiler warning
2019-05-20 22:13:45 -07:00
George Hotz 047bd725e0 fix tests and remove rev b support 2019-05-19 09:12:26 -07:00
Riccardo Biasini 3b351b7018 Minor fix to current type 2019-04-23 13:53:43 -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
rbiasini a6193a8285
Dcp remove (#168)
* No DCP charge mode when building from EON
2019-03-11 23:41:40 -07:00
rbiasini 1218d09edb
Cadillac ascm proxy (#155)
* added safety_ascm

* better using one funciton

* GM_ASCM safety mode by default

* fixced ign bug and passing everything for now

* blocking 0x152-0x154 and reforwarding 0x153

* gotta fwd 152 as well on CH bus

* adding braking message block

* blocking gas cmd as well

* allow cadillac supercruise to pass through

* no more hardcoded ascm safety mode
2019-02-05 18:37:02 -08:00
George Hotz 49ed9bc1ec Update CLICKS for longer bootup time of EONS and avoid unwanted fast charge mode
updated panda version
2018-12-16 18:23:39 -07:00
Adam Urban f9a46e3646 Match safety order from master
This will cause a merge conflict with the tesla branch.
2018-08-02 14:13:57 -04:00
Adam Urban aafbe05815 GMLAN GPIO Rebase 2018-08-02 12:39:53 -04:00
George Hotz 2253dd3c48 fix volt ign detect 2018-04-13 20:11:01 +00:00
George Hotz af9af6d13e
Merge pull request #110 from Jamezz/volt
Add safety hook for ignition state for car platforms that don't support GPIO pin
2018-04-12 12:00:26 -07:00
George Hotz 938d474723 fpu enable 2018-04-11 19:52:42 -07:00
Greg Hogan 95919b932d Bounty: panda high quality CAN autobaud (#96)
* CAN auto-baud

* Disable autobaud when exiting silent mode
2018-04-11 14:31:48 -07:00
Jamezz a0cc51af15 Undo safety mode override
We don't need to force safety to GM for testing, fingerprinting should work.
2018-04-11 12:54:16 -07:00
Thomas Helms 4fc83a5f5c Add safety hook for ignition and have GM use gear selector to determine ignition 2018-04-10 17:55:55 -07:00
George Hotz b42db6dc08
Merge pull request #82 from commaai/uart_dma
Uart dma
2018-01-29 13:31:49 -08:00
George Hotz fd053760d9 comment out debug 2018-01-28 03:58:57 -08:00
George Hotz 743d244513 high baud rate works 2018-01-28 02:10:52 -08:00
George Hotz 4410a59d92 add safety param support 2018-01-25 23:57:04 -08:00
George Hotz fc81fc1118 uart dma in progress 2018-01-25 23:51:52 -08:00
George Hotz 65fb2b26cb grey panda query, 1.0.5 2018-01-23 20:10:23 -08:00
George Hotz f415c9a303 grey panda detection 2018-01-23 20:04:41 -08:00
George Hotz 3fc38f4831 set bootmode with power 2018-01-20 11:23:55 -08:00
George Hotz e1dd404c9b add microsecond timer support 2017-10-26 18:44:25 -07:00
Firmware Batman e7fbea7e54 support setting DCP mode 2017-10-15 17:10:04 -07:00
George Hotz 92a1c773e7 blink 4x faster when in DCP mode 2017-09-28 21:57:54 -07:00
Jessy Diamond Exum 1bc069d9be board: standardized how health voltage is reported between revisions. 2017-09-16 18:28:20 -07:00
George Hotz b290a06cc7 fix regression in can_silent 2017-09-04 23:51:42 -07:00
George Hotz 1e48d086f5 switch panda to use not gmlan for started detection 2017-08-28 13:15:47 -07:00
George Hotz 5db091d7d2 clean up LEDs 2017-08-23 12:36:03 -07:00
George Hotz 0b7f10abe5 add release flasher 2017-08-23 10:43:40 -07:00
George Hotz bb4ec716b1 0xe6 command is only for rev c 2017-08-23 10:01:02 -07:00
Vehicle Researcher 63d34bc120 add support for setting usb power 2017-08-23 09:28:52 -07:00
Firmware Batman ea4e92944c blue led is used for can receiving now 2017-08-22 13:36:20 -07:00
Firmware Batman 0400267cd9 teach panda to breathe 2017-08-22 09:44:08 -07:00
Firmware Batman e30a712c21 first pass at charging state machine 2017-08-22 08:27:00 -07:00
Firmware Batman ddbcd570bc fixup can silent on elm327 mode 2017-08-21 14:28:33 -07:00
Jessy Diamond Exum 5ca692e8d3 ELM327: incoming messages cleared before commands to prevent congestion. 2017-08-19 00:31:11 -07:00
Jessy Diamond Exum 09ee296550 ELM327: Panda safety mode for ELM327 (passes ISO 15765-4 11&29 bit messages) 2017-08-19 00:31:11 -07:00
Firmware Batman 798f942346 fix legacy build issue, add build test, fix warnings 2017-08-01 03:00:53 +02:00
Firmware Batman 991ad5be20 add wifi tests 2017-07-30 08:26:48 -07:00
Firmware Batman 9e2d49e225 and fixed a UART noise bug 2017-07-29 19:53:09 -07:00
Firmware Batman 6b9ba40089 remove some dumb prints 2017-07-29 18:16:08 -07:00
Firmware Batman 0ee6e4741c move llgpio to drivers 2017-07-29 17:53:39 -07:00
Firmware Batman d5e3805671 add uart to spi flasher 2017-07-27 15:54:55 -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 0a5a8ab5ec refactor SPI and make flasher reliable 2017-07-24 12:31:47 -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 9783a2ab13 refactor drivers into drivers.h 2017-07-21 11:30:07 -07:00
Firmware Batman 07dac7e75d move out the uart ring process 2017-07-20 23:54:45 -07:00
Firmware Batman 2dd6c3f90c big refactor to drivers 2017-07-20 23:45:48 -07:00
Firmware Batman 9b0b54f4a1 refactor continues 2017-07-20 23:42:19 -07:00
Firmware Batman 65809f25f4 refactoring 2017-07-20 23:36:06 -07:00
Firmware Batman 22da59f663 minor cleanups 2017-07-20 23:19:53 -07:00
Firmware Batman 58e2fc2382 fix legacy tests 2017-07-20 23:16:11 -07:00
Firmware Batman ad2c0e632a start the refactor 2017-07-20 23:14:27 -07:00
Firmware Batman 3e01310f1b support switching usb modes 2017-07-20 13:41:21 -07:00
Firmware Batman 64495a0018 all tests passing, clean up usb power 2017-07-18 23:07:19 -07:00
Firmware Batman 4d879f7e47 tests work on legacy board 2017-07-18 21:14:38 -07:00
Firmware Batman 639ea617b8 cleanly put GMLAN on bus 3, love tests 2017-07-18 21:05:09 -07:00
Firmware Batman 9ed2524be3 add debug mode, more locks, fix test 2017-07-18 12:29:16 -07:00
Firmware Batman 595c07aaf5 aha, fixed clearing request done bit. tests passed 2017-07-18 10:25:00 -07:00
Firmware Batman 6a56dd1ad2 clean up interrupts more 2017-07-18 10:19:42 -07:00
Firmware Batman b737d987cb clean up can interrupts, still failing 2017-07-17 22:44:02 -07:00
Firmware Batman 85c0940cf9 support can speed, and test it 2017-07-17 19:43:30 -07:00
Firmware Batman e391a7b5dd remove broken accord support 2017-07-17 11:11:45 -07:00
Firmware Batman 8c83533ba6 better docs, improve safety code 2017-07-17 10:48:16 -07:00
Firmware Batman 2aee9315ca separate out controls allowed and safety mode 2017-07-17 10:24:35 -07:00
Jessy Diamond Exum a0358414e5 Re-differentiating CAN silence from controls_allowed. Updated incorrect comments. 2017-07-17 00:52:01 -07:00
Jessy Diamond Exum 528b8ae067 Modularize safety modes to encourage 3rd party safety code contribution. 2017-07-17 00:41:26 -07:00
Jessy Diamond Exum 0b6971f091 Declaration of function changed in 'sane can ids'.
can loopback called the function with the old parameters.
2017-07-16 16:03:16 -07:00
George Hotz 7b664b298d Merge pull request #24 from commaai/redux/runtime_can_loopback
Can loopback now runtime configurable.
2017-07-16 15:41:41 -07:00
Jessy Diamond Exum 3a415ab870 Can loopback now runtime configurable.
Useful for board tests, customer troubleshooting, and linux driver loopback support.
2017-07-14 20:32:48 -07:00
Jessy Diamond Exum c98739b66e Can bus numbers now sequential (0,1,2 not 0,1,4).
Can bus numbers are 7 bit numbers with the 8th bit marking receipt busses (0x80,0x81,0x82 not 2,3,6).
2017-07-14 13:55:38 -07:00
George Hotz 7733b09288 Revert commits that broke USB for openpilot.
Revert "fix openpilot board flashing"

This reverts commit 8ff93ad5da.

Revert "Fixed output_enabled led not turning off when mode changed to no output."

This reverts commit 27a8af1107.

Revert "Fixed loopback test for new GMLAN 'can4' behavior."

This reverts commit 59592f599a.

Revert "GMLAN is now always mapped through CAN4 (index 3)"

This reverts commit 329c091024.

Revert "Removed compile time config for CAN loopback, implemented as usb message."

This reverts commit e1a4c32985.

Revert "Change all output safety mode identifier to prevent user mistakes."

This reverts commit 6b363e2e92.

Revert "untabify"

This reverts commit 191f67b083.

Revert "Refactor of safety to support more modular additions of safety policies."

This reverts commit e5b524eddc.

Revert "Split up some more header files into compilation units."

This reverts commit e2a78912f5.

Revert "Enabled emulated control writes over USB."

This reverts commit 133cfe9703.

Revert "Moved CAN and USART code out of main.c and into more appropriate files."

This reverts commit daad2dc062.

Revert "Large Panda CAN cleanup. Restrict GMLAN to valid baud rates."

This reverts commit a0616a2bc2.

Revert "Panda library now correctly sends USB direction bit."

This reverts commit 1712c901d4.

Revert "Board makefile now automatically calculates header file dependencies."

This reverts commit 4a8d4e597b.

Revert "Loopback test works over wifi. (Disable trying to send over wifi)"

This reverts commit dae636968a.

Revert "Fix legacy board build"

This reverts commit 62bf4e5756.

Revert "Style cop"

This reverts commit c439f43726.

Revert "Untabify"

This reverts commit 41e5eec621.

Revert "Fixed disabling gmlan."

This reverts commit 5e1e45a4af.

Revert "Removed dead code, standardized canid in more commands, better erroring behavior."

This reverts commit b59aeb6d87.

Revert "loopback test works with new CAN bus ids."

This reverts commit 75970861cf.

Revert "Large reorganization of code and early integration of can bitrate setting."

This reverts commit a1ed7b62ee.
2017-07-12 11:27:16 -07:00
Jessy Diamond Exum 329c091024 GMLAN is now always mapped through CAN4 (index 3) 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum e1a4c32985 Removed compile time config for CAN loopback, implemented as usb message. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum e5b524eddc Refactor of safety to support more modular additions of safety policies. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum 133cfe9703 Enabled emulated control writes over USB. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum daad2dc062 Moved CAN and USART code out of main.c and into more appropriate files. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum a0616a2bc2 Large Panda CAN cleanup. Restrict GMLAN to valid baud rates.
Work towards removing/centralizing ifdefs for CAN3 and PANDA
2017-07-11 16:55:36 -07:00
Vasily Tarasov c439f43726 Style cop 2017-07-11 16:55:36 -07:00
Vasily Tarasov 41e5eec621 Untabify 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum 5e1e45a4af Fixed disabling gmlan. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum b59aeb6d87 Removed dead code, standardized canid in more commands, better erroring behavior. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum 75970861cf loopback test works with new CAN bus ids. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum a1ed7b62ee Large reorganization of code and early integration of can bitrate setting. 2017-07-11 16:55:36 -07:00
Jessy Diamond Exum 431080403d Panda firmware auto detects REV C hardware. 2017-06-27 19:27:24 -07:00
Jessy Diamond Exum 0e46ca4a5d Removed remaining inline definitions and split early.h into a header and a c file. 2017-06-14 09:26:04 -07:00
Jessy Diamond Exum 923dc197f0 Initial cleanup for inline issue. 2017-06-14 09:26:04 -07:00
Firmware Batman 2fd475d365 support GMLAN multiplexing with CAN3 on rev c panda 2017-06-09 14:11:37 -07:00
George Hotz cf865bd975 move silent mode code 2017-05-30 09:46:21 -07:00
Firmware Batman 1b81a2e600 flash esp fast like a nascar 2017-05-29 23:03:11 -07:00
Firmware Batman 6a6b69ea78 setting controls allowed disables silent mode 2017-05-29 21:33:05 -07:00
George Hotz b7b2b97783 CAN forwarding. logically works, but it's too slow to keep up...we need to hire a firmware engineer 2017-05-26 21:38:57 -07:00
Firmware Batman 5409c51041 just revc things 2017-05-16 22:15:52 -07:00
Firmware Batman ac162e3aa9 increase the size of the can rx fifo 2017-05-16 21:33:28 -07:00
George Hotz d42335075c make panda leds more sensible 2017-05-16 10:33:50 -07:00
George Hotz e38cbaae20 spi handshaking take 1 2017-05-03 15:54:47 -07:00
George Hotz 6cd08d6022 controls not allowed by default 2017-05-01 23:40:49 -07:00
George Hotz 8f859ceec6 fix warnings in board build 2017-05-01 22:59:10 -07:00
George Hotz 266b4114db fix vuln in esp flasher, allow send only on hardwired 2017-05-01 22:46:12 -07:00
George Hotz 2969e509c7 add panda safety 2017-05-01 20:23:47 -07:00
George Hotz 36ab1def6d support on device dongle secret 2017-04-28 17:49:55 -07:00
George Hotz 30395e2c7a support serial number fetching 2017-04-28 16:56:40 -07:00
George Hotz 08d12a7380 refactor safety hook 2017-04-28 09:56:01 -07:00
George Hotz 39522310e1 only support bootloader entry when hardwired 2017-04-28 09:45:58 -07:00
George Hotz 34aeb335e8 add bootloader lock support 2017-04-27 20:32:30 -07:00
George Hotz 9d08c2b22c parity needs one more bit 2017-04-26 18:39:26 -07:00
George Hotz 354903f280 pointers are hard 2017-04-26 18:30:40 -07:00
George Hotz dd676652b5 support fake LIN sending 2017-04-26 16:30:01 -07:00
George Hotz 00791dcea8 support ESP power down 2017-04-26 12:38:33 -07:00
George Hotz e6352e6e12 accord framing callback works 2017-04-25 20:23:05 -07:00
George Hotz 203c60ea16 add accord framing callback 2017-04-25 19:36:01 -07:00
George Hotz c27d449e11 minor bug fixes to uart 2017-04-25 18:06:44 -07:00
George Hotz 2b93c6d85a add baud and parity control 2017-04-25 15:16:23 -07:00
Firmware Batman c1dfed5299 loopback test is working over wifi 2017-04-18 07:34:56 -07:00
Firmware Batman 1b3d3c9b3e fix bug in switch statement refactor, fix serial_write 2017-04-18 01:12:04 -07:00
Firmware Batman efca3f7093 fix reset bug on bootloader, refactor USB api preparing for SPI USB proxy 2017-04-17 18:17:34 -07:00
George Hotz a3045252ab remove some dead code, move comment 2017-04-17 15:28:28 -07:00
George Hotz 99a2266f88 refactor libc, add crypto libraries to bootstub 2017-04-17 13:57:34 -07:00
George Hotz e07f9b111e initial commit 2017-04-06 18:11:36 -07:00