summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avr/cmd_fat.c1
-rw-r--r--avr/cmd_loadcpm3.c8
-rw-r--r--avr/main.c10
-rw-r--r--avr/print-utils.c6
-rw-r--r--avr/z180-serv.c5
5 files changed, 17 insertions, 13 deletions
diff --git a/avr/cmd_fat.c b/avr/cmd_fat.c
index 60102ed..c1d3770 100644
--- a/avr/cmd_fat.c
+++ b/avr/cmd_fat.c
@@ -131,7 +131,6 @@ command_ret_t do_pwd(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc
buf = (char *) malloc(BUFFER_SIZE);
if (buf == NULL) {
printf_P(PSTR("pwd: Out of Memory!\n"));
- free(buf);
return CMD_RET_FAILURE;
}
diff --git a/avr/cmd_loadcpm3.c b/avr/cmd_loadcpm3.c
index 39e3278..6ccb3f9 100644
--- a/avr/cmd_loadcpm3.c
+++ b/avr/cmd_loadcpm3.c
@@ -71,7 +71,7 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char *
uint32_t banked_base;
char *fname;
FIL File;
- char default_fname[] = CONFIG_CPM3_SYSFILE;
+ char default_fname[strlen_P(PSTR(CONFIG_CPM3_SYSFILE)) + 1];
unsigned int br; /* bytes read */
uint8_t buffer[RS];
int res;
@@ -90,11 +90,13 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char *
common_base = eval_arg(argv[2], NULL);
fname = getenv_str(PSTR(ENV_CPM3_SYSFILE));
+ if (fname == NULL || *fname == '\0') {
+ strcpy_P(default_fname, PSTR(CONFIG_CPM3_SYSFILE));
+ fname = default_fname;
+ }
if (argc > 1) {
fname = argv[1];
}
- if (fname == NULL || *fname == '\0')
- fname = default_fname;
res = f_open(&File, fname, FA_READ );
if (res) {
diff --git a/avr/main.c b/avr/main.c
index 450e2ba..1fba3cb 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -67,15 +67,17 @@ void print_reset_reason(void)
uint8_t r = mcusr & 0x1f;
const FLASH char * const FLASH *p = rreasons;
- printf_P(PSTR("### Reset reason(s): %s"), r ? "" : "none");
+ my_puts_P(PSTR("### Reset reason(s): "));
+ if (r == 0)
+ my_puts_P(PSTR("none"));
for ( ; r; p++, r >>= 1) {
if (r & 1) {
my_puts_P(*p);
if (r & ~1)
- printf_P(PSTR(", "));
+ my_puts_P(PSTR(", "));
}
}
- printf_P(PSTR(".\n"));
+ my_puts_P(PSTR(".\n"));
}
#endif
@@ -223,7 +225,7 @@ const char *bootdelay_process(void)
static
void autoboot_command(const char *s)
{
- debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
+ debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "");
_delay_ms(20);
if (stored_bootdelay != -1 && s && !abortboot(stored_bootdelay)) {
diff --git a/avr/print-utils.c b/avr/print-utils.c
index 83f86a9..b8100a0 100644
--- a/avr/print-utils.c
+++ b/avr/print-utils.c
@@ -42,7 +42,6 @@ int dump_mem(uint32_t address, uint32_t offset, uint32_t len,
int (*readfkt)(uint8_t *, uint32_t, uint8_t), char *title)
{
uint8_t buf[16];
- char *indent = NULL;
uint8_t llen = 16;
uint8_t pre = offset % 16;
offset = offset & ~0x0f;
@@ -51,7 +50,6 @@ int dump_mem(uint32_t address, uint32_t offset, uint32_t len,
if (title && *title) {
printf_P(PSTR("%s\n"),title);
- indent = " ";
}
while (len) {
@@ -60,7 +58,9 @@ int dump_mem(uint32_t address, uint32_t offset, uint32_t len,
if (readfkt(buf, address, llen - pre) != 0)
return -2; /* TODO: Error codes */
- printf_P(PSTR("%s%.5lx:"),indent, offset);
+ if (title)
+ print_blanks(4);
+ printf_P(PSTR("%.5lx:"),offset);
for (i = 0; i < llen; i++) {
if ((i % 8) == 0)
putchar(' ');
diff --git a/avr/z180-serv.c b/avr/z180-serv.c
index d1f52dd..ac57645 100644
--- a/avr/z180-serv.c
+++ b/avr/z180-serv.c
@@ -240,8 +240,9 @@ int drv_list(void)
for (uint8_t i = 0; i < CONFIG_CPM_MAX_DRIVE; i++) {
struct cpm_drive_s * p = &drv_table[i];
if (p->img_name) {
- printf_P(PSTR(" dsk%d: %2s %3s attached to %s\n"), i,
- p->opt&DRV_OPT_RO ? "RO":"RW", p->opt&DRV_OPT_DEBUG ? "DBG":"",
+ printf_P(PSTR(" dsk%d: %2S %3S attached to %s\n"), i,
+ p->opt&DRV_OPT_RO ? PSTR("RO") : PSTR("RW"),
+ p->opt&DRV_OPT_DEBUG ? PSTR("DBG") : PSTR(""),
p->img_name);
}
}