Functions | Variables

dda_queue.c File Reference

DDA Queue - manage the move queue. More...

#include "dda_queue.h"
#include <string.h>
#include <avr/interrupt.h>
#include "config.h"
#include "timer.h"
#include "serial.h"
#include "sermsg.h"
#include "temp.h"
#include "delay.h"
#include "sersendf.h"
#include "clock.h"

Functions

DDA movebuffer[MOVEBUFFER_SIZE] __attribute__ ((__section__(".bss")))
 move buffer.
uint8_t queue_full ()
 check if the queue is completely full
uint8_t queue_empty ()
 check if the queue is completely empty
void queue_step ()
 Take a step or go to the next move.
void enqueue (TARGET *t)
 add a move to the movebuffer
void next_move ()
 go to the next move.
void print_queue ()
 DEBUG - print queue.
void queue_flush ()
 dump queue for emergency stop.
void queue_wait ()
 waits for a space in the queue to become available

Variables

uint8_t mb_head = 0
 movebuffer head pointer. Points to the last move in the queue.
uint8_t mb_tail = 0
 movebuffer tail pointer. Points to the currently executing move

Detailed Description

DDA Queue - manage the move queue.


Function Documentation

DDA movebuffer [MOVEBUFFER_SIZE] __attribute__ ( (__section__(".bss"))   )

move buffer.

holds move queue

void enqueue ( TARGET t )

add a move to the movebuffer

Note:
this function waits for space to be available if necessary, check queue_full() first if waiting is a problem

Referenced by home_x_positive(), home_y_positive(), home_z_positive(), and process_gcode_command().

void next_move ( void   )

go to the next move.

be aware that this is sometimes called from interrupt context, sometimes not.

Referenced by enqueue(), and queue_step().

void print_queue ( void   )

DEBUG - print queue.

Qt/hs format, t is tail, h is head, s is F/full, E/empty or neither

Referenced by clock_250ms(), and process_gcode_command().

void queue_flush ( void   )

dump queue for emergency stop.

Todo:
effect on startpoint/current_position is undefined!

Referenced by process_gcode_command().

 All Data Structures Files Functions Variables Defines