mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 04:22:09 +08:00
pigeon init add max retry count
old-commit-hash: f7e276fcce39e5e27c10d0bfb003754ec463c788
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user