If line numbers aren't required, don't bother about their
actual value either. Failing case was RepRap host software, sending N0 T8 *18 N0 G21 *58 on each build start. Also saves a whopping 124 bytes of memory on ignoring line numbers. next_target.N_expected is never used and it's handling should be optimized out.
This commit is contained in:
parent
2004f04d4a
commit
ff25c6847b
|
|
@ -297,11 +297,11 @@ void scan_char(uint8_t c) {
|
||||||
// process
|
// process
|
||||||
if (next_target.seen_G || next_target.seen_M) {
|
if (next_target.seen_G || next_target.seen_M) {
|
||||||
if (
|
if (
|
||||||
#ifdef REQUIRE_LINENUMBER
|
#ifdef REQUIRE_LINENUMBER
|
||||||
((next_target.N_expected == next_target.N) && (next_target.seen_N == 1))
|
((next_target.N_expected == next_target.N) && (next_target.seen_N == 1))
|
||||||
#else
|
#else
|
||||||
((next_target.N_expected == next_target.N) || (next_target.seen_N == 0))
|
1
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
#ifdef REQUIRE_CHECKSUM
|
#ifdef REQUIRE_CHECKSUM
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include "dda.h"
|
#include "dda.h"
|
||||||
|
|
||||||
// wether to insist on N line numbers
|
// wether to insist on N line numbers
|
||||||
|
// if not defined, N's are completely ignored
|
||||||
//#define REQUIRE_LINENUMBER
|
//#define REQUIRE_LINENUMBER
|
||||||
|
|
||||||
// wether to insist on a checksum
|
// wether to insist on a checksum
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue