Skip to content

Commit

Permalink
Merge pull request #24 from donovan6000/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
donovan6000 authored Jul 20, 2016
2 parents 9668eb8 + 94bc6e1 commit ee5a60d
Show file tree
Hide file tree
Showing 99 changed files with 663 additions and 374 deletions.
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Changelog:

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

* Fixed compatibility with MatterControl
Expand Down
Binary file modified M33 Manager/M33 Manager Linux.zip
Binary file not shown.
Binary file modified M33 Manager/M33 Manager OS X.zip
Binary file not shown.
Binary file modified M33 Manager/M33 Manager Windows.zip
Binary file not shown.
8 changes: 3 additions & 5 deletions M33 Manager/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Target platform options: WINDOWS32, WINDOWS64, OSX32, OSX64, LINUX32, LINUX64
PROGRAM_NAME = M33\ Manager
VERSION = 0.06
VERSION = 0.07
TARGET_PLATFORM = LINUX64
USE_GUI = TRUE
IME_ROM_VERSION_STRING = 1900000010
IME_ROM_VERSION_STRING = 1900000012
M3D_ROM_VERSION_STRING = 2016040401

SRCS = main.cpp printer.cpp gcode.cpp common.cpp
Expand Down Expand Up @@ -91,9 +91,7 @@ ifeq ($(TARGET_PLATFORM), LINUX64)
endif
endif

all: $(EXECUTABLE)

$(EXECUTABLE): $(SRCS)
all:
$(CC) $(CFLAGS) "bin2h.cpp" -o "bin2h"
./bin2h "resources/files/icon.png"
./bin2h "resources/files/refresh.png"
Expand Down
2 changes: 1 addition & 1 deletion M33 Manager/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ vector<uint8_t> Gcode::getBinary() const {

// Set sums
sum1 = (sum1 + request[index]) % 0xFF;
sum2 = (sum1 + sum2) % 0xFF;
sum2 = (sum1 + sum2) % 0xFF;
}

// Append Fletcher 16 checksum checksum to request
Expand Down
98 changes: 94 additions & 4 deletions M33 Manager/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -2006,7 +2006,7 @@ void MyFrame::installDrivers(wxCommandEvent& event) {
fout.close();

// Check if applying udev rule failed
if(system("/etc/init.d/udev restart"))
if(system("udevadm control --reload-rules") || system("udevadm trigger"))

// Return message
return {"Failed to apply udev rule", wxOK | wxICON_ERROR | wxCENTRE};
Expand Down Expand Up @@ -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) {
Expand All @@ -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());
Expand Down Expand Up @@ -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<string>(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<string>(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
Expand Down
6 changes: 3 additions & 3 deletions M33 Manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool installFirmware(const string &firmwareLocation, const string &serialPort);
iMeVersion.insert(i * 2 + 2 + i, ".");

// Display help
cout << "Usage: \"M33 Manager\" -d -f -b -i -3 -m -r firmware.rom serialport" << endl;
cout << "Usage: \"M33 Manager\" -d -f -b -i -3 -r firmware.rom -m serialport" << endl;
#ifndef OSX
cout << "-d | --drivers: Install device drivers" << endl;
#endif
Expand Down Expand Up @@ -239,9 +239,9 @@ bool installFirmware(const string &firmwareLocation, const string &serialPort);
for(uint64_t i = 0; i < _90_micro_3d_local_rulesSize; i++)
fout.put(_90_micro_3d_local_rulesData[i]);
fout.close();

// Check if applying udev rule failed
if(system("/etc/init.d/udev restart")) {
if(system("udevadm control --reload-rules") || system("udevadm trigger")) {

// Display error
cout << "Failed to install drivers" << endl;
Expand Down
Loading

0 comments on commit ee5a60d

Please sign in to comment.