+
+ if(resync)
+ {
+ if(control.debug>=1)
+ IO::print("Synchronization with ArduControl lost, attempting to recover\n");
+ for(unsigned i=0; (resync && i<16); ++i)
+ {
+ control.serial.put('\xFF');
+ while(IO::poll(control.serial, IO::P_INPUT, control.command_timeout))
+ resync = (control.serial.get()!=0xFF);
+ }
+ if(resync)
+ {
+ if(control.debug>=1)
+ IO::print("Resynchronization failed, giving up\n");
+ done = true;
+ }
+ else
+ {
+ if(control.debug>=1)
+ IO::print("Resynchronization successful\n");
+ if(cmd.tag)
+ control.command_queue.push(cmd);
+ }
+ }