Commit Graph

400 Commits

Author SHA1 Message Date
Riccardo
541f8beee3 Fix bad bug 2019-06-24 19:16:53 -07:00
Riccardo
6a9ae3b7c3 The comma operator should not be used 2019-06-24 18:12:23 -07:00
Riccardo
5e3458df72 Fix Misra 20.7: Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses 2019-06-24 17:57:18 -07:00
Riccardo
f03c3a9fb6 Fix Misra 8.11: When an array with external linkage is declared, its size should be explicitly specified 2019-06-24 17:10:14 -07:00
Riccardo
83eccb0b5c Fix obvious 10.1 Misra violations: Operands shall not be of an inappropriate essential type 2019-06-24 16:43:11 -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
rbiasini
a3f65d66e9 capitalize MIN and MAX macros (#220) 2019-06-17 13:48:14 -07:00
George Hotz
00ebc16936 track can overflows 2019-06-14 13:33:30 -07:00
George Hotz
96dcfb18d4 pull in uart changes from harness branch 2019-06-14 13:26:01 -07:00
George Hotz
59eaec5dd6 add volatiles to the ring buffer pointers 2019-06-14 13:22:33 -07:00
George Hotz
b35285ba7d can push failed only with debug 2019-06-14 13:19:30 -07:00
George Hotz
f9d2e8876b can does not sleep 2019-06-14 12:14:21 -07:00
George Hotz
dfce5f6e36 minor fixes, and no more autobaud 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
386d5dfdf2 can wake from sleep is removed, didn't work in the first place 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
3cf8db9351 can.h always has CAN3 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
2c1e5f6325 the refactor continues 2019-05-23 12:39:22 -07:00
George Hotz
605bb27bce fix bootstub build 2019-05-23 12:39:22 -07:00
George Hotz
f32f0395fd factor out clear_send 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
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
Riccardo
f383eee968 Power saving: wake on RX and don't print durint IRQ 2019-04-08 19:21:37 -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
Riccardo
7927cabcc5 compiling the use of bitbang_gmlan only for panda 2018-08-20 19:28:05 -07:00
Adam Urban
aafbe05815 GMLAN GPIO Rebase 2018-08-02 12:39:53 -04:00
George Hotz
37df290a13 rename to gmlan_alt 2018-08-02 08:58:07 -07:00
George Hotz
8efa389745 detect ack 2018-06-15 16:54:01 -07:00
George Hotz
f5fab4b42a nicer err 2018-06-15 16:46:10 -07:00
George Hotz
ad4d4231d2 add gmlan fail count 2018-06-15 16:37:04 -07:00
George Hotz
998f7c0103 oops, set recessive 2018-06-15 16:23:22 -07:00
George Hotz
80051bea09 autoretry on chime 2018-06-15 16:21:53 -07:00
George Hotz
e21447765e use timer for can bitbanging 2018-06-11 10:06:10 -07:00
George Hotz
cb927337da minor bitbang refactor 2018-06-11 09:06:15 -07:00
George Hotz
ed2920cf8a support extended addressing in canbitbang 2018-06-11 09:02:11 -07:00
George Hotz
36df0996c5 move speed 2018-06-10 23:54:06 -07:00
George Hotz
7edc88e54b put that back 2018-06-10 23:50:50 -07:00
George Hotz
fa66e4b785 Revert "handle rollover"
This reverts commit 2ce3a26ab9.
2018-06-10 23:50:32 -07:00
George Hotz
2ce3a26ab9 handle rollover 2018-06-10 23:47:44 -07:00
George Hotz
223a1fb68f cleanin it up 2018-06-10 23:40:58 -07:00
George Hotz
d917386bf8 bitbanging works 2018-06-10 23:29:20 -07:00
George Hotz
74af4417db can crc 2018-06-10 23:11:29 -07:00
George Hotz
932d727867 bit stuffing support 2018-06-10 22:52:53 -07:00
George Hotz
be22522714 bros ok match bros 2018-06-10 16:48:53 -07:00
George Hotz
a577583530 working on gmbitbang 2018-06-10 16:23:54 -07:00