File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -156,12 +156,16 @@ void GcodeSuite::D(const int16_t dcode) {
156156 } break ;
157157
158158 case 5 : { // D5 Read / Write onboard Flash
159- #define FLASH_SIZE 1024
159+ #ifdef MARLIN_EEPROM_SIZE
160+ #define ONBOARD_FLASH_SIZE MARLIN_EEPROM_SIZE
161+ #else
162+ #define ONBOARD_FLASH_SIZE 1024 // 0x400
163+ #endif
160164 uint8_t *pointer = parser.hex_adr_val (' A' );
161165 uint16_t len = parser.ushortval (' C' , 1 );
162166 uintptr_t addr = (uintptr_t )pointer;
163- NOMORE (addr, size_t (FLASH_SIZE - 1 ));
164- NOMORE (len, FLASH_SIZE - addr);
167+ NOMORE (addr, size_t (ONBOARD_FLASH_SIZE - 1 ));
168+ NOMORE (len, ONBOARD_FLASH_SIZE - addr);
165169 if (parser.seenval (' X' )) {
166170 // TODO: Write the hex bytes after the X
167171 // while (len--) {}
You can’t perform that action at this time.
0 commit comments