From a565f31dbb36d0be615770c1a16db32cd77bfcd6 Mon Sep 17 00:00:00 2001 From: "dps.lwk" Date: Mon, 11 Oct 2010 00:53:20 +0100 Subject: [PATCH] Resend Request changed from "Resend:" to "rs " As of reprap-mendel-20100806, the RepRap java host expects resend requests using the new "rs " format only, the version before this only excepted "Resend:" Repsnapper as of SVN 348 accepts both formats. Also fixed typo in config.h.dist Traumflug: to avoid breaking compatibility with earlier host versions, I took the chance to additionally introduce a sort of rudimentary version compatibility system. --- config.h.dist | 13 ++++++++++++- gcode.c | 5 +++++ temp.h | 3 --- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config.h.dist b/config.h.dist index 484ec60..e1d0c55 100644 --- a/config.h.dist +++ b/config.h.dist @@ -79,6 +79,17 @@ Firmware build options */ +/* + RepRap Host changes it's communications protocol from time to time and intentionally avoids backwards compatibility. Set this to the date the source code of your Host was fetched from RepRap's repository, which is likely also the build date. + See the discussion on the reprap-dev mailing list from 11 Oct. 2010. + + Undefine it for best human readability, set it to an old date for compatibility with hosts before August 2010 +*/ +// #define REPRAP_HOST_COMPATIBILITY 19750101 +#define REPRAP_HOST_COMPATIBILITY 20100806 +// #define REPRAP_HOST_COMPATIBILITY + + // this option makes the step interrupt interruptible. // this should help immensely with dropped serial characters, but may also make debugging infuriating due to the complexities arising from nested interrupts #define STEP_INTERRUPT_INTERRUPTIBLE 1 @@ -174,7 +185,7 @@ * list of PWM-able pins and corresponding timers * timer1 is used for step timing so don't use OC1A/OC1B * - * For Arudino Diecimila/Duemilanove/UNO + * For Arduino Diecimila/Duemilanove/UNO * Don't use OC1A/OC1B (DIO9/DIO10) * * OC0A DIO6 diff --git a/gcode.c b/gcode.c index 42c16c4..2e68b6c 100644 --- a/gcode.c +++ b/gcode.c @@ -775,7 +775,12 @@ void process_gcode_command(GCODE_COMMAND *gcmd) { ****************************************************************************/ void request_resend(void) { + #if defined REPRAP_HOST_COMPATIBILITY && REPRAP_HOST_COMPATIBILITY >= 20100806 + serial_writestr_P(PSTR("rs ")); + #else serial_writestr_P(PSTR("Resend:")); + #endif + serial_writestr_P(PSTR("rs ")); serwrite_uint8(next_target.N); serial_writechar('\n'); } diff --git a/temp.h b/temp.h index 02a3b07..9955a9e 100644 --- a/temp.h +++ b/temp.h @@ -5,9 +5,6 @@ #include "config.h" -// RepRap host software isn't exactly tolerant on what it ready back. -#define REPRAP_HOST_COMPATIBILITY - #define TEMP_FLAG_PRESENT 1 #define TEMP_FLAG_TCOPEN 2