Commit 528f901 Commaremote
committed
1 parent 4e79ecf commit 528f901 Copy full SHA for 528f901
File tree 1 file changed +22
-4
lines changed
1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change
1
+ int cadillac_ignition_started = 0 ;
2
+
3
+ static void cadillac_rx_hook (CAN_FIFOMailBox_TypeDef * to_push ) {
4
+ int bus_number = (to_push -> RDTR >> 4 ) & 0xFF ;
5
+ uint32_t addr = to_push -> RIR >> 21 ;
6
+
7
+ if (addr == 0x135 && bus_number == 0 ) {
8
+ cadillac_ignition_started = 1 ; //as soona s we receive can msgs, ingition is on
9
+ }
10
+ }
11
+
12
+ static void cadillac_init (int16_t param ) {
13
+ cadillac_ignition_started = 0 ;
14
+ }
15
+
16
+ static int cadillac_ign_hook () {
17
+ return cadillac_ignition_started ;
18
+ }
19
+
1
20
// Placeholder file, actual safety is TODO.
2
21
const safety_hooks cadillac_hooks = {
3
- .init = alloutput_init ,
4
- .rx = default_rx_hook ,
22
+ .init = cadillac_init ,
23
+ .rx = cadillac_rx_hook ,
5
24
.tx = alloutput_tx_hook ,
6
25
.tx_lin = alloutput_tx_lin_hook ,
7
- .ignition = alloutput_ign_hook ,
26
+ .ignition = cadillac_ign_hook ,
8
27
.fwd = alloutput_fwd_hook ,
9
28
};
10
-
You can’t perform that action at this time.
0 commit comments