Skip to content

Commit

Permalink
move that to main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed May 23, 2019
1 parent dfce5f6 commit e70b44a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, int hardwired) {
// Allow ELM security mode to be set over wifi.
if (hardwired || (setup->b.wValue.w == SAFETY_NOOUTPUT) || (setup->b.wValue.w == SAFETY_ELM327)) {
safety_set_mode(setup->b.wValue.w, (int16_t)setup->b.wIndex.w);
if (safety_ignition_hook() != -1) {
// if the ignition hook depends on something other than the started GPIO
// we have to disable power savings (fix for GM and Tesla)
power_save_disable();
}
switch (setup->b.wValue.w) {
case SAFETY_NOOUTPUT:
can_silent = ALL_CAN_SILENT;
Expand Down
5 changes: 0 additions & 5 deletions board/safety.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ int safety_set_mode(uint16_t mode, int16_t param) {
if (safety_hook_registry[i].id == mode) {
current_hooks = safety_hook_registry[i].hooks;
if (current_hooks->init) current_hooks->init(param);
if (safety_ignition_hook() != -1) {
// if the ignition hook depends on something other than the started GPIO
// we have to disable power savings (fix for GM and Tesla)
power_save_disable();
}
return 0;
}
}
Expand Down

0 comments on commit e70b44a

Please sign in to comment.