linux: Open watchdog device after console

Only open the watchdog device after the console has been opened.  The
machine should not reboot in the unlikely event the console can't be
opened.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-10-14 00:35:47 -04:00
parent d222ec1024
commit 1c59a0d30a
1 changed files with 8 additions and 10 deletions

View File

@ -77,22 +77,20 @@ main(int argc, char **argv)
}
// Initial setup
if (realtime) {
int ret = realtime_setup();
if (ret)
return ret;
}
int ret = console_setup("/tmp/klipper_host_mcu");
if (ret)
return -1;
if (watchdog) {
int ret = watchdog_setup();
if (ret)
return ret;
}
if (realtime) {
int ret = realtime_setup();
if (ret)
return ret;
}
int ret = console_setup("/tmp/klipper_host_mcu");
if (ret)
return -1;
// Main loop
sched_main();
return 0;