You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "libs/nuts_bolts.h"
-#include "libs/RingBuffer.h"
-#include "../communication/utils/Gcode.h"
-#include "libs/Module.h"
-#include "libs/Kernel.h"
+#include "nuts_bolts.h"
+#include "Gcode.h"
+#include "Module.h"
+#include "Kernel.h"
#include "Timer.h" // mbed.h lib
#include "wait_api.h" // mbed.h lib
#include "Block.h"
#include "mri.h"
#include "checksumm.h"
#include "Config.h"
-#include "libs/StreamOutputPool.h"
+#include "StreamOutputPool.h"
#include "ConfigValue.h"
#include "StepTicker.h"
#include "Robot.h"
Conveyor::Conveyor()
{
running = false;
- halted = false;
allow_fetch = false;
flush= false;
}
void Conveyor::on_halt(void* argument)
{
if(argument == nullptr) {
- halted = true;
flush_queue();
- } else {
- halted = false;
}
}
void Conveyor::queue_head_block()
{
// upstream caller will block on this until there is room in the queue
- while (queue.is_full() && !halted) {
+ while (queue.is_full() && !THEKERNEL->is_halted()) {
//check_queue();
THEKERNEL->call_event(ON_IDLE, this); // will call check_queue();
}
- if(halted) {
+ if(THEKERNEL->is_halted()) {
// we do not want to stick more stuff on the queue if we are in halt state
// clear and release the block on the head
queue.head_ref()->clear();
// default the feerate to zero if there is no block available
this->current_feedrate= 0;
- if(halted || queue.isr_tail_i == queue.head_i) return false; // we do not have anything to give
+ if(THEKERNEL->is_halted() || queue.isr_tail_i == queue.head_i) return false; // we do not have anything to give
// wait for queue to fill up, optimizes planning
if(!allow_fetch) return false;
break;
}
}
-
-// feels hacky, but apparently the way to do it
-#include "HeapRing.cpp"
-template class HeapRing<Block>;