Skip to content

Commit

Permalink
Do not start "knitting" until first line data is received
Browse files Browse the repository at this point in the history
This actually lets us start selecting needles sooner than before, because
we no longer consider the needle that was current when the carriage was
detected to have been selected already.
  • Loading branch information
jonathanperret committed Dec 12, 2024
1 parent 3e32811 commit d19f301
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ayab/knitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,17 @@ bool Knitter::isReady() {
*/
void Knitter::knit() {
if (m_firstRun) {
if (m_currentLineNumber != 0) {
// Request first line data before doing anything else
m_currentLineNumber = 0;
reqLine(m_currentLineNumber);
return;
} else if (m_lineRequested) {
// Still waiting for first line data: keep waiting
return;
}
// First line data received, let's proceed
m_firstRun = false;
GlobalBeeper::finishedLine();
++m_currentLineNumber;
reqLine(m_currentLineNumber);
}

#ifdef DBG_NOMACHINE
Expand Down

0 comments on commit d19f301

Please sign in to comment.