2 * Copyright © 2018 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
17 #include <ao_flash_readout.h>
19 #ifndef AO_FLASH_READOUT_BASE
20 #define AO_FLASH_READOUT_BASE AO_BOOT_LOADER_BASE
21 #define AO_FLASH_READOUT_BOUND AO_BOOT_APPLICATION_BOUND
25 ao_flash_readout(void)
27 uint8_t *base = (uint8_t *) AO_FLASH_READOUT_BASE;
28 uint8_t *bound = (uint8_t *) AO_FLASH_READOUT_BOUND;
32 ao_arch_block_interrupts();
33 while (!ao_usb_running) {
35 ao_sleep(&ao_usb_running);
37 ao_arch_release_interrupts();
38 ao_flash_readout_putchar(*p++);
44 static struct ao_task ao_flash_readout_task;
47 ao_flash_readout_init(void)
49 ao_add_task(&ao_flash_readout_task, ao_flash_readout, "flash_readout");