File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -156,20 +156,21 @@ void GcodeSuite::D(const int16_t dcode) {
156
156
} break ;
157
157
158
158
case 5 : { // D5 Read / Write onboard Flash
159
- #define FLASH_SIZE 1024
159
+ // This will overwrite program and data, so don't use it.
160
+ #define ONBOARD_FLASH_SIZE 1024 // 0x400
160
161
uint8_t *pointer = parser.hex_adr_val (' A' );
161
162
uint16_t len = parser.ushortval (' C' , 1 );
162
163
uintptr_t addr = (uintptr_t )pointer;
163
- NOMORE (addr, size_t (FLASH_SIZE - 1 ));
164
- NOMORE (len, FLASH_SIZE - addr);
164
+ NOMORE (addr, size_t (ONBOARD_FLASH_SIZE - 1 ));
165
+ NOMORE (len, ONBOARD_FLASH_SIZE - addr);
165
166
if (parser.seenval (' X' )) {
166
167
// TODO: Write the hex bytes after the X
167
168
// while (len--) {}
168
169
}
169
170
else {
170
171
// while (len--) {
171
- // // TODO: Read bytes from EEPROM
172
- // print_hex_byte(eeprom_read_byte (adr++));
172
+ // // TODO: Read bytes from FLASH
173
+ // print_hex_byte(flash_read_byte (adr++));
173
174
// }
174
175
SERIAL_EOL ();
175
176
}
You canβt perform that action at this time.
0 commit comments