* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "ao.h"
+#include <ao.h>
+#include <ao_storage.h>
uint8_t
-ao_storage_read(uint32_t pos, __xdata void *buf, uint16_t len) __reentrant
+ao_storage_read(ao_pos_t pos, __xdata void *buf, uint16_t len) __reentrant
{
uint16_t this_len;
uint16_t this_off;
}
uint8_t
-ao_storage_write(uint32_t pos, __xdata void *buf, uint16_t len) __reentrant
+ao_storage_write(ao_pos_t pos, __xdata void *buf, uint16_t len) __reentrant
{
uint16_t this_len;
uint16_t this_off;
}
}
-#if 0
+#if HAS_STORAGE_DEBUG
/* not enough space for this today
*/
void
ao_storage_info(void) __reentrant
{
- printf("Storage size: %ld\n", ao_storage_total);
- printf("Storage erase unit: %ld\n", ao_storage_block);
+ ao_storage_setup();
+ printf("Storage size: %ld\n", (long) ao_storage_total);
+ printf("Storage erase unit: %ld\n", (long) ao_storage_block);
ao_storage_device_info();
}
__code struct ao_cmds ao_storage_cmds[] = {
{ ao_storage_info, "f\0Show storage" },
{ ao_storage_dump, "e <block>\0Dump flash" },
-#ifdef HAS_STORAGE_DBG
+#if HAS_STORAGE_DEBUG
{ ao_storage_store, "w <block> <start> <len> <data> ...\0Write data to flash" },
#endif
{ ao_storage_zap, "z <block>\0Erase <block>" },