Exemplo n.º 1
0
stat_t gc_gcode_parser(char_t *block)
{
	char_t *str = block;					// gcode command or NUL string
	char_t none = NUL;
	char_t *com = &none;					// gcode comment or NUL string
	char_t *msg = &none;					// gcode message or NUL string
	uint8_t block_delete_flag;

	// don't process Gcode blocks if in alarmed state
	if (cm.machine_state == MACHINE_ALARM) return (STAT_MACHINE_ALARMED);

	_normalize_gcode_block(str, &com, &msg, &block_delete_flag);

	// Block delete omits the line if a / char is present in the first space
	// For now this is unconditional and will always delete
//	if ((block_delete_flag == true) && (cm_get_block_delete_switch() == true)) {
	if (block_delete_flag == true) {
		return (STAT_NOOP);
	}

	// queue a "(MSG" response
	if (*msg != NUL) {
		(void)cm_message(msg);				// queue the message
	}

	return(_parse_gcode_block(block));
}
Exemplo n.º 2
0
stat_t gc_gcode_parser(char_t *block)
{
	char_t *cmd = block;					// gcode command or NUL string
	char_t none = NUL;
	char_t *com = &none;					// gcode comment or NUL string
	char_t *msg = &none;					// gcode message or NUL string
	uint8_t block_delete_flag;

	_normalize_gcode_block(cmd, &com, &msg, &block_delete_flag);
	
	if ((block_delete_flag == true) && (cm_get_block_delete_switch() == true)) {
		return (STAT_NOOP);
	}
//	if (*msg != NUL) { // +++++ THIS HAS A SERIOUS BUG IN IT SO FOR NOW IT'S DISABLED
//		(void)cm_message(msg);				// queue the message	
//	}	
	return(_parse_gcode_block(block));
}
Exemplo n.º 3
0
uint8_t gc_gcode_parser(char *block)
{
	_normalize_gcode_block(block);			// get block ready for parsing
	if (block[0] == NUL) return (TG_NOOP); 	// ignore comments (stripped)
	return(_parse_gcode_block(block));		// parse block & return status
}