int prev_block_index(int index);
void push_back(kind object);
void pop_front(kind &object);
- kind* get_tail_ref();
+ kind* get_head_ref();
void get( int index, kind &object);
kind* get_ref( int index);
void delete_first();
this->head = (head+1)&(length-1);
}
-template<class kind, int length> kind* RingBuffer<kind, length>::get_tail_ref(){
+template<class kind, int length> kind* RingBuffer<kind, length>::get_head_ref(){
return &(buffer[head]);
}
void Conveyor::on_idle(void* argument){
if (flush_blocks){
// Cleanly delete block
- Block* block = queue.get_tail_ref();
+ Block* block = queue.get_head_ref();
block->gcodes.clear();
queue.delete_first();
__disable_irq();
Block* Conveyor::new_block(){
// Take the next untaken block on the queue ( the one after the last one )
- Block* block = this->queue.get_tail_ref();
+ Block* block = this->queue.get_head_ref();
// Then clean it up
if( block->conveyor == this ){
block->gcodes.clear();