Support for CurWa CW1S firmware updater.

This commit is contained in:
bubnikv 2021-06-30 15:19:47 +02:00 committed by Vojtech Bubnik
parent e199dd5b20
commit 4fa651456d
3 changed files with 11 additions and 4 deletions

View file

@ -65,6 +65,8 @@ enum {
USB_PID_MMU_APP = 4,
USB_PID_CW1_BOOT = 7,
USB_PID_CW1_APP = 8,
USB_PID_CW1S_BOOT = 14,
USB_PID_CW1S_APP = 15,
};
// This enum discriminates the kind of information in EVT_AVRDUDE,
@ -308,7 +310,7 @@ void FirmwareDialog::priv::update_flash_enabled()
void FirmwareDialog::priv::load_hex_file(const wxString &path)
{
hex_file = HexFile(path.wx_str());
const bool autodetect = hex_file.device == HexFile::DEV_MM_CONTROL || hex_file.device == HexFile::DEV_CW1;
const bool autodetect = hex_file.device == HexFile::DEV_MM_CONTROL || hex_file.device == HexFile::DEV_CW1 || hex_file.device == HexFile::DEV_CW1S;
set_autodetect(autodetect);
}
@ -636,6 +638,10 @@ void FirmwareDialog::priv::perform_upload()
this->prepare_avr109(Avr109Pid(USB_PID_CW1_BOOT, USB_PID_CW1_APP));
break;
case HexFile::DEV_CW1S:
this->prepare_avr109(Avr109Pid(USB_PID_CW1S_BOOT, USB_PID_CW1S_APP));
break;
default:
this->prepare_mk2();
break;
@ -767,11 +773,10 @@ const char* FirmwareDialog::priv::avr109_dev_name(Avr109Pid usb_pid) {
switch (usb_pid.boot) {
case USB_PID_MMU_BOOT:
return "Original Prusa MMU 2.0 Control";
break;
case USB_PID_CW1_BOOT:
return "Original Prusa CW1";
break;
case USB_PID_CW1S_BOOT:
return "Original Prusa CW1S";
default: throw Slic3r::RuntimeError((boost::format("Invalid avr109 device USB PID: %1%") % usb_pid.boot).str());
}
}

View file

@ -19,6 +19,7 @@ static HexFile::DeviceKind parse_device_kind(const std::string &str)
else if (str == "mk3") { return HexFile::DEV_MK3; }
else if (str == "mm-control") { return HexFile::DEV_MM_CONTROL; }
else if (str == "cw1") { return HexFile::DEV_CW1; }
else if (str == "cw1s") { return HexFile::DEV_CW1S; }
else { return HexFile::DEV_GENERIC; }
}

View file

@ -17,6 +17,7 @@ struct HexFile
DEV_MK3,
DEV_MM_CONTROL,
DEV_CW1,
DEV_CW1S,
};
boost::filesystem::path path;