Parse received G-Codes. More...
#include "gcode_parse.h"#include <string.h>#include "serial.h"#include "sermsg.h"#include "dda_queue.h"#include "debug.h"#include "heater.h"#include "sersendf.h"#include "gcode_process.h"Defines | |
| #define | STEPS_PER_M_X ((uint32_t) ((STEPS_PER_MM_X * 1000.0) + 0.5)) |
| #define | STEPS_PER_M_Y ((uint32_t) ((STEPS_PER_MM_Y * 1000.0) + 0.5)) |
| #define | STEPS_PER_M_Z ((uint32_t) ((STEPS_PER_MM_Z * 1000.0) + 0.5)) |
| #define | STEPS_PER_M_E ((uint32_t) ((STEPS_PER_MM_E * 1000.0) + 0.5)) |
| #define | STEPS_PER_IN_X ((uint32_t) ((25.4 * STEPS_PER_MM_X) + 0.5)) |
| #define | STEPS_PER_IN_Y ((uint32_t) ((25.4 * STEPS_PER_MM_Y) + 0.5)) |
| #define | STEPS_PER_IN_Z ((uint32_t) ((25.4 * STEPS_PER_MM_Z) + 0.5)) |
| #define | STEPS_PER_IN_E ((uint32_t) ((25.4 * STEPS_PER_MM_E) + 0.5)) |
| #define | crc(a, b) (a ^ b) |
| crude crc macro | |
| #define | DECFLOAT_EXP_MAX 4 |
| #define | DECFLOAT_MANT_MM_MAX 1048075 |
| #define | DECFLOAT_MANT_IN_MAX 32267 |
Functions | |
| decfloat read_digit | __attribute__ ((__section__(".bss"))) |
| crude floating point data storage | |
| void | gcode_parse_char (uint8_t c) |
| Character Received - add it to our command. | |
| void | request_resend (void) |
Variables | |
| uint8_t | last_field = 0 |
| current or previous gcode word for working out what to do with data just received | |
| const uint32_t | powers [] |
| list of powers of ten, used for dividing down decimal numbers for sending, and also for our crude floating point algorithm | |
| const int32_t | rounding [DECFLOAT_EXP_MAX] = {0, 5, 50, 500} |
Parse received G-Codes.
| decfloat read_digit __attribute__ | ( | (__section__(".bss")) | ) |
crude floating point data storage
this is where we store all the data for the current command before we work out what to do with it
| void gcode_parse_char | ( | uint8_t | c ) |
Character Received - add it to our command.
accept the next character and process it
| c | the next character to process |
Referenced by main().
1.7.2