Apply loop shorthand macros (#17159)
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
|
||||
static void createChar_P(const char c, const byte * const ptr) {
|
||||
byte temp[8];
|
||||
for (uint8_t i = 0; i < 8; i++)
|
||||
LOOP_L_N(i, 8)
|
||||
temp[i] = pgm_read_byte(&ptr[i]);
|
||||
lcd.createChar(c, temp);
|
||||
}
|
||||
@@ -414,7 +414,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
|
||||
else {
|
||||
PGM_P p = text;
|
||||
int dly = time / _MAX(slen, 1);
|
||||
for (uint8_t i = 0; i <= slen; i++) {
|
||||
LOOP_LE_N(i, slen) {
|
||||
|
||||
// Print the text at the correct place
|
||||
lcd_put_u8str_max_P(col, line, p, len);
|
||||
|
@@ -564,7 +564,7 @@ void MarlinUI::draw_status_screen() {
|
||||
if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) {
|
||||
// Extruders
|
||||
#if DO_DRAW_HOTENDS
|
||||
for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e)
|
||||
LOOP_L_N(e, MAX_HOTEND_DRAW)
|
||||
_draw_hotend_status((heater_ind_t)e, blink);
|
||||
#endif
|
||||
|
||||
|
@@ -209,7 +209,7 @@ void ST7920_Lite_Status_Screen::clear_ddram() {
|
||||
|
||||
/* This fills the entire graphics buffer with zeros */
|
||||
void ST7920_Lite_Status_Screen::clear_gdram() {
|
||||
for (uint8_t y = 0; y < BUFFER_HEIGHT; y++) {
|
||||
LOOP_L_N(y, BUFFER_HEIGHT) {
|
||||
set_gdram_address(0, y);
|
||||
begin_data();
|
||||
for (uint8_t i = (BUFFER_WIDTH) / 16; i--;) write_word(0);
|
||||
@@ -407,7 +407,7 @@ void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, const b
|
||||
const uint8_t x_word = x >> 1,
|
||||
y_top = degree_symbol_y_top,
|
||||
y_bot = y_top + COUNT(degree_symbol);
|
||||
for (uint8_t i = y_top; i < y_bot; i++) {
|
||||
LOOP_S_L_N(i, y_top, y_bot) {
|
||||
uint8_t byte = pgm_read_byte(p_bytes++);
|
||||
set_gdram_address(x_word, i + y * 16);
|
||||
begin_data();
|
||||
@@ -467,10 +467,10 @@ void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
|
||||
const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent?
|
||||
|
||||
// Draw the progress bar as a bitmap in CGRAM
|
||||
for (uint8_t y = top; y <= bottom; y++) {
|
||||
LOOP_S_LE_N(y, top, bottom) {
|
||||
set_gdram_address(left, y);
|
||||
begin_data();
|
||||
for (uint8_t x = 0; x < width; x++) {
|
||||
LOOP_L_N(x, width) {
|
||||
uint16_t gfx_word = 0x0000;
|
||||
if ((x + 1) * char_pcnt <= value)
|
||||
gfx_word = 0xFFFF; // Draw completely filled bytes
|
||||
|
@@ -87,11 +87,11 @@ void clear_graphics_DRAM(u8g_t *u8g, u8g_dev_t *dev) {
|
||||
u8g_SetAddress(u8g, dev, 0); // cmd mode
|
||||
u8g_WriteByte(u8g, dev, 0x08); //display off, cursor+blink off
|
||||
u8g_WriteByte(u8g, dev, 0x3E); //extended mode + GDRAM active
|
||||
for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; y++) { //clear GDRAM
|
||||
LOOP_L_N(y, (LCD_PIXEL_HEIGHT) / 2) { //clear GDRAM
|
||||
u8g_WriteByte(u8g, dev, 0x80 | y); //set y
|
||||
u8g_WriteByte(u8g, dev, 0x80); //set x = 0
|
||||
u8g_SetAddress(u8g, dev, 1); /* data mode */
|
||||
for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; i++) //2x width clears both segments
|
||||
LOOP_L_N(i, 2 * (LCD_PIXEL_WIDTH) / 8) //2x width clears both segments
|
||||
u8g_WriteByte(u8g, dev, 0);
|
||||
u8g_SetAddress(u8g, dev, 0); /* cmd mode */
|
||||
}
|
||||
|
@@ -670,7 +670,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
|
||||
case U8G_DEV_MSG_PAGE_NEXT:
|
||||
if (++page > (HEIGHT / PAGE_HEIGHT)) return 1;
|
||||
|
||||
for (uint8_t y = 0; y < PAGE_HEIGHT; y++) {
|
||||
LOOP_L_N(y, PAGE_HEIGHT) {
|
||||
uint32_t k = 0;
|
||||
#ifdef LCD_USE_DMA_FSMC
|
||||
buffer = (y & 1) ? bufferB : bufferA;
|
||||
|
@@ -237,7 +237,7 @@ public:
|
||||
if (!var.memadr) return;
|
||||
union { unsigned char tmp[sizeof(T)]; T t; } x;
|
||||
unsigned char *ptr = (unsigned char*)val_ptr;
|
||||
for (uint8_t i = 0; i < sizeof(T); i++) x.tmp[i] = ptr[sizeof(T) - i - 1];
|
||||
LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1];
|
||||
*(T*)var.memadr = x.t;
|
||||
}
|
||||
|
||||
|
@@ -339,11 +339,11 @@
|
||||
alt_fm.stride = 19;
|
||||
alt_fm.width = 38;
|
||||
alt_fm.height = 49;
|
||||
for (uint8_t i = 0; i < 127; i++)
|
||||
LOOP_L_N(i, 127)
|
||||
alt_fm.char_widths[i] = 0;
|
||||
|
||||
// For special characters, copy the character widths from the char tables
|
||||
for (uint8_t i = 0; i < NUM_ELEMENTS(char_recipe); i++) {
|
||||
LOOP_L_N(i, NUM_ELEMENTS(char_recipe)) {
|
||||
uint8_t std_char, alt_char, alt_data;
|
||||
get_char_data(i, std_char, alt_char, alt_data);
|
||||
if (std_char == 0)
|
||||
|
@@ -36,7 +36,7 @@ void MoveAxisScreen::onEntry() {
|
||||
// ourselves. The relative distances are reset to zero whenever this
|
||||
// screen is entered.
|
||||
|
||||
for (uint8_t i = 0; i < ExtUI::extruderCount; i++) {
|
||||
LOOP_L_N(i, ExtUI::extruderCount) {
|
||||
screen_data.MoveAxisScreen.e_rel[i] = 0;
|
||||
}
|
||||
BaseNumericAdjustmentScreen::onEntry();
|
||||
|
@@ -81,7 +81,7 @@ void write_to_lcd_P(PGM_P const message) {
|
||||
char encoded_message[MAX_CURLY_COMMAND];
|
||||
uint8_t message_length = _MIN(strlen_P(message), sizeof(encoded_message));
|
||||
|
||||
for (uint8_t i = 0; i < message_length; i++)
|
||||
LOOP_L_N(i, message_length)
|
||||
encoded_message[i] = pgm_read_byte(&message[i]) | 0x80;
|
||||
|
||||
LCD_SERIAL.Print::write(encoded_message, message_length);
|
||||
@@ -91,7 +91,7 @@ void write_to_lcd(const char * const message) {
|
||||
char encoded_message[MAX_CURLY_COMMAND];
|
||||
const uint8_t message_length = _MIN(strlen(message), sizeof(encoded_message));
|
||||
|
||||
for (uint8_t i = 0; i < message_length; i++)
|
||||
LOOP_L_N(i, message_length)
|
||||
encoded_message[i] = message[i] | 0x80;
|
||||
|
||||
LCD_SERIAL.Print::write(encoded_message, message_length);
|
||||
|
@@ -140,13 +140,13 @@ void BrickoutGame::game_screen() {
|
||||
|
||||
// Draw bricks
|
||||
if (PAGE_CONTAINS(BRICK_TOP, BRICK_BOT)) {
|
||||
for (uint8_t y = 0; y < BRICK_ROWS; ++y) {
|
||||
LOOP_L_N(y, BRICK_ROWS) {
|
||||
const uint8_t yy = y * BRICK_H + BRICK_TOP;
|
||||
if (PAGE_CONTAINS(yy, yy + BRICK_H - 1)) {
|
||||
for (uint8_t x = 0; x < BRICK_COLS; ++x) {
|
||||
LOOP_L_N(x, BRICK_COLS) {
|
||||
if (TEST(bdat.bricks[y], x)) {
|
||||
const uint8_t xx = x * BRICK_W;
|
||||
for (uint8_t v = 0; v < BRICK_H - 1; ++v)
|
||||
LOOP_L_N(v, BRICK_H - 1)
|
||||
if (PAGE_CONTAINS(yy + v, yy + v))
|
||||
u8g.drawHLine(xx, yy + v, BRICK_W - 1);
|
||||
}
|
||||
|
@@ -170,7 +170,7 @@ inline void update_invader_data() {
|
||||
uint8_t m = idat.bugs[y];
|
||||
if (m) idat.botmost = y + 1;
|
||||
inv_mask |= m;
|
||||
for (uint8_t x = 0; x < INVADER_COLS; ++x)
|
||||
LOOP_L_N(x, INVADER_COLS)
|
||||
if (TEST(m, x)) idat.shooters[sc++] = (y << 4) | x;
|
||||
}
|
||||
idat.leftmost = 0;
|
||||
@@ -371,11 +371,11 @@ void InvadersGame::game_screen() {
|
||||
// Draw invaders
|
||||
if (PAGE_CONTAINS(idat.pos.y, idat.pos.y + idat.botmost * (INVADER_ROW_H) - 2 - 1)) {
|
||||
int8_t yy = idat.pos.y;
|
||||
for (uint8_t y = 0; y < INVADER_ROWS; ++y) {
|
||||
LOOP_L_N(y, INVADER_ROWS) {
|
||||
const uint8_t type = inv_type[y];
|
||||
if (PAGE_CONTAINS(yy, yy + INVADER_H - 1)) {
|
||||
int8_t xx = idat.pos.x;
|
||||
for (uint8_t x = 0; x < INVADER_COLS; ++x) {
|
||||
LOOP_L_N(x, INVADER_COLS) {
|
||||
if (TEST(idat.bugs[y], x))
|
||||
u8g.drawBitmapP(xx, yy, 2, INVADER_H, invader[type][idat.game_blink]);
|
||||
xx += INVADER_COL_W;
|
||||
|
@@ -83,7 +83,7 @@ void MazeGame::game_screen() {
|
||||
if (PAGE_UNDER(HEADER_H)) lcd_put_int(0, HEADER_H - 1, score);
|
||||
|
||||
// Draw the maze
|
||||
// for (uint8_t n = 0; n < head_ind; ++n) {
|
||||
// LOOP_L_N(n, head_ind) {
|
||||
// const pos_t &p = maze_walls[n], &q = maze_walls[n + 1];
|
||||
// if (p.x == q.x) {
|
||||
// const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y));
|
||||
|
@@ -84,14 +84,14 @@ void shorten_tail() {
|
||||
}
|
||||
if (shift) {
|
||||
sdat.head_ind--;
|
||||
for (uint8_t i = 0; i <= sdat.head_ind; ++i)
|
||||
LOOP_LE_N(i, sdat.head_ind)
|
||||
sdat.snake_tail[i] = sdat.snake_tail[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
// The food is on a line
|
||||
inline bool food_on_line() {
|
||||
for (uint8_t n = 0; n < sdat.head_ind; ++n) {
|
||||
LOOP_L_N(n, sdat.head_ind) {
|
||||
pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1];
|
||||
if (p.x == q.x) {
|
||||
if ((sdat.foodx == p.x - 1 || sdat.foodx == p.x) && WITHIN(sdat.foody, _MIN(p.y, q.y), _MAX(p.y, q.y)))
|
||||
@@ -151,7 +151,7 @@ bool snake_overlap() {
|
||||
// VERTICAL head segment?
|
||||
if (h1.x == h2.x) {
|
||||
// Loop from oldest to segment two away from head
|
||||
for (uint8_t n = 0; n < sdat.head_ind - 2; ++n) {
|
||||
LOOP_L_N(n, sdat.head_ind - 2) {
|
||||
// Segment p to q
|
||||
const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1];
|
||||
if (p.x != q.x) {
|
||||
@@ -163,7 +163,7 @@ bool snake_overlap() {
|
||||
}
|
||||
else {
|
||||
// Loop from oldest to segment two away from head
|
||||
for (uint8_t n = 0; n < sdat.head_ind - 2; ++n) {
|
||||
LOOP_L_N(n, sdat.head_ind - 2) {
|
||||
// Segment p to q
|
||||
const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1];
|
||||
if (p.y != q.y) {
|
||||
@@ -240,7 +240,7 @@ void SnakeGame::game_screen() {
|
||||
#if SNAKE_WH < 2
|
||||
|
||||
// At this scale just draw a line
|
||||
for (uint8_t n = 0; n < sdat.head_ind; ++n) {
|
||||
LOOP_L_N(n, sdat.head_ind) {
|
||||
const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1];
|
||||
if (p.x == q.x) {
|
||||
const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y));
|
||||
@@ -256,7 +256,7 @@ void SnakeGame::game_screen() {
|
||||
#elif SNAKE_WH == 2
|
||||
|
||||
// At this scale draw two lines
|
||||
for (uint8_t n = 0; n < sdat.head_ind; ++n) {
|
||||
LOOP_L_N(n, sdat.head_ind) {
|
||||
const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1];
|
||||
if (p.x == q.x) {
|
||||
const int8_t y1 = GAMEY(_MIN(p.y, q.y)), y2 = GAMEY(_MAX(p.y, q.y));
|
||||
@@ -275,7 +275,7 @@ void SnakeGame::game_screen() {
|
||||
#else
|
||||
|
||||
// Draw a series of boxes
|
||||
for (uint8_t n = 0; n < sdat.head_ind; ++n) {
|
||||
LOOP_L_N(n, sdat.head_ind) {
|
||||
const pos_t &p = sdat.snake_tail[n], &q = sdat.snake_tail[n + 1];
|
||||
if (p.x == q.x) {
|
||||
const int8_t y1 = _MIN(p.y, q.y), y2 = _MAX(p.y, q.y);
|
||||
|
@@ -114,7 +114,7 @@ void menu_cancelobject();
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
|
||||
#elif EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_N(float52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999);
|
||||
#endif
|
||||
#endif
|
||||
@@ -125,7 +125,7 @@ void menu_cancelobject();
|
||||
if (parser.volumetric_enabled) {
|
||||
EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
#if EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float43, n, MSG_FILAMENT_DIAM_E, &planner.filament_size[n], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
|
||||
#endif
|
||||
}
|
||||
@@ -142,13 +142,13 @@ void menu_cancelobject();
|
||||
|
||||
EDIT_ITEM_FAST(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
|
||||
#if EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength);
|
||||
#endif
|
||||
|
||||
EDIT_ITEM_FAST(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength);
|
||||
#if EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_FAST_N(float3, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength);
|
||||
#endif
|
||||
#endif
|
||||
@@ -358,7 +358,7 @@ void menu_cancelobject();
|
||||
EDIT_ITEM_FAST(float3, MSG_VMAX_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, max_fr_edit_scaled.e);
|
||||
#endif
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++)
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_FAST_N(float3, n, MSG_VMAX_EN, &planner.settings.max_feedrate_mm_s[E_AXIS_N(n)], 1, max_fr_edit_scaled.e);
|
||||
#endif
|
||||
|
||||
@@ -409,7 +409,7 @@ void menu_cancelobject();
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++)
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{ _reset_e_acceleration_rate(MenuItemBase::itemIndex); });
|
||||
#elif E_STEPPERS
|
||||
EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
|
||||
@@ -484,7 +484,7 @@ void menu_advanced_steps_per_mm() {
|
||||
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++)
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); });
|
||||
#elif E_STEPPERS
|
||||
EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
|
||||
@@ -558,7 +558,7 @@ void menu_advanced_settings() {
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
|
||||
#elif EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < E_STEPPERS; n++)
|
||||
LOOP_L_N(n, E_STEPPERS)
|
||||
EDIT_ITEM_N(float52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -114,7 +114,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
GCODES_ITEM_P(msg, PSTR("M600 B0"));
|
||||
#else
|
||||
PGM_P const msg = GET_TEXT(MSG_FILAMENTCHANGE_E);
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
@@ -138,7 +138,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
GCODES_ITEM_P(msg_load, PSTR("M701"));
|
||||
#else
|
||||
PGM_P const msg_load = GET_TEXT(MSG_FILAMENTLOAD_E);
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg_load, []{ _menu_temp_filament_op(PAUSE_MODE_LOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
@@ -162,7 +162,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
#if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS)
|
||||
{
|
||||
bool too_cold = false;
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s)) {
|
||||
too_cold = true; break;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
|
||||
}
|
||||
#endif
|
||||
PGM_P const msg_unload = GET_TEXT(MSG_FILAMENTUNLOAD_E);
|
||||
for (uint8_t s = 0; s < E_STEPPERS; s++) {
|
||||
LOOP_L_N(s, E_STEPPERS) {
|
||||
if (thermalManager.targetTooColdToExtrude(s))
|
||||
SUBMENU_N_P(s, msg_unload, []{ _menu_temp_filament_op(PAUSE_MODE_UNLOAD_FILAMENT, MenuItemBase::itemIndex); });
|
||||
else {
|
||||
|
@@ -181,7 +181,7 @@ void lcd_mixer_mix_edit() {
|
||||
|
||||
#if CHANNEL_MIX_EDITING
|
||||
|
||||
for (uint8_t n = 1; n <= MIXING_STEPPERS; n++)
|
||||
LOOP_S_LE_N(n, 1, MIXING_STEPPERS)
|
||||
EDIT_ITEM_FAST_N(float52, n, MSG_MIX_COMPONENT_N, &mixer.collector[n-1], 0, 10);
|
||||
|
||||
ACTION_ITEM(MSG_CYCLE_MIX, _lcd_mixer_cycle_mix);
|
||||
|
@@ -54,7 +54,7 @@ void _mmu2_load_filament(uint8_t index) {
|
||||
ui.reset_status();
|
||||
}
|
||||
void action_mmu2_load_all() {
|
||||
for (uint8_t i = 0; i < EXTRUDERS; i++)
|
||||
LOOP_L_N(i, EXTRUDERS)
|
||||
_mmu2_load_filament(i);
|
||||
ui.return_to_status();
|
||||
}
|
||||
|
@@ -357,7 +357,7 @@ void menu_move() {
|
||||
#elif E_MANUAL > 1
|
||||
|
||||
// Independent extruders with one E-stepper per hotend
|
||||
for (uint8_t n = 0; n < E_MANUAL; n++) SUBMENU_MOVE_E(n);
|
||||
LOOP_L_N(n, E_MANUAL) SUBMENU_MOVE_E(n);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -111,7 +111,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
|
||||
#if HAS_HEATED_BED
|
||||
_PREHEAT_ITEMS(1,0);
|
||||
#endif
|
||||
for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(1,n);
|
||||
LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(1,n);
|
||||
ACTION_ITEM(MSG_PREHEAT_1_ALL, []() {
|
||||
#if HAS_HEATED_BED
|
||||
_preheat_bed(0);
|
||||
@@ -139,7 +139,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
|
||||
#if HAS_HEATED_BED
|
||||
_PREHEAT_ITEMS(2,0);
|
||||
#endif
|
||||
for (uint8_t n = 1; n < HOTENDS; n++) PREHEAT_ITEMS(2,n);
|
||||
LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(2,n);
|
||||
ACTION_ITEM(MSG_PREHEAT_2_ALL, []() {
|
||||
#if HAS_HEATED_BED
|
||||
_preheat_bed(1);
|
||||
|
@@ -222,7 +222,7 @@ void menu_tune() {
|
||||
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
|
||||
// Flow En:
|
||||
#if EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_N(int3, n, MSG_FLOW_N, &planner.flow_percentage[n], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
|
||||
#endif
|
||||
#endif
|
||||
@@ -234,7 +234,7 @@ void menu_tune() {
|
||||
#if EXTRUDERS == 1
|
||||
EDIT_ITEM(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999);
|
||||
#elif EXTRUDERS > 1
|
||||
for (uint8_t n = 0; n < EXTRUDERS; n++)
|
||||
LOOP_L_N(n, EXTRUDERS)
|
||||
EDIT_ITEM_N(float52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 999);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1136,7 +1136,7 @@ void MarlinUI::update() {
|
||||
thermalManager.current_ADCKey_raw = HAL_ADC_RANGE;
|
||||
thermalManager.ADCKey_count = 0;
|
||||
if (currentkpADCValue < adc_other_button)
|
||||
for (uint8_t i = 0; i < ADC_KEY_NUM; i++) {
|
||||
LOOP_L_N(i, ADC_KEY_NUM) {
|
||||
const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin),
|
||||
hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax);
|
||||
if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo);
|
||||
|
Reference in New Issue
Block a user