yarf 0.1
Yet Another RepRap Firmware
|
The planning queue stores blocks prepared by the planner, until they are executed by the block handler. More...
Go to the source code of this file.
Functions | |
uint8_t | plan_q_next_index (uint8_t block_index) |
Returns the index of the block added after the block specified by the given index. | |
uint8_t | plan_q_prev_index (uint8_t block_index) |
Returns the index of the block added before the block specified by the given block_index. | |
bool | plan_q_full (void) |
Returns whether the planning queue is full. | |
bool | plan_q_empty (void) |
Returns whether the planning queue is empty. | |
uint8_t | plan_q_size (void) |
Returns the number of items in the planning queue. | |
block_t * | plan_q_get (uint8_t index) |
Returns the block at the specified index in the planning queue. | |
block_t * | plan_q_head (void) |
Returns a pointer to the block at the head of the planning queue. | |
uint8_t | plan_q_head_index (void) |
Returns the index of the head of the queue, i.e. | |
void | plan_q_shift_head (void) |
Shifts the head pointer of the planning queue, registering a new block that was added to the queue. | |
block_t * | plan_q_tail (void) |
Returns a pointer to the block at the tail of the planning queue. | |
uint8_t | plan_q_tail_index (void) |
Returns the index of the tail of the queue, i.e. | |
void | plan_q_discard_tail (void) |
Discards the oldest block in the queue, making room for a new block to be added. | |
void | plan_q_clear (void) |
Clears the planning queue. | |
void | plan_q_init (void) |
Initializes the planning queue. | |
Variables | |
block_t | q [PLANNER_QUEUE_SIZE] |
Array for storing the blocks in the planning queue. | |
volatile uint8_t | q_head |
Index of the head of the queue, which is the location where the next block to enter the queue will be added. | |
volatile uint8_t | q_tail |
Index of the tail of the queue, which is the location of the next block to executed by the block handler. |
The planning queue stores blocks prepared by the planner, until they are executed by the block handler.
Definition in file planner_queue.h.
bool plan_q_empty | ( | void | ) | [inline] |
Returns whether the planning queue is empty.
Definition at line 115 of file planner_queue.h.
bool plan_q_full | ( | void | ) | [inline] |
Returns whether the planning queue is full.
Definition at line 104 of file planner_queue.h.
block_t* plan_q_get | ( | uint8_t | index | ) | [inline] |
Returns the block at the specified index in the planning queue.
index | the index in the planning queue of the block to return |
Definition at line 139 of file planner_queue.h.
block_t* plan_q_head | ( | void | ) | [inline] |
Returns a pointer to the block at the head of the planning queue.
This block is considered to empty, so the pointer can be used to add a new block to the queue. If the queue is full, this function returns NULL.
Definition at line 154 of file planner_queue.h.
uint8_t plan_q_head_index | ( | void | ) | [inline] |
Returns the index of the head of the queue, i.e.
the index of an empty position where a new block can be written. The caller is responsible for checking that the queue is not full before writing to the returned location.
Definition at line 171 of file planner_queue.h.
uint8_t plan_q_next_index | ( | uint8_t | block_index | ) | [inline] |
Returns the index of the block added after the block specified by the given index.
block_index | the index for which to return the next index |
Definition at line 72 of file planner_queue.h.
uint8_t plan_q_prev_index | ( | uint8_t | block_index | ) | [inline] |
Returns the index of the block added before the block specified by the given block_index.
block_index | the index for which to return the previous index |
Definition at line 90 of file planner_queue.h.
uint8_t plan_q_size | ( | void | ) | [inline] |
Returns the number of items in the planning queue.
Definition at line 126 of file planner_queue.h.
block_t* plan_q_tail | ( | void | ) | [inline] |
Returns a pointer to the block at the tail of the planning queue.
The tail block is the oldest block in the queue. If the queue is empty, this function returns NULL.
Definition at line 197 of file planner_queue.h.
uint8_t plan_q_tail_index | ( | void | ) | [inline] |
Returns the index of the tail of the queue, i.e.
the index of the oldest block in the queue. The caller is responsible for checking that the queue is not empty when using the returned index.
Definition at line 215 of file planner_queue.h.