Skip to content

Commit

Permalink
Update - Merge w/Marlin
Browse files Browse the repository at this point in the history
🚸 Move Debug menu down (#26266)
πŸ§‘β€πŸ’» Update .editorconfig settings (#26264)
🌐 Update Italian language (#26208)
⚑️ Faster COMPACT_MARLIN_BOOT_LOGO (rle16) (#26153)
πŸ”₯ Automatic minimum planner junction speed (#26198)
🩹 Fix Input Shaping max_isr_rate with Distinct E factors (#26167)
  • Loading branch information
classicrocker883 committed Oct 28, 2023
1 parent e732e34 commit f3bcea2
Show file tree
Hide file tree
Showing 28 changed files with 185 additions and 77 deletions.
32 changes: 16 additions & 16 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** Aquila UBL Mriscoc ProUI
/** Aquila BLT Mriscoc ProUI
* Marlin 3D Printer Firmware
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
Expand Down Expand Up @@ -2032,8 +2032,8 @@
*/
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR // MRiscoC BLTouch auto level
#define AUTO_BED_LEVELING_UBL
#define AUTO_BED_LEVELING_BILINEAR // MRiscoC BLTouch auto level
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING

/**
Expand Down Expand Up @@ -2093,7 +2093,7 @@
/**
* Enable the G26 Mesh Validation Pattern tool.
*/
//#define G26_MESH_VALIDATION
#define G26_MESH_VALIDATION
#if ENABLED(G26_MESH_VALIDATION)
#define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle.
#define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for G26.
Expand Down Expand Up @@ -2401,16 +2401,16 @@
//#define PREHEAT_1_TEMP_CHAMBER 35
#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255

//#define PREHEAT_2_LABEL "ABS" //PETG
//#define PREHEAT_2_TEMP_HOTEND 240
//#define PREHEAT_2_TEMP_BED 75
#define PREHEAT_2_LABEL "ABS" //PETG
#define PREHEAT_2_TEMP_HOTEND 240
#define PREHEAT_2_TEMP_BED 75
//#define PREHEAT_2_TEMP_CHAMBER 35
//#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

//#define PREHEAT_3_LABEL "Warmup"
//#define PREHEAT_3_TEMP_HOTEND 200
//#define PREHEAT_3_TEMP_BED 50
//#define PREHEAT_3_FAN_SPEED 0
#define PREHEAT_3_LABEL "Warmup"
#define PREHEAT_3_TEMP_HOTEND 200
#define PREHEAT_3_TEMP_BED 50
#define PREHEAT_3_FAN_SPEED 0

//#define PREHEAT_4_LABEL "TPU"
//#define PREHEAT_4_TEMP_HOTEND 230
Expand Down Expand Up @@ -2482,7 +2482,7 @@
*
* Caveats: The ending Z should be the same as starting Z.
*/
//#define NOZZLE_CLEAN_FEATURE
#define NOZZLE_CLEAN_FEATURE

#if ENABLED(NOZZLE_CLEAN_FEATURE)
#define NOZZLE_CLEAN_PATTERN_LINE // Provide 'G12 P0' - a simple linear cleaning pattern
Expand Down Expand Up @@ -3425,7 +3425,7 @@
#define DISABLE_TUNING_GRAPH 0// Temp plot graph - PID/MPC Tuning (1624 bytes of flash)
#define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash)
#define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash)
//#define HAS_LOCKSCREEN 1 // Simple lockscreen as to not accidentally change something (568 bytes of flash)
#define HAS_LOCKSCREEN 1 // Simple lockscreen as to not accidentally change something (568 bytes of flash)
#define HAS_SD_EXTENDER 1 // Enable to support SD card extender cables (48 bytes of flash)
#define USE_GRID_MESHVIEWER 1 // Enable two mesh graph types : one (1728 bytes of flash)
#define HAS_CUSTOM_COLORS 1 // Able to change display colors (2040 bytes of flash)
Expand All @@ -3446,11 +3446,11 @@
//#define JD_TUNE_ITEM // Juntion Deviation item in Tune Menu (only if JD is enabled)
#define ADVK_TUNE_ITEM // Linear Advance item in Tune Menu (only if JD is enabled)
#define SHOW_REAL_POS
//#define CCLOUD_PRINT_SUPPORT// Menu item: enable/disable Creality Cloud Print Support (192 bytes of flash)
#define CCLOUD_PRINT_SUPPORT // Menu item: enable/disable Creality Cloud Print Support (192 bytes of flash)
#define TRAMWIZ_MENU_ITEM // Menu item: enable Tramming Wizard (2304 bytes of flash)
#define MEDIASORT_MENU_ITEM // Menu item: enable/disable file list sorting (104 bytes of flash)
//#define ENC_MENU_ITEM // Menu item: faster/slower encoder rate (272 bytes of flash)
//#define SHOW_SPEED_IND // Menu item: blink speed in mm/s along with speed percentage (296 bytes of flash)
#define SHOW_SPEED_IND // Menu item: blink speed in mm/s along with speed percentage (296 bytes of flash)
//#define NO_BLINK_IND // Disables dashboard icon blink indicator highlighted background

#endif
Expand Down
6 changes: 1 addition & 5 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1264,11 +1264,6 @@
#define XY_FREQUENCY_MIN_PERCENT 5 // (percent) Minimum FR percentage to apply. Set with M201 G<min%>.
#endif

// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
// of the buffer and all stops. This should not be much greater than zero and should only be changed
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s)

//
// Backlash Compensation
// Adds extra movement to axes on direction-changes to account for backlash.
Expand Down Expand Up @@ -4251,6 +4246,7 @@
// row. By default idle() is profiled so this shows how "idle" the processor is.
// See class CodeProfiler.
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row.
//#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed.
#endif

/**
Expand Down
9 changes: 9 additions & 0 deletions Marlin/src/feature/max7219.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,15 @@ void Max7219::idle_tasks() {
}
#endif

#ifdef MAX7219_DEBUG_SLOWDOWN
static uint8_t last_slowdown_count = 0;
const uint8_t slowdown_count = Planner::slowdown_count;
if (slowdown_count != last_slowdown_count) {
mark16(MAX7219_DEBUG_SLOWDOWN, last_slowdown_count, slowdown_count, &row_change_mask);
last_slowdown_count = slowdown_count;
}
#endif

// batch line updates
suspended--;
if (!suspended)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -3480,8 +3480,8 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS."
#endif

#if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
#error "BLOCK_BUFFER_SIZE must be a power of 2."
#if !BLOCK_BUFFER_SIZE
#error "BLOCK_BUFFER_SIZE must be non-zero."
#elif BLOCK_BUFFER_SIZE > 64
#error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel."
#endif
Expand Down
67 changes: 47 additions & 20 deletions Marlin/src/lcd/language/language_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

#define DISPLAY_CHARSET_ISO10646_1

#define MEDIA_TYPE_IT "Media"

namespace LanguageNarrow_it {
using namespace Language_en; // Inherit undefined strings from English

Expand All @@ -52,14 +54,16 @@ namespace LanguageNarrow_it {
LSTR MSG_BACK = _UxGT("Indietro");
LSTR MSG_ERROR = _UxGT("Errore");
LSTR MSG_MEDIA_ABORTING = _UxGT("Annullando...");
LSTR MSG_MEDIA_INSERTED = _UxGT("Media inserito");
LSTR MSG_MEDIA_REMOVED = _UxGT("Media rimosso");
LSTR MSG_MEDIA_WAITING = _UxGT("Aspettando media");
LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Iniz.Media fallita");
LSTR MSG_MEDIA_READ_ERROR = _UxGT("Err.leggendo media");
LSTR MSG_MEDIA_INSERTED = MEDIA_TYPE_IT _UxGT(" inserito");
LSTR MSG_MEDIA_REMOVED = MEDIA_TYPE_IT _UxGT(" rimosso");
LSTR MSG_MEDIA_WAITING = _UxGT("Aspettando ") MEDIA_TYPE_IT;
LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Iniz.") MEDIA_TYPE_IT _UxGT(" fallita");
LSTR MSG_MEDIA_READ_ERROR = _UxGT("Err.leggendo ") MEDIA_TYPE_IT;
LSTR MSG_MEDIA_USB_REMOVED = _UxGT("Dispos.USB rimosso");
LSTR MSG_MEDIA_USB_FAILED = _UxGT("Avvio USB fallito");
LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Overflow subchiamate");
LSTR MSG_MEDIA_SORT = _UxGT("Ordina ") MEDIA_TYPE_IT;
LSTR MSG_MEDIA_UPDATE = _UxGT("Aggiorna ") MEDIA_TYPE_IT;
LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Overflow sottochiamate");
LSTR MSG_LCD_ENDSTOPS = _UxGT("Finecor."); // Max 8 characters
LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa Soft");
LSTR MSG_MAIN_MENU = _UxGT("Menu principale");
Expand Down Expand Up @@ -176,6 +180,7 @@ namespace LanguageNarrow_it {
LSTR MSG_MESH_CENTER = _UxGT("Area centrale");
LSTR MSG_MESH_EDIT_Z = _UxGT("Valore di Z");
LSTR MSG_MESH_CANCEL = _UxGT("Mesh cancellata");
LSTR MSG_MESH_RESET = _UxGT("Resetta mesh");
LSTR MSG_CUSTOM_COMMANDS = _UxGT("Comandi personaliz.");
LSTR MSG_M48_TEST = _UxGT("Test sonda M48");
LSTR MSG_M48_POINT = _UxGT("Punto M48");
Expand Down Expand Up @@ -383,6 +388,7 @@ namespace LanguageNarrow_it {
LSTR MSG_VN_JERK = _UxGT("Max Jerk @");
LSTR MSG_VE_JERK = _UxGT("Max Jerk E");
LSTR MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni");
LSTR MSG_STEP_SMOOTHING = _UxGT("Leviga passo");
LSTR MSG_MAX_SPEED = _UxGT("Vel.massima (mm/s)");
LSTR MSG_VMAX_A = _UxGT("Vel.Massima ") STR_A;
LSTR MSG_VMAX_B = _UxGT("Vel.Massima ") STR_B;
Expand All @@ -406,6 +412,12 @@ namespace LanguageNarrow_it {
LSTR MSG_SHAPING_DISABLE = _UxGT("Disabil. shaping @");
LSTR MSG_SHAPING_FREQ = _UxGT("Frequenza @");
LSTR MSG_SHAPING_ZETA = _UxGT("Smorzamento @");
LSTR MSG_SHAPING_A_FREQ = _UxGT("Frequenza ") STR_A;
LSTR MSG_SHAPING_B_FREQ = _UxGT("Frequenza ") STR_B;
LSTR MSG_SHAPING_A_ZETA = _UxGT("Smorzamento ") STR_A _UxGT(" ");
LSTR MSG_SHAPING_B_ZETA = _UxGT("Smorzamento ") STR_B _UxGT(" ");
LSTR MSG_SHAPING_X_ENABLE = _UxGT("Abilita shaping X");
LSTR MSG_SHAPING_Y_ENABLE = _UxGT("Abilita shaping Y");
LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max");
LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min");
LSTR MSG_STEPS_PER_MM = _UxGT("Passi/mm");
Expand Down Expand Up @@ -448,7 +460,7 @@ namespace LanguageNarrow_it {
LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Err: Versione EEPROM");
LSTR MSG_ERR_EEPROM_CORRUPT = _UxGT("Err: EEPROM corrotta");
LSTR MSG_SETTINGS_STORED = _UxGT("Impostazioni mem.");
LSTR MSG_MEDIA_UPDATE = _UxGT("Aggiorna media");
LSTR MSG_HAS_PREVIEW = _UxGT("Ha anteprima");
LSTR MSG_RESET_PRINTER = _UxGT("Resetta stampante");
LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aggiorna");
LSTR MSG_INFO_SCREEN = _UxGT("Schermata info");
Expand Down Expand Up @@ -495,8 +507,8 @@ namespace LanguageNarrow_it {
LSTR MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto {");
LSTR MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da PowerLoss");
LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Cont.proc.stampa");
LSTR MSG_MEDIA_MENU = _UxGT("Stampa da media");
LSTR MSG_NO_MEDIA = _UxGT("Media non presente");
LSTR MSG_MEDIA_MENU = _UxGT("Stampa da ") MEDIA_TYPE_IT;
LSTR MSG_NO_MEDIA = MEDIA_TYPE_IT _UxGT(" non presente");
LSTR MSG_DWELL = _UxGT("Sospensione...");
LSTR MSG_USERWAIT = _UxGT("Premi tasto..");
LSTR MSG_PRINT_PAUSED = _UxGT("Stampa sospesa");
Expand Down Expand Up @@ -546,10 +558,11 @@ namespace LanguageNarrow_it {
LSTR MSG_FILAMENTUNLOAD = _UxGT("Rimuovi filamento");
LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filam. *");
LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto");
LSTR MSG_ATTACH_MEDIA = _UxGT("Collega media");
LSTR MSG_ATTACH_MEDIA = _UxGT("Collega ") MEDIA_TYPE_IT;
LSTR MSG_ATTACH_SD_MEDIA = _UxGT("Collega scheda SD");
LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Collega penna USB");
LSTR MSG_CHANGE_MEDIA = _UxGT("Cambia media");
LSTR MSG_RELEASE_MEDIA = _UxGT("Rilascia media");
LSTR MSG_CHANGE_MEDIA = _UxGT("Cambia ") MEDIA_TYPE_IT;
LSTR MSG_RELEASE_MEDIA = _UxGT("Rilascia ") MEDIA_TYPE_IT;
LSTR MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto");
LSTR MSG_SKEW_FACTOR = _UxGT("Fattore distorsione");
LSTR MSG_BLTOUCH = _UxGT("BLTouch");
Expand Down Expand Up @@ -640,6 +653,9 @@ namespace LanguageNarrow_it {
LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Controllo fuga: OFF");
LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Controllo fuga: ON");
LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Timeout inatt.ugello");
LSTR MSG_HOTEND_IDLE_DISABLE = _UxGT("Disabilita Timeout");
LSTR MSG_HOTEND_IDLE_NOZZLE_TARGET = _UxGT("Temp.inatt.ugello");
LSTR MSG_HOTEND_IDLE_BED_TARGET = _UxGT("Temp.inatt.letto");
LSTR MSG_FAN_SPEED_FAULT = _UxGT("Err.vel.della ventola");

LSTR MSG_CASE_LIGHT = _UxGT("Luci Case");
Expand Down Expand Up @@ -768,17 +784,18 @@ namespace LanguageNarrow_it {
LSTR MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Spurgo filamento"));
LSTR MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Premi x terminare"));
LSTR MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Ripresa..."));

LSTR MSG_TMC_DRIVERS = _UxGT("Driver TMC");
LSTR MSG_TMC_CURRENT = _UxGT("Correnti driver");
LSTR MSG_TMC_CURRENT = _UxGT("Corrente driver");
LSTR MSG_TMC_ACURRENT = _UxGT("Corrente driver ") STR_A;
LSTR MSG_TMC_BCURRENT = _UxGT("Corrente driver ") STR_B;
LSTR MSG_TMC_CCURRENT = _UxGT("Corrente driver ") STR_C;
LSTR MSG_TMC_ECURRENT = _UxGT("Corrente driver E");
LSTR MSG_TMC_HYBRID_THRS = _UxGT("Soglia modo ibrido");
LSTR MSG_TMC_HOMING_THRS = _UxGT("Sensorless homing");
LSTR MSG_TMC_STEPPING_MODE = _UxGT("Stealthchop");
LSTR MSG_TMC_STEALTH_ENABLED = _UxGT("Stealthchop");

LSTR MSG_TMC_STEPPING_MODE = _UxGT("Modo Stepping");
LSTR MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop abil.");
LSTR MSG_SERVICE_RESET = _UxGT("Resetta");
LSTR MSG_SERVICE_IN = _UxGT(" tra:");

LSTR MSG_BACKLASH = _UxGT("Gioco");
LSTR MSG_BACKLASH_CORRECTION = _UxGT("Correzione");
LSTR MSG_BACKLASH_SMOOTHING = _UxGT("Appianamento");
Expand All @@ -798,6 +815,8 @@ namespace LanguageNarrow_it {
LSTR MSG_FTM_MASS_BASED = _UxGT("Base-Massa");
LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Freq. Base");
LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Freq. Dinam.");
LSTR MSG_FTM_ZETA = _UxGT("Smorzamento");
LSTR MSG_FTM_VTOL = _UxGT("Livello Vib.");

LSTR MSG_LEVEL_X_AXIS = _UxGT("Livello asse X");
LSTR MSG_AUTO_CALIBRATE = _UxGT("Auto Calibra");
Expand Down Expand Up @@ -859,10 +878,18 @@ namespace LanguageNarrow_it {
namespace LanguageWide_it {
using namespace LanguageNarrow_it;
#if LCD_WIDTH >= 20 || HAS_DWIN_E3V2
LSTR MSG_HOST_START_PRINT = _UxGT("Avvio stampa host");
LSTR MSG_PRINTING_OBJECT = _UxGT("Sto stampando l'oggetto");
LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella l'oggetto");
LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancella l'oggetto {");
LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continua il Job di stampa");
LSTR MSG_MEDIA_MENU = _UxGT("Seleziona dal supporto");
LSTR MSG_TURN_OFF = _UxGT("Spegni la stampante");
LSTR MSG_END_LOOPS = _UxGT("Termina i cicli di ripetizione");
LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito.");
LSTR MSG_PLEASE_PREHEAT = _UxGT("Si prega di preriscaldare l'hot end.");
LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera contatori stampa");
LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori stampa");
LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera i contatori di stampa");
LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori di stampa");
LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale");
LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro piΓΉ lungo");
LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso");
Expand Down
13 changes: 6 additions & 7 deletions Marlin/src/lcd/menu/menu_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,6 @@ void menu_configuration() {
START_MENU();
BACK_ITEM(MSG_MAIN_MENU);

//
// Debug Menu when certain options are enabled
//
#if HAS_DEBUG_MENU
SUBMENU(MSG_DEBUG_MENU, menu_debug);
#endif

#if ENABLED(CUSTOM_MENU_CONFIG)
if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) {
#ifdef CUSTOM_MENU_CONFIG_TITLE
Expand Down Expand Up @@ -657,6 +650,12 @@ void menu_configuration() {
EDIT_ITEM(bool, MSG_SOUND, &ui.sound_on, []{ ui.chirp(); });
#endif

// Debug Menu when certain options are enabled
// Note: it is at the end of the list, so a more commonly used items should be placed above
#if HAS_DEBUG_MENU
SUBMENU(MSG_DEBUG_MENU, menu_debug);
#endif

#if ENABLED(EEPROM_SETTINGS)
ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings);
if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings);
Expand Down
25 changes: 25 additions & 0 deletions Marlin/src/lcd/tft/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors)
}

#if ENABLED(COMPACT_MARLIN_BOOT_LOGO)

static struct {
bool has_rle_state = false;
int16_t dstx, dsty, srcx, srcy;
uint32_t rle_offset;
} rle_state;

// RLE16 HIGHCOLOR - 16 bits per pixel
if (color_mode == RLE16) {
uint8_t *bytedata = (uint8_t *)images[image].data;
Expand All @@ -139,8 +146,25 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors)
dsty = y, dstx = x; // Destination line / column index

uint16_t color = 0; // Persist the last fetched color value
if (rle_state.has_rle_state) { // do we have RLE position data?
rle_state.has_rle_state = false; // invalidate stored RLE state
dstx = rle_state.dstx; // restore required states
dsty = rle_state.dsty;
srcx = rle_state.srcx;
srcy = rle_state.srcy;
bytedata = (uint8_t *)images[image].data + rle_state.rle_offset; // Restart decode from here instead of the start of data
}

bool done = false;
while (!done) {
if (dsty >= endLine - 1 || srcy >= image_height - 1) { // Store state?
rle_state.dstx = dstx; // Save required states
rle_state.dsty = dsty;
rle_state.srcx = srcx;
rle_state.srcy = srcy;
rle_state.rle_offset = bytedata - (uint8_t *)images[image].data;; // Keep these for skipping full RLE decode on future iteratons
}

uint8_t count = *bytedata++; // Get the count byte
const bool uniq = bool(count & 0x80); // >= 128 is a distinct run; < 128 is a repeat run
count = (count & 0x7F) + 1; // Actual count is 7-bit plus 1
Expand Down Expand Up @@ -169,6 +193,7 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors)
srcx = 0; dstx = x; // May be shifted within the canvas, but usually not
if (dsty >= endLine || srcy >= image_height) { // Done with the segment or the image?
done = true; // Set a flag to end the loop...
rle_state.has_rle_state = true; // RLE state is stored
break; // ...and break out of while(count--)
}
}
Expand Down
Loading

0 comments on commit f3bcea2

Please sign in to comment.