]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/print-utils.c
Merge branch 'master' into cmdline_edit
[z180-stamp.git] / avr / print-utils.c
index 050140ff9215247d9d688d18c92e0758e494d2b7..9ce3e5044f9547e71ef131fe2bf8ad9cbe5f7733 100644 (file)
@@ -1,4 +1,11 @@
+/*
+ * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
 #include "common.h"
+#include <stdint.h>
 #include <stdio.h>
 #include <ctype.h>
 #include "con-utils.h"
@@ -22,6 +29,12 @@ void ram_read_buf(uint8_t *buf, uint32_t addr, uint8_t count)
                        *buf++ = *(uint8_t *) (size_t) addr++;
 }
 
+void flash_read_buf(uint8_t *buf, uint32_t addr, uint8_t count)
+{
+               while (count--)
+                       *buf++ = *(const __memx uint8_t *) (__uint24) addr++;
+}
+
 int dump_mem(uint32_t address, uint32_t offset, uint32_t len,
                void (*readfkt)(uint8_t *, uint32_t, uint8_t), char *title)
 {
@@ -75,7 +88,7 @@ void dump_eep(uint32_t addr, unsigned int len, char *title)
        dump_mem(addr, addr, len, eeprom_read_buf, title);
 }
 
-void dump_ram(uint32_t addr, uint32_t offset, unsigned int len, char *title)
+void dump_ram(uint8_t *addr, size_t offset, unsigned int len, char *title)
 {
-       dump_mem(addr, offset, len, ram_read_buf, title);
+       dump_mem((uint32_t) (size_t) addr, offset, len, ram_read_buf, title);
 }