BigTreeTech GTR V1.0 / Support 8 extruders, heaters, temp sensors, fans (#16595)
This commit is contained in:
committed by
Scott Lahteine
parent
0d166f9c7d
commit
248b7dfa59
@@ -147,33 +147,72 @@ void menu_tune() {
|
||||
// Fan Speed:
|
||||
//
|
||||
#if FAN_COUNT > 0
|
||||
|
||||
auto on_fan_update = []{
|
||||
thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8);
|
||||
};
|
||||
|
||||
#if HAS_FAN1 || HAS_FAN2 || HAS_FAN3 || HAS_FAN4 || HAS_FAN5 || HAS_FAN6 || HAS_FAN7
|
||||
auto fan_edit_items = [&](const uint8_t f) {
|
||||
editable.uint8 = thermalManager.fan_speed[f];
|
||||
EDIT_ITEM_FAST_N(percent, f, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, on_fan_update);
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST_N(percent, f, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[f], 3, 255);
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
#define SNFAN(N) (ENABLED(SINGLENOZZLE) && !HAS_FAN##N && EXTRUDERS > N)
|
||||
#if SNFAN(1) || SNFAN(2) || SNFAN(3) || SNFAN(4) || SNFAN(5) || SNFAN(6) || SNFAN(7)
|
||||
auto singlenozzle_item = [&](const uint8_t f) {
|
||||
editable.uint8 = thermalManager.fan_speed[f];
|
||||
EDIT_ITEM_FAST_N(percent, f, MSG_STORED_FAN_N, &editable.uint8, 0, 255, on_fan_update);
|
||||
};
|
||||
#endif
|
||||
|
||||
#if HAS_FAN0
|
||||
editable.uint8 = thermalManager.fan_speed[0];
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); });
|
||||
EDIT_ITEM_FAST_N(percent, 0, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, on_fan_update);
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
EDIT_ITEM_FAST_N(percent, 0, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
editable.uint8 = thermalManager.fan_speed[1];
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255);
|
||||
#endif
|
||||
#elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1
|
||||
editable.uint8 = thermalManager.fan_speed[1];
|
||||
EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); });
|
||||
fan_edit_items(1);
|
||||
#elif SNFAN(1)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
editable.uint8 = thermalManager.fan_speed[2];
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255);
|
||||
#endif
|
||||
#elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2
|
||||
editable.uint8 = thermalManager.fan_speed[2];
|
||||
EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); });
|
||||
fan_edit_items(2);
|
||||
#elif SNFAN(2)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
#if HAS_FAN3
|
||||
fan_edit_items(3);
|
||||
#elif SNFAN(3)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
#if HAS_FAN4
|
||||
fan_edit_items(4);
|
||||
#elif SNFAN(4)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
#if HAS_FAN5
|
||||
fan_edit_items(5);
|
||||
#elif SNFAN(5)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
#if HAS_FAN6
|
||||
fan_edit_items(6);
|
||||
#elif SNFAN(6)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
#if HAS_FAN7
|
||||
fan_edit_items(7);
|
||||
#elif SNFAN(7)
|
||||
singlenozzle_item(1);
|
||||
#endif
|
||||
|
||||
#endif // FAN_COUNT > 0
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user