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:
Markus Hitter 2010-07-03 00:40:47 +02:00
parent 2004f04d4a
commit ff25c6847b
2 changed files with 6 additions and 5 deletions

View File

@ -297,11 +297,11 @@ void scan_char(uint8_t c) {
// process
if (next_target.seen_G || next_target.seen_M) {
if (
#ifdef REQUIRE_LINENUMBER
((next_target.N_expected == next_target.N) && (next_target.seen_N == 1))
#else
((next_target.N_expected == next_target.N) || (next_target.seen_N == 0))
#endif
#ifdef REQUIRE_LINENUMBER
((next_target.N_expected == next_target.N) && (next_target.seen_N == 1))
#else
1
#endif
) {
if (
#ifdef REQUIRE_CHECKSUM

View File

@ -6,6 +6,7 @@
#include "dda.h"
// wether to insist on N line numbers
// if not defined, N's are completely ignored
//#define REQUIRE_LINENUMBER
// wether to insist on a checksum