Skip to content

Commit 5349b9a

Browse files
committed
Version 1.22.1
Send F0 0F as well as M112 when emergency stop buttin pressed, for RepRapFirmware 2.02 and later For dimming control, treat printer state Off the same as Idle Error message popups no longer time out, they have to be closed manually Bug fix: Extrusion rates didn't match the buttons Bug fix: babystepping sent M290 M290 S0.02 instead of just M290 S0.02 Bug fix: couldn't cancel a message popup that appears on top of a smaller popup Bug fix: serial I/O JSON parameter buffer was too short to handle long responses e.g. from M591 D0
1 parent 48b379b commit 5349b9a

File tree

7 files changed

+26
-16
lines changed

7 files changed

+26
-16
lines changed

src/Bugs.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@
5858
[not done, image load is much faster now] Allow image load to be cancelled by touch, unless it is now much faster
5959
[fixed buffer overflow, test before release] Test extrusion factors are working, we have a report that they get reset to 100 on T3
6060

61+
Bugs in 1.22, to be fixed in 1.22.1:
62+
- [done, test] Extrusion rates don't match the buttons, only 1 of 2 tables was updated
63+
- [done] for dimming, treat printer Off the same as Idle
64+
- [done, ok] babystepping sends M290 M290 S0.02
65+
- [done, ok] can't cancel a message popup that appears on top of a babystepping popup
66+
- [done, ok] don't timeout error messages
67+
- [done, ok] handle longer responses in Console window e.g. from M591
68+
- [done, ok] Send F0 0F on emergency stop
69+
6170
Remaining:
6271

6372
Display IP address in top bar?

src/Display.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ bool Window::Visible(const DisplayField *p) const
182182
// Get the field that has been touched, or nullptr if we can't find one
183183
ButtonPress Window::FindEvent(PixelNumber x, PixelNumber y)
184184
{
185-
return (x < Xpos() || y < Ypos()) ? ButtonPress()
186-
: (next != nullptr) ? next->FindEvent(x, y)
185+
return (next != nullptr) ? next->FindEvent(x, y)
186+
: (x < Xpos() || y < Ypos()) ? ButtonPress()
187187
: DisplayField::FindEvent(x - Xpos(), y - Ypos(), root);
188188
}
189189

src/Hardware/SerialIo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ namespace SerialIo
205205

206206
// fieldId is the name of the field being received. A '^' character indicates the position of an array index, and a ':' character indicates a field separator.
207207
String<50> fieldId;
208-
String<160> fieldVal; // long enough for about 3 lines of message
208+
String<300> fieldVal; // long enough for about 6 lines of message
209209
size_t arrayIndices[MaxArrayNesting];
210210
size_t arrayDepth = 0;
211211

src/MessageLog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace MessageLog
1818
{
1919
const unsigned int MaxCharsPerRow = 80;
2020

21-
const unsigned int MaxCharsPerMessage = 400;
22-
const unsigned int MaxNewMessageLines = 5;
21+
const unsigned int MaxCharsPerMessage = 300; // variable fieldVal in module SerialIO must also be large enough for this
22+
const unsigned int MaxNewMessageLines = 6;
2323

2424
struct Message
2525
{

src/PanelDue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ extern void RestoreBrightness()
506506
extern void DimBrightness()
507507
{
508508
if ( (GetDisplayDimmerType() == DisplayDimmerType::always)
509-
|| (GetDisplayDimmerType() == DisplayDimmerType::onIdle && status == PrinterStatus::idle)
509+
|| (GetDisplayDimmerType() == DisplayDimmerType::onIdle && (status == PrinterStatus::idle || status == PrinterStatus::off))
510510
)
511511
{
512512
Buzzer::SetBacklight(nvData.brightness/8);
@@ -1243,7 +1243,7 @@ int main(void)
12431243
if (rstc_get_reset_cause(RSTC) != RSTC_SOFTWARE_RESET && _esplash[0] == DISPLAY_X && _esplash[1] == DISPLAY_Y)
12441244
{
12451245
lcd.fillScr(black);
1246-
lcd.drawCompressedBitmapBottomToTop(0, 0, DISPLAY_X, DISPLAY_Y, _esplash + 2);
1246+
lcd.drawCompressedBitmapBottomToTop(0, 0, DISPLAY_X, DISPLAY_Y, _esplash + 2);
12471247
const uint32_t now = SystemTick::GetTickCount();
12481248
do
12491249
{

src/UserInterface.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void CreateExtrudePopup(const ColourScheme& colours)
422422
{
423423
static const char * array extrudeAmountValues[] = { "100", "50", "20", "10", "5", "1" };
424424
static const char * array extrudeSpeedValues[] = { "50", "20", "10", "5", "2" };
425-
static const char * array extrudeSpeedParams[] = { "3000", "2400", "1200", "600", "300" };
425+
static const char * array extrudeSpeedParams[] = { "3000", "1200", "600", "300", "120" }; // must be extrudeSpeedValues * 60
426426

427427
extrudePopup = new StandardPopupWindow(extrudePopupHeight, extrudePopupWidth, colours.popupBackColour, colours.popupBorderColour, colours.popupTextColour, colours.buttonImageBackColour, strings->extrusionAmount);
428428
PixelNumber ypos = popupTopMargin + buttonHeight + extrudeButtonRowSpacing;
@@ -666,15 +666,15 @@ void CreateKeyboardPopup(uint32_t language, ColourScheme colours)
666666
void CreateBabystepPopup(const ColourScheme& colours)
667667
{
668668
static const char * array const babystepStrings[2] = { UP_ARROW " 0.02", DOWN_ARROW " 0.02" };
669-
static const char * array const babystepCommands[2] = { "M290 S0.02", "M290 S-0.02" };
669+
static const char * array const babystepAmounts[2] = { "0.02", "-0.02" };
670670
babystepPopup = new StandardPopupWindow(babystepPopupHeight, babystepPopupWidth, colours.popupBackColour, colours.popupBorderColour, colours.popupTextColour, colours.buttonImageBackColour,
671671
strings->babyStepping);
672672
PixelNumber ypos = popupTopMargin + babystepRowSpacing;
673673
DisplayField::SetDefaultColours(colours.popupTextColour, colours.popupBackColour);
674674
babystepPopup->AddField(babystepOffsetField = new FloatField(ypos, popupSideMargin, babystepPopupWidth - 2 * popupSideMargin, TextAlignment::Left, 3, strings->currentZoffset, "mm"));
675675
ypos += babystepRowSpacing;
676676
DisplayField::SetDefaultColours(colours.popupTextColour, colours.buttonImageBackColour);
677-
CreateStringButtonRow(babystepPopup, ypos, popupSideMargin, babystepPopupWidth - 2 * popupSideMargin, fieldSpacing, 2, babystepStrings, babystepCommands, evBabyStepAmount);
677+
CreateStringButtonRow(babystepPopup, ypos, popupSideMargin, babystepPopupWidth - 2 * popupSideMargin, fieldSpacing, 2, babystepStrings, babystepAmounts, evBabyStepAmount);
678678
}
679679

680680
// Create the grid of heater icons and temperatures
@@ -1493,14 +1493,14 @@ namespace UI
14931493
// Process a new response. This is treated like a simple alert except that it times out and isn't cleared by a "clear alert" command from the host.
14941494
void NewResponseReceived(const char* array text)
14951495
{
1496-
if (alertMode < 2 && (currentTab == tabControl || currentTab == tabPrint)) // if the current alert doesn't require acknowledgement
1496+
if (alertMode < 2 && (currentTab == tabControl || currentTab == tabPrint)) // if the current alert doesn't require acknowledgement
14971497
{
14981498
alertPopup->Set(strings->response, text, 1, 0);
14991499
mgr.SetPopup(alertPopup, AutoPlace, AutoPlace);
1500-
alertMode = -1; // make sure that a call to ClearAlert doesn't clear us
1500+
alertMode = -1; // make sure that a call to ClearAlert doesn't clear us
15011501
displayingResponse = true;
15021502
whenAlertReceived = SystemTick::GetTickCount();
1503-
alertTicks = 5000; // timeout after 5 seconds
1503+
alertTicks = (stringStartsWith(text, "Error")) ? 0 : 5000; // timeout after 5 seconds if it isn't an error message
15041504
}
15051505
}
15061506

@@ -1612,7 +1612,8 @@ namespace UI
16121612
{
16131613
case evEmergencyStop:
16141614
{
1615-
SerialIo::SendString("M112\n");
1615+
// We send M112 for the benefit of old firmware, and F0 0F (an invalid UTF8 sequence) for new firmware
1616+
SerialIo::SendString("M112 ;" "\xF0" "\x0F" "\n");
16161617
Delay(1000);
16171618
SerialIo::SendString("M999\n");
16181619
Reconnect();
@@ -1817,7 +1818,7 @@ namespace UI
18171818
break;
18181819

18191820
case evBabyStepAmount:
1820-
SerialIo::SendString("M290 ");
1821+
SerialIo::SendString("M290 Z");
18211822
SerialIo::SendString(bp.GetSParam());
18221823
SerialIo::SendChar('\n');
18231824
break;

src/Version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
#ifndef SRC_VERSION_HPP_
99
#define SRC_VERSION_HPP_
1010

11-
#define VERSION_TEXT "1.22(19b1)"
11+
#define VERSION_TEXT "1.22.1(28b1)"
1212

1313
#endif /* SRC_VERSION_HPP_ */

0 commit comments

Comments
 (0)