🧑💻 Fix D5 warning
This commit is contained in:
parent
fb5a595b34
commit
19bcb77f87
|
@ -156,20 +156,21 @@ void GcodeSuite::D(const int16_t dcode) {
|
|||
} break;
|
||||
|
||||
case 5: { // D5 Read / Write onboard Flash
|
||||
#define FLASH_SIZE 1024
|
||||
// This will overwrite program and data, so don't use it.
|
||||
#define ONBOARD_FLASH_SIZE 1024 // 0x400
|
||||
uint8_t *pointer = parser.hex_adr_val('A');
|
||||
uint16_t len = parser.ushortval('C', 1);
|
||||
uintptr_t addr = (uintptr_t)pointer;
|
||||
NOMORE(addr, size_t(FLASH_SIZE - 1));
|
||||
NOMORE(len, FLASH_SIZE - addr);
|
||||
NOMORE(addr, size_t(ONBOARD_FLASH_SIZE - 1));
|
||||
NOMORE(len, ONBOARD_FLASH_SIZE - addr);
|
||||
if (parser.seenval('X')) {
|
||||
// TODO: Write the hex bytes after the X
|
||||
//while (len--) {}
|
||||
}
|
||||
else {
|
||||
//while (len--) {
|
||||
//// TODO: Read bytes from EEPROM
|
||||
// print_hex_byte(eeprom_read_byte(adr++));
|
||||
//// TODO: Read bytes from FLASH
|
||||
// print_hex_byte(flash_read_byte(adr++));
|
||||
//}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue