From cd074bc590175e945202ca3997d148b399f9261b Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Fri, 25 Feb 2011 13:40:48 +0100 Subject: [PATCH] foolproofed steps/mm setting (must be > 0) --- settings.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/settings.c b/settings.c index ca1bc05..a172795 100644 --- a/settings.c +++ b/settings.c @@ -139,6 +139,10 @@ int read_settings() { void settings_store_setting(int parameter, double value) { switch(parameter) { case 0: case 1: case 2: + if (value <= 0.0) { + printPgmString(PSTR("Steps/mm must be > 0.0\r\n")); + return; + } settings.steps_per_mm[parameter] = value; break; case 3: settings.pulse_microseconds = round(value); break; case 4: settings.default_feed_rate = value; break;