Parses gcode commands sent over serial communication
Dependencies: 4DGL-uLCD-SE MODSERIAL mbed
gparser.h@0:fa0891ea897b, 2014-04-14 (annotated)
- Committer:
- ajb88
- Date:
- Mon Apr 14 05:03:29 2014 +0000
- Revision:
- 0:fa0891ea897b
Working version of gcode parser using MODSERIAL library. Code needs to be cleaned up and library and classes created. Needs refining of the logic so it can be requested to refill a circular buffer
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ajb88 | 0:fa0891ea897b | 1 | #ifndef PARSER_H |
ajb88 | 0:fa0891ea897b | 2 | #define PARSER_H |
ajb88 | 0:fa0891ea897b | 3 | |
ajb88 | 0:fa0891ea897b | 4 | #include "MODSERIAL.h" |
ajb88 | 0:fa0891ea897b | 5 | |
ajb88 | 0:fa0891ea897b | 6 | #define CMD_BUFFER_SIZE 200 |
ajb88 | 0:fa0891ea897b | 7 | #define CMD_LIST_SIZE 512 |
ajb88 | 0:fa0891ea897b | 8 | |
ajb88 | 0:fa0891ea897b | 9 | // struct to hold a Gcode command |
ajb88 | 0:fa0891ea897b | 10 | typedef struct { |
ajb88 | 0:fa0891ea897b | 11 | int G; |
ajb88 | 0:fa0891ea897b | 12 | float X; |
ajb88 | 0:fa0891ea897b | 13 | float Y; |
ajb88 | 0:fa0891ea897b | 14 | float Z; |
ajb88 | 0:fa0891ea897b | 15 | float F; |
ajb88 | 0:fa0891ea897b | 16 | float I; |
ajb88 | 0:fa0891ea897b | 17 | float J; |
ajb88 | 0:fa0891ea897b | 18 | }G_cmd; |
ajb88 | 0:fa0891ea897b | 19 | |
ajb88 | 0:fa0891ea897b | 20 | |
ajb88 | 0:fa0891ea897b | 21 | void parseGcode(); |
ajb88 | 0:fa0891ea897b | 22 | void parserInit(); |
ajb88 | 0:fa0891ea897b | 23 | G_cmd* fillInCmdList(); |
ajb88 | 0:fa0891ea897b | 24 | void cmd_Received(MODSERIAL_IRQ_INFO *q); |
ajb88 | 0:fa0891ea897b | 25 | |
ajb88 | 0:fa0891ea897b | 26 | #endif |