mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-01-24 14:16:44 -07:00
🩹 Use E_TERN_ macros
This commit is contained in:
parent
b28ad90d0e
commit
cc3269a50b
10 changed files with 13 additions and 11 deletions
|
|
@ -188,7 +188,7 @@ void GCodeParser::parse(char *p) {
|
|||
|
||||
// Bail if there's no command code number
|
||||
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) {
|
||||
if (TERN0(HAS_MULTI_EXTRUDER, letter == 'T')) {
|
||||
if (E_TERN0(letter == 'T')) {
|
||||
p[0] = '*'; p[1] = '\0'; string_arg = p; // Convert 'T' alone into 'T*'
|
||||
command_letter = letter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
*/
|
||||
|
||||
void GcodeSuite::M306() {
|
||||
const uint8_t e = TERN0(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder));
|
||||
const uint8_t e = E_TERN0(parser.intval('E', active_extruder));
|
||||
if (e >= (EXTRUDERS)) {
|
||||
SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ").");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1088,7 +1088,7 @@ void DGUSScreenHandlerMKS::filamentUnload(DGUS_VP_Variable &var, void *val_ptr)
|
|||
|
||||
if (filament_data.action == 0) { // Go back to utility screen
|
||||
TERN_(HAS_EXTRUDERS, thermalManager.setTargetHotend(e_temp, 0));
|
||||
TERN_(HAS_MULTI_EXTRUDER, thermalManager.setTargetHotend(e_temp, 1));
|
||||
E_TERN_(thermalManager.setTargetHotend(e_temp, 1));
|
||||
gotoScreen(DGUS_SCREEN_UTILITY);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
|
|||
else {
|
||||
const int16_t new_flow = _MIN(MAX_EXT_SPEED_PERCENT, planner.flow_percentage[0] + uiCfg.stepPrintSpeed);
|
||||
planner.set_flow(0, new_flow);
|
||||
TERN_(HAS_MULTI_EXTRUDER, planner.set_flow(1, new_flow));
|
||||
E_TERN_(planner.set_flow(1, new_flow));
|
||||
}
|
||||
disp_print_speed();
|
||||
break;
|
||||
|
|
@ -66,7 +66,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
|
|||
else {
|
||||
const int16_t new_flow = _MAX(MIN_EXT_SPEED_PERCENT, planner.flow_percentage[0] - uiCfg.stepPrintSpeed);
|
||||
planner.set_flow(0, new_flow);
|
||||
TERN_(HAS_MULTI_EXTRUDER, planner.set_flow(1, new_flow));
|
||||
E_TERN_(planner.set_flow(1, new_flow));
|
||||
}
|
||||
disp_print_speed();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) {
|
|||
if (card.isFileOpen()) {
|
||||
feedrate_percentage = 100;
|
||||
TERN_(HAS_EXTRUDERS, planner.set_flow(0, 100));
|
||||
TERN_(HAS_MULTI_EXTRUDER, planner.set_flow(1, 100));
|
||||
E_TERN_(planner.set_flow(1, 100));
|
||||
card.startOrResumeFilePrinting();
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
||||
once_flag = false;
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ void disp_ext_heart() {
|
|||
|
||||
void disp_temp_type() {
|
||||
if (uiCfg.curTempType == 0) {
|
||||
if (TERN0(HAS_MULTI_EXTRUDER, uiCfg.extruderIndex == 1)) {
|
||||
if (E_TERN0(uiCfg.extruderIndex == 1)) {
|
||||
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin");
|
||||
if (gCfgItems.multiple_language) {
|
||||
lv_label_set_text(labelType, preheat_menu.ext2);
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ char *creat_title_text() {
|
|||
if (card.isFileOpen()) {
|
||||
feedrate_percentage = 100;
|
||||
TERN_(HAS_EXTRUDERS, planner.set_flow(0, 100));
|
||||
TERN_(HAS_MULTI_EXTRUDER, planner.set_flow(1, 100));
|
||||
E_TERN_(planner.set_flow(1, 100));
|
||||
card.startOrResumeFilePrinting();
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
||||
once_flag = false;
|
||||
|
|
|
|||
|
|
@ -1072,7 +1072,7 @@ static void wifi_gcode_exec(uint8_t * const cmd_line) {
|
|||
//saved_feedrate_percentage = feedrate_percentage;
|
||||
feedrate_percentage = 100;
|
||||
TERN_(HAS_EXTRUDERS, planner.set_flow(0, 100));
|
||||
TERN_(HAS_MULTI_EXTRUDER, planner.set_flow(1, 100));
|
||||
E_TERN_(planner.set_flow(1, 100));
|
||||
card.startOrResumeFilePrinting();
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
|
||||
once_flag = false;
|
||||
|
|
|
|||
|
|
@ -390,8 +390,10 @@ bool FTMotion::plan_next_block() {
|
|||
#endif
|
||||
|
||||
// Cache the extruder index / axis for this block
|
||||
#if ANY(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)
|
||||
stepper.stepper_extruder = current_block->extruder;
|
||||
#endif
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
stepper_extruder = current_block->extruder;
|
||||
block_extruder_axis = E_AXIS_N(current_block->extruder);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1593,7 +1593,7 @@ void Stepper::isr() {
|
|||
// FT Motion can be toggled if Standard Motion is also active
|
||||
const bool using_ftMotion = ENABLED(NO_STANDARD_MOTION) || TERN0(FT_MOTION, ftMotion.cfg.active);
|
||||
|
||||
// Storage for the timer value of the next possible ISR, used in this do loop
|
||||
// Storage for the soonest timer value of the next possible ISR, used in this do loop
|
||||
hal_timer_t min_ticks;
|
||||
|
||||
// Loop until all events for this ISR have been issued
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue