11static void Flash_exec(
Shell *, uint8_t *);
20__attribute__((section(
".shell_flash"), unused))
34static void Flash_exec(
Shell *shell, uint8_t *flags) {
35 Flash *flash = DeviceHandle_getHandle(
"Flash").
device;
36 UART *usb = DeviceHandle_getHandle(
"USB").device;
38 if (!strcmp(flags, CMD_FLASH_ERASE)) {
39 usb->print(usb,
"Clearing flash... ");
41 usb->print(usb,
"Done.\n\r");
44 else if (!strcmp(flags, CMD_FLASH_READ_ALL)) {
46 volatile uint8_t pageData[256];
47 for (
long i = 0; i < flash->pageCount; i++) {
48 flash->readPage(flash, i * 0x100, pageData);
49 for (
int j = 0; j < flash->pageSize; j++)
50 usb->send(usb, pageData[j]);
Struct definition for UART interface.
DeviceType device
Enum specifier for device type.