Skip to content

Commit

Permalink
Misra 17.7: The value returned by a function having non-void return t…
Browse files Browse the repository at this point in the history
…ype shall be used. We should hang on initial failed safety_set_mode
  • Loading branch information
rbiasini committed Jul 9, 2019
1 parent 06ee8bd commit 0b19206
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,13 @@ int main(void) {

// default to silent mode to prevent issues with Ford
// hardcode a specific safety mode if you want to force the panda to be in a specific mode
safety_set_mode(SAFETY_NOOUTPUT, 0);
int err = safety_set_mode(SAFETY_NOOUTPUT, 0);
if (err == -1) {
puts("Failed to set safety mode\n");
while (true) {
// if SAFETY_NOOUTPUT isn't succesfully set, we can't continue
}
}
#ifdef EON
// if we're on an EON, it's fine for CAN to be live for fingerprinting
can_silent = ALL_CAN_LIVE;
Expand Down

0 comments on commit 0b19206

Please sign in to comment.