mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-09-30 11:23:55 +08:00
c4bba32347
f2292e4 Hyundai: added safety check for button spam 1a8c4c4 Hyundai safety: fwd option 5398abf Hyundai safety: added tests for cruise enable/disable too a91d7ef added hyundai regression test 487fcae Safety hyundai: fixed RT check 04270b8 Safety Hyundai: bug fixes d0c28b7 Hyndai safety: tuned ad1ba69 Hyundai safety: fixed wrong param 8a1dcbe Hyundai safety: added Santa Fe safety: need to be tested. Removed some unnecessary funcitons 4e9d08a Hyundai safety: controls_allowed ==1 by default for now f42d092 Hyundai all output for now 7927cab compiling the use of bitbang_gmlan only for panda 4fe2dcd build pedal image in CI 3d67294 keep pedal obj folder git-subtree-dir: panda git-subtree-split: f2292e420bd856b8cef6633af46e2641f401e84c
60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
void default_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {}
|
|
|
|
int default_ign_hook() {
|
|
return -1; // use GPIO to determine ignition
|
|
}
|
|
|
|
// *** no output safety mode ***
|
|
|
|
static void nooutput_init(int16_t param) {
|
|
controls_allowed = 0;
|
|
}
|
|
|
|
static int nooutput_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
|
|
return false;
|
|
}
|
|
|
|
static int nooutput_tx_lin_hook(int lin_num, uint8_t *data, int len) {
|
|
return false;
|
|
}
|
|
|
|
static int nooutput_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
|
|
return -1;
|
|
}
|
|
|
|
const safety_hooks nooutput_hooks = {
|
|
.init = nooutput_init,
|
|
.rx = default_rx_hook,
|
|
.tx = nooutput_tx_hook,
|
|
.tx_lin = nooutput_tx_lin_hook,
|
|
.ignition = default_ign_hook,
|
|
.fwd = nooutput_fwd_hook,
|
|
};
|
|
|
|
// *** all output safety mode ***
|
|
|
|
static void alloutput_init(int16_t param) {
|
|
controls_allowed = 1;
|
|
}
|
|
|
|
static int alloutput_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
|
|
return true;
|
|
}
|
|
|
|
static int alloutput_tx_lin_hook(int lin_num, uint8_t *data, int len) {
|
|
return true;
|
|
}
|
|
|
|
static int alloutput_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
|
|
return -1;
|
|
}
|
|
|
|
const safety_hooks alloutput_hooks = {
|
|
.init = alloutput_init,
|
|
.rx = default_rx_hook,
|
|
.tx = alloutput_tx_hook,
|
|
.tx_lin = alloutput_tx_lin_hook,
|
|
.ignition = default_ign_hook,
|
|
.fwd = alloutput_fwd_hook,
|
|
};
|