support RRF firmware(experiment)

This commit is contained in:
SoftFever 2022-11-29 23:06:37 +08:00
parent 4a20f7c22a
commit 264b0ee891
6 changed files with 48 additions and 30 deletions

View file

@ -911,12 +911,17 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
m_result.filament_vitrification_temperature[i] = static_cast<float>(config.temperature_vitrification.get_at(i));
}
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) {
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) {
m_time_processor.machine_limits = reinterpret_cast<const MachineEnvelopeConfig&>(config);
if (m_flavor == gcfMarlinLegacy) {
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding;
}
if (m_flavor == gcfRepRapFirmware) {
// RRF does not support setting min feedrates. Set them to zero.
m_time_processor.machine_limits.machine_min_travel_rate.values.assign(m_time_processor.machine_limits.machine_min_travel_rate.size(), 0.);
m_time_processor.machine_limits.machine_min_extruding_rate.values.assign(m_time_processor.machine_limits.machine_min_extruding_rate.size(), 0.);
}
}
// Filament load / unload times are not specific to a firmware flavor. Let anybody use it if they find it useful.

View file

@ -99,8 +99,13 @@ public:
}
WipeTowerWriter& disable_linear_advance() {
m_gcode += (m_gcode_flavor == gcfKlipper ? (std::string("SET_PRESSURE_ADVANCE ADVANCE=0\n"))
: std::string("M900 K0\n"));
if(m_gcode_flavor == gcfKlipper)
m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n";
else if(m_gcode_flavor == gcfRepRapFirmware)
m_gcode += std::string("M572 D") + std::to_string(m_current_tool) + " S0\n";
else
m_gcode += "M900 K0\n";
return *this;
}