Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2018-10-17 19:04:29 +0300
committerDavid Crocker <dcrocker@eschertech.com>2018-10-17 19:04:29 +0300
commit36337d83b1a5e48831447667a2045f7190c44994 (patch)
tree58a5c13c30881bdca1352b982b9263da94058f0e
parent54709646636d530aea6f4a93cba5401dc36b5309 (diff)
Version 2.02RC32.02RC3
Bug fixes for 12864 display
-rw-r--r--src/Display/Menu.h2
-rw-r--r--src/Display/MenuItem.cpp1
-rw-r--r--src/Fans/Fan.cpp7
-rw-r--r--src/GCodes/GCodes2.cpp10
-rw-r--r--src/Platform.cpp6
-rw-r--r--src/Platform.h4
-rw-r--r--src/RepRapFirmware.cpp10
-rw-r--r--src/RepRapFirmware.h3
-rw-r--r--src/Version.h4
9 files changed, 24 insertions, 23 deletions
diff --git a/src/Display/Menu.h b/src/Display/Menu.h
index 16090c94..64db226e 100644
--- a/src/Display/Menu.h
+++ b/src/Display/Menu.h
@@ -41,7 +41,7 @@ private:
static bool CheckVisibility(MenuItem::Visibility vis);
static const size_t CommandBufferSize = 512;
- static const size_t MaxMenuLineLength = 80; // adjusts behaviour in Reload()
+ static const size_t MaxMenuLineLength = 100; // adjusts behaviour in Reload()
static const size_t MaxMenuFilenameLength = 18;
static const size_t MaxMenuNesting = 8; // maximum number of nested menus
static const PixelNumber InnerMargin = 2; // how many pixels we keep clear inside the border
diff --git a/src/Display/MenuItem.cpp b/src/Display/MenuItem.cpp
index 2caa722e..43552fd1 100644
--- a/src/Display/MenuItem.cpp
+++ b/src/Display/MenuItem.cpp
@@ -366,6 +366,7 @@ unsigned int ValueMenuItem::GetReferencedToolNumber() const
bool ValueMenuItem::Adjust_AlterHelper(int clicks)
{
+ itemChanged = true; // we will probably change the value, so it will need to be re-displayed
const unsigned int itemNumber = GetReferencedToolNumber();
switch (valIndex/100)
diff --git a/src/Fans/Fan.cpp b/src/Fans/Fan.cpp
index 7e90f538..ea96cc90 100644
--- a/src/Fans/Fan.cpp
+++ b/src/Fans/Fan.cpp
@@ -206,13 +206,10 @@ bool Fan::Configure(unsigned int mcode, int fanNum, GCodeBuffer& gb, const Strin
return seen;
}
+// Set the PWM. 'speed' is in the interval 0.0..1.0.
void Fan::SetPwm(float speed)
{
- if (speed > 1.0)
- {
- speed /= 255.0;
- }
- val = constrain<float>(speed, 0.0, 1.0);
+ val = speed;
Refresh();
}
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index 578b1d48..576a03b1 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -1034,12 +1034,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply)
const LogicalPin logicalPin = gb.GetIValue();
if (gb.Seen('S'))
{
- float val = gb.GetFValue();
- if (val > 1.0)
- {
- val /= 255.0;
- }
- val = constrain<float>(val, 0.0, 1.0);
+ float val = ConvertOldStylePwm(gb.GetFValue());
// The SX1509B I/O expander chip doesn't seem to work if you set PWM mode and then set digital output mode.
// This cases a problem if M42 is used to write to some pins and then M670 is used to set up the G1 P parameter port mapping.
@@ -1222,7 +1217,8 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply)
// ConfigureFan only processes S parameters if there were other parameters to process
if (!processed && gb.Seen('S'))
{
- const float f = constrain<float>(gb.GetFValue(), 0.0, 255.0);
+ // Convert the parameter to an interval in 0.0..1.0 here so that we save the correct value in lastDefaultFanSpeed
+ const float f = ConvertOldStylePwm(gb.GetFValue());
if (seenFanNum)
{
platform.SetFanValue(fanNum, f);
diff --git a/src/Platform.cpp b/src/Platform.cpp
index 531a0e9c..1b661208 100644
--- a/src/Platform.cpp
+++ b/src/Platform.cpp
@@ -3350,11 +3350,6 @@ float Platform::GetFanValue(size_t fan) const
return (fan < NUM_FANS) ? fans[fan].GetConfiguredPwm() : -1;
}
-// This is a bit of a compromise - old RepRaps used fan speeds in the range
-// [0, 255], which is very hardware dependent. It makes much more sense
-// to specify speeds in [0.0, 1.0]. This looks at the value supplied (which
-// the G Code reader will get right for a float or an int) and attempts to
-// do the right thing whichever the user has done.
void Platform::SetFanValue(size_t fan, float speed)
{
if (fan < NUM_FANS)
@@ -3378,7 +3373,6 @@ void Platform::EnableSharedFan(bool enable)
#endif
-
// Check if the given fan can be controlled manually so that DWC can decide whether or not to show the corresponding fan
// controls. This is the case if no thermostatic control is enabled and if the fan was configured at least once before.
bool Platform::IsFanControllable(size_t fan) const
diff --git a/src/Platform.h b/src/Platform.h
index 9bdc2630..0f899cee 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -495,8 +495,8 @@ public:
// Fans
bool ConfigureFan(unsigned int mcode, int fanNumber, GCodeBuffer& gb, const StringRef& reply, bool& error);
- float GetFanValue(size_t fan) const; // Result is returned in percent
- void SetFanValue(size_t fan, float speed); // Accepts values between 0..1 and 1..255
+ float GetFanValue(size_t fan) const; // Result is returned in range 0..1
+ void SetFanValue(size_t fan, float speed); // Accepts values between 0..1
#if defined(DUET_06_085)
void EnableSharedFan(bool enable); // enable/disable the fan that shares its PWM pin with the last heater
#endif
diff --git a/src/RepRapFirmware.cpp b/src/RepRapFirmware.cpp
index 31296ce3..23a2b9a2 100644
--- a/src/RepRapFirmware.cpp
+++ b/src/RepRapFirmware.cpp
@@ -346,4 +346,14 @@ void ListDrivers(const StringRef& str, DriversBitmap drivers)
}
}
+// Convert a PWM that is possibly in the old style 0..255 to be in the range 0.0..1.0
+float ConvertOldStylePwm(float v)
+{
+ if (v > 1.0)
+ {
+ v = v/255.0;
+ }
+ return constrain<float>(v, 0.0, 1.0);
+}
+
// End
diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h
index d0a94757..47e9ef40 100644
--- a/src/RepRapFirmware.h
+++ b/src/RepRapFirmware.h
@@ -269,6 +269,9 @@ template<typename BitmapType> BitmapType UnsignedArrayToBitMap(const uint32_t *a
return res;
}
+// Convert a PWM that is possibly in the old style 0..255 to be in the range 0.0..1.0
+float ConvertOldStylePwm(float v);
+
// Common definitions used by more than one module
constexpr size_t ScratchStringLength = 220; // standard length of a scratch string, enough to print delta parameters to
diff --git a/src/Version.h b/src/Version.h
index 2fcda3e6..eb8554c1 100644
--- a/src/Version.h
+++ b/src/Version.h
@@ -12,7 +12,7 @@
#ifndef VERSION
#ifdef RTOS
# define RTOSVER "(RTOS)"
-# define MAIN_VERSION "2.02RC2+1"
+# define MAIN_VERSION "2.02RC3"
#else
# define MAIN_VERSION "1.22"
# define RTOSVER
@@ -22,7 +22,7 @@
#endif
#ifndef DATE
-# define DATE "2018-10-17b1"
+# define DATE "2018-10-17b2"
#endif
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman, printm3d"