-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgcode-queue.h
More file actions
47 lines (38 loc) · 1.23 KB
/
Copy pathgcode-queue.h
File metadata and controls
47 lines (38 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
============================================================================
Name : gcode-machine.c
Author : Radu - Eosif Mihailescu
Version : 1.0 (2013-09-25)
Copyright : (C) 2013 Radu - Eosif Mihailescu <radu.mihailescu@linux360.ro>
Description : G-Code Movement Queue API Header
============================================================================
*/
#ifndef GCODE_QUEUE_H_
#define GCODE_QUEUE_H_
#include <stdbool.h>
#include "gcode-state.h"
typedef struct {
bool isArc;
TGCodeOffsetSpec target;
TGCodeOffsetSpec center;
bool ccw;
double feedValue;
TGCodeCompSpec radComp;
TGCodeCornerMode corner;
struct {
bool X, Y, Z;
} axesMoving;
} TGCodeMoveSpec;
/* Start the show */
void init_queue(void);
/* Adds move to the tail of the queue, returns false if queue is full */
bool enqueue_move(TGCodeMoveSpec move);
/* Pops move from the head of the queue, returns false if queue is empty */
bool dequeue_move(TGCodeMoveSpec *move);
/* Returns current queue size */
uint8_t queue_size(void);
/* Returns move at the head of the queue without modifying queue. If the queue
* is empty, results are undefined */
TGCodeMoveSpec peek_move(void);
bool done_queue(void);
#endif /* GCODE_QUEUE_H_ */