diff --git a/selfdrive/boardd/pigeon.cc b/selfdrive/boardd/pigeon.cc index 60b60f46f..529b9b810 100644 --- a/selfdrive/boardd/pigeon.cc +++ b/selfdrive/boardd/pigeon.cc @@ -64,7 +64,8 @@ bool Pigeon::send_with_ack(std::string cmd){ } void Pigeon::init() { - while (!do_exit){ + for (int i = 0; i < 10; i++){ + if (do_exit) return; LOGW("panda GPS start"); // power off pigeon @@ -106,10 +107,10 @@ void Pigeon::init() { if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x09\x01\x1E\x70"s)) continue; if (!send_with_ack("\xB5\x62\x06\x01\x03\x00\x0A\x0B\x01\x20\x74"s)) continue; - break; + LOGW("panda GPS on"); + return; } - - LOGW("panda GPS on"); + LOGE("failed to initialize panda GPS"); } void PandaPigeon::connect(Panda * p) {