diff --git a/Changelog b/Changelog index 84e4e8a..c96013c 100644 --- a/Changelog +++ b/Changelog @@ -1,10 +1,12 @@ Changelog: -V00.00.00.11 July X, 2016 +V00.00.00.12 July 20, 2016 * Sped up movements * No longer adjusts the motor E current since it might be putting too much stress on the motor when no filament is present and when the nozzle is clogged * Compiled with the latest Atmel AVR 8-bit Toolchain V3.5.3 and Atmel Software Framework V3.31 + * Fixed issue where the bed orientation version in the printer's EEPROM would be updated after running a G32 command + * Sets unused pins as inputs with pull-up resistors enabled V00.00.00.10 June 16, 2016 diff --git a/M33 Manager/M33 Manager Linux.zip b/M33 Manager/M33 Manager Linux.zip index 47b75d3..e8c4850 100644 Binary files a/M33 Manager/M33 Manager Linux.zip and b/M33 Manager/M33 Manager Linux.zip differ diff --git a/M33 Manager/M33 Manager OS X.zip b/M33 Manager/M33 Manager OS X.zip index bdb8f7d..69485c4 100644 Binary files a/M33 Manager/M33 Manager OS X.zip and b/M33 Manager/M33 Manager OS X.zip differ diff --git a/M33 Manager/M33 Manager Windows.zip b/M33 Manager/M33 Manager Windows.zip index 8af5ce4..c982522 100644 Binary files a/M33 Manager/M33 Manager Windows.zip and b/M33 Manager/M33 Manager Windows.zip differ diff --git a/M33 Manager/Makefile b/M33 Manager/Makefile index 873a0a4..0b87c6b 100644 --- a/M33 Manager/Makefile +++ b/M33 Manager/Makefile @@ -3,7 +3,7 @@ PROGRAM_NAME = M33\ Manager VERSION = 0.07 TARGET_PLATFORM = LINUX64 USE_GUI = TRUE -IME_ROM_VERSION_STRING = 1900000011 +IME_ROM_VERSION_STRING = 1900000012 M3D_ROM_VERSION_STRING = 2016040401 SRCS = main.cpp printer.cpp gcode.cpp common.cpp diff --git a/M33 Manager/gui.cpp b/M33 Manager/gui.cpp index 82bbd04..269b59d 100644 --- a/M33 Manager/gui.cpp +++ b/M33 Manager/gui.cpp @@ -1152,7 +1152,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, //sendCommand("M619 S" + eepromOffsets["bedHeightOffset"]["offset"] + " T" + eepromOffsets["bedHeightOffset"]["bytes"], // Send commands - if(printer.getFirmwareType() == "M3D" || printer.getFirmwareType() == "M3D Mod") { + if(printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD) { sendCommand("G91"); sendCommand("G0 Z0.1 F90"); } @@ -3083,7 +3083,7 @@ void MyFrame::checkInvalidValues() { iMeVersion.insert(i * 2 + 2 + i, "."); // Display firmware installation dialog - wxMessageDialog *dial = new wxMessageDialog(NULL, "Firmware is corrupt. Install " + (printer.getFirmwareType() == "M3D" || printer.getFirmwareType() == "M3D Mod" ? "M3D V" TOSTRING(M3D_ROM_VERSION_STRING) : "iMe V" + iMeVersion) + "?", "M33 Manager", wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION); + wxMessageDialog *dial = new wxMessageDialog(NULL, "Firmware is corrupt. Install " + (printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD ? "M3D V" TOSTRING(M3D_ROM_VERSION_STRING) : "iMe V" + iMeVersion) + "?", "M33 Manager", wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION); // Check if installing firmware if(dial->ShowModal() == wxID_YES) { @@ -3092,7 +3092,7 @@ void MyFrame::checkInvalidValues() { fixingInvalidValues = true; // Check if installing M3D firmware - if(printer.getFirmwareType() == "M3D" || printer.getFirmwareType() == "M3D Mod") { + if(printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD) { // Install M3D firmware wxCommandEvent event(wxEVT_BUTTON, installM3dFirmwareButton->GetId()); @@ -3143,6 +3143,96 @@ void MyFrame::checkInvalidValues() { wxMessageBox("Failed to update firmware", "M33 Manager", wxOK | wxICON_ERROR | wxCENTRE); }); } + + // Otherwise + else + + // Disconnect printer + printer.disconnect(); + } + + // Otherwise check if firmware is incompatible or outdated + else if(printer.getFirmwareType() == UNKNOWN_FIRMWARE || ((printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD) && stoi(printer.getFirmwareRelease()) < M3D_ROM_VERSION_STRING) || (printer.getFirmwareType() == IME && printer.getFirmwareVersion() < IME_ROM_VERSION_STRING)) { + + // Set if firmware is incompatible + bool incompatible = true; + if((printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD) && stoi(printer.getFirmwareRelease()) >= 2015122112) + incompatible = false; + else if(printer.getFirmwareType() == IME && printer.getFirmwareVersion() >= 1900000006) + incompatible = false; + + // Get iMe version + string iMeVersion = static_cast(TOSTRING(IME_ROM_VERSION_STRING)).substr(2); + for(uint8_t i = 0; i < 3; i++) + iMeVersion.insert(i * 2 + 2 + i, "."); + + // Display firmware installation dialog + wxMessageDialog *dial = new wxMessageDialog(NULL, static_cast(incompatible ? "Firmware is incompatible" : "Newer firmware available") + ". Update to " + (printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD ? "M3D V" TOSTRING(M3D_ROM_VERSION_STRING) : "iMe V" + iMeVersion) + "?", "M33 Manager", wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION); + + // Check if installing firmware + if(dial->ShowModal() == wxID_YES) { + + // Set fixing invalid values + fixingInvalidValues = true; + + // Check if installing M3D firmware + if(printer.getFirmwareType() == M3D || printer.getFirmwareType() == M3D_MOD) { + + // Install M3D firmware + wxCommandEvent event(wxEVT_BUTTON, installM3dFirmwareButton->GetId()); + installM3dFirmwareButton->GetEventHandler()->ProcessEvent(event); + } + + // Otherwise + else { + + // Install iMe firmware + wxCommandEvent event(wxEVT_BUTTON, installImeFirmwareButton->GetId()); + installImeFirmwareButton->GetEventHandler()->ProcessEvent(event); + } + + // Lock + wxCriticalSectionLocker lock(criticalLock); + + // Append thread start callback to queue + threadStartCallbackQueue.push([=]() -> void {}); + + // Append thread task to queue + threadTaskQueue.push([=]() -> ThreadTaskResponse { + + // Return empty response + return {"", 0}; + }); + + // Append thread complete callback to queue + threadCompleteCallbackQueue.push([=](ThreadTaskResponse response) -> void { + + // Clear fixing invalid values + fixingInvalidValues = false; + + // Check if printer is still connected + if(printer.isConnected()) { + + // Display message + wxMessageBox("Firmware successfully installed", "M33 Manager", wxOK | wxICON_INFORMATION | wxCENTRE); + + // Display calibrate bed position dialog + calibrateBedPositionDialog(); + } + + // Otherwise + else + + // Display message + wxMessageBox("Failed to update firmware", "M33 Manager", wxOK | wxICON_ERROR | wxCENTRE); + }); + } + + // Otherwise check if firmware is incompatible + else if(incompatible) + + // Disconnect printer + printer.disconnect(); // Otherwise else diff --git a/M33 Manager/main.cpp b/M33 Manager/main.cpp index cd472b8..74c561e 100644 --- a/M33 Manager/main.cpp +++ b/M33 Manager/main.cpp @@ -63,7 +63,7 @@ bool installFirmware(const string &firmwareLocation, const string &serialPort); #endif // Create and show window - MyFrame *frame = new MyFrame("M33 Manager", wxDefaultPosition, wxSize(1118, 482), wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)); + MyFrame *frame = new MyFrame("M33 Manager", wxDefaultPosition, wxSize(559, 482), wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX)); frame->Center(); frame->Show(true); diff --git a/M33 Manager/printer.cpp b/M33 Manager/printer.cpp index 6324e97..83c442f 100644 --- a/M33 Manager/printer.cpp +++ b/M33 Manager/printer.cpp @@ -344,7 +344,7 @@ bool Printer::connect(const string &serialPort, bool connectingToNewPrinter) { // Log end of successful connection if(logFunction) - logFunction("Connected to " + getSerialNumber() + " at " + getCurrentSerialPort() + " running " + getFirmwareType() + " firmware V" + getFirmwareRelease()); + logFunction("Connected to " + getSerialNumber() + " at " + getCurrentSerialPort() + " running " + getFirmwareTypeAsString(firmwareType) + " firmware V" + getFirmwareRelease()); // Return true return true; @@ -466,7 +466,7 @@ bool Printer::connect(const string &serialPort, bool connectingToNewPrinter) { // Log end of successful connection if(logFunction) - logFunction("Connected to " + getSerialNumber() + " at " + getCurrentSerialPort() + " running " + getFirmwareType() + " firmware V" + getFirmwareRelease()); + logFunction("Connected to " + getSerialNumber() + " at " + getCurrentSerialPort() + " running " + getFirmwareTypeAsString(firmwareType) + " firmware V" + getFirmwareRelease()); // Return true return true; @@ -1809,7 +1809,7 @@ bool Printer::installFirmware(const string &file) { // Log printer details if(logFunction) - logFunction("Printer is running " + getFirmwareType() + " firmware V" + getFirmwareRelease()); + logFunction("Printer is running " + getFirmwareTypeAsString(firmwareType) + " firmware V" + getFirmwareRelease()); // Return true return true; @@ -2779,10 +2779,10 @@ string Printer::getSerialNumber() { return serialNumber.substr(0, 2) + '-' + serialNumber.substr(2, 2) + '-' + serialNumber.substr(4, 2) + '-' + serialNumber.substr(6, 2) + '-' + serialNumber.substr(8, 2) + '-' + serialNumber.substr(10, 3) + '-' + serialNumber.substr(13, 13); } -string Printer::getFirmwareType() { +firmwareTypes Printer::getFirmwareType() { - // Return firmware type as string - return getFirmwareTypeAsString(firmwareType); + // Return firmware type + return firmwareType; } string Printer::getFirmwareRelease() { @@ -2791,6 +2791,12 @@ string Printer::getFirmwareRelease() { return getFirmwareReleaseFromFirmwareVersion(firmwareVersion); } +uint32_t Printer::getFirmwareVersion() { + + // Return firmware version + return firmwareVersion; +} + void Printer::setLogFunction(function function) { // Set log function diff --git a/M33 Manager/printer.h b/M33 Manager/printer.h index e3ddf01..6069aea 100644 --- a/M33 Manager/printer.h +++ b/M33 Manager/printer.h @@ -174,7 +174,7 @@ class Printer { Name: Get firmware type Purpose: Returns the printer's firmware type */ - string getFirmwareType(); + firmwareTypes getFirmwareType(); /* Name: Get firmware release @@ -182,6 +182,12 @@ class Printer { */ string getFirmwareRelease(); + /* + Name: Get firmware version + Purpose: Returns the printer's firmware version number + */ + uint32_t getFirmwareVersion(); + /* Name: Set log function Purpose: Sets the function used to log the printer's actions diff --git a/Makefile b/Makefile index 07f41dc..6c1ecd8 100755 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Firmware name and version FIRMWARE_NAME = iMe -FIRMWARE_VERSION = 00.00.00.11 -ROM_VERSION_STRING = 1900000011 +FIRMWARE_VERSION = 00.00.00.12 +ROM_VERSION_STRING = 1900000012 # Tool locations ifeq ($(OS), Windows_NT) diff --git a/README.md b/README.md index 24b581f..1b91f12 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Firmware that allows using the Micro 3D printer with third-party 3D printing sof ### Description iMe is firmware for the Micro 3D printer that attempts to fix the printer's biggest problem: limited software compatibility. iMe uses RepRap G-code protocol, so it allows you to use the Micro 3D printer with any 3D printing software that supports that protocol. It also features builtin backlash and bed compensation which makes creating good looking prints with other software possible since the G-code never has to be pre-processed beforehand. -The latest version of iMe is V00.00.00.11 released on July Xth, 2016, and an entire changelog for it can be found [here](https://raw.githubusercontent.com/donovan6000/iMe/master/Changelog). +The latest version of iMe is V00.00.00.12 released on July 20th, 2016, and an entire changelog for it can be found [here](https://raw.githubusercontent.com/donovan6000/iMe/master/Changelog). ### Features * Uses RepRap's G-code protocol diff --git a/iMe 1900000011.hex b/iMe 1900000012.hex similarity index 99% rename from iMe 1900000011.hex rename to iMe 1900000012.hex index 2249df0..b7ce28c 100755 Binary files a/iMe 1900000011.hex and b/iMe 1900000012.hex differ