X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Farducontrol.cpp;h=4acfc60e0e761a0c5aaa7d4c260a0023988a8034;hb=aa48746158b19ad795a3cc656c4dfe17044baf54;hp=6d75c7542dd0490fb3cde74b8b2e771560636eb1;hpb=85dba3e775b10d1a653175318e79881e416db19a;p=r2c2.git diff --git a/source/libr2c2/arducontrol.cpp b/source/libr2c2/arducontrol.cpp index 6d75c75..4acfc60 100644 --- a/source/libr2c2/arducontrol.cpp +++ b/source/libr2c2/arducontrol.cpp @@ -702,6 +702,17 @@ bool ArduControl::Queue::empty() const } +bool ArduControl::CommandQueueTask::get_work(PendingCommand &cmd) +{ + return queue.pop(cmd); +} + +void ArduControl::CommandQueueTask::push(const PendingCommand &cmd) +{ + queue.push(cmd); +} + + ArduControl::RefreshTask::RefreshTask(): next(cycle.end()), round(0), @@ -1035,6 +1046,7 @@ ArduControl::ControlThread::ControlThread(ArduControl &c): control(c), done(false) { + tasks.push_back(&control.command_queue); tasks.push_back(&control.monitor); tasks.push_back(&control.mfx_announce); tasks.push_back(&control.mfx_search); @@ -1156,9 +1168,6 @@ void ArduControl::ControlThread::init_baud_rate() bool ArduControl::ControlThread::get_work(PendingCommand &cmd) { - if(control.command_queue.pop(cmd)) - return true; - for(vector::iterator i=tasks.begin(); i!=tasks.end(); ++i) if((*i)->get_work(cmd)) return true;