* attach channels to devices
*/
-#include "common.h"
-#include <string.h>
-#include <stdbool.h>
+#include "cmd_attach.h"
#include "command.h"
#include "z180-serv.h"
/*
* Misc boot support
*/
-#include "common.h"
+#include "cmd_boot.h"
#include <ctype.h>
#include <util/atomic.h>
-#include "command.h"
#include "cli_readline.h" /* console_buffer[] */
#include "cli.h" /* run_command() */
#include "env.h"
/*
* RTC, Date & Time support: get and set date & time
*/
-#include "common.h"
-#include <string.h>
+#include "cmd_date.h"
#include "time.h"
#include "rtc.h"
-#include "command.h"
/*
*/
#include "cmd_fat.h"
-#include "common.h"
-#include <string.h>
-#include <stdbool.h>
-#include "command.h"
#include "ff.h"
#include "z80-if.h"
#include "eval_arg.h"
* SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
-#include <stdlib.h>
-#include <string.h>
+#include "cmd_gpio.h"
#include <ctype.h>
-#include "command.h"
#include "print-utils.h"
#include "getopt-min.h"
#include "env.h"
* See CP/M 3 System Manual, Appendix D: CPM3.SYS File Format
*/
-#include "common.h"
+#include "cmd_loadcpm3.h"
#include <ctype.h>
-#include <string.h>
-#include <stdbool.h>
-#include "command.h"
#include "env.h"
#include "ff.h"
#include "eval_arg.h"
* SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
-#include <stdlib.h>
+#include "cmd_loadihex.h"
#include <ctype.h>
-#include <stdbool.h>
-#include "command.h"
#include "con-utils.h"
#include "z80-if.h"
#include "debug.h"
* SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
+#include "cmd_misc.h"
#include "eval_arg.h"
#include <stdbool.h>
-#include "command.h"
#include "timer.h"
#include "con-utils.h"
#include "getopt-min.h"
* SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
-#include <string.h>
-#include <stdio.h>
+#include "cmd_run.h"
#include "ff.h"
-#include "config.h"
-#include "command.h"
#include "cli_readline.h" /* console_buffer[] */
#include "cli.h" /* run_command() */
#include "env.h"
* SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
-//#include <stdlib.h>
+#include "cmd_sd.h"
-#include "command.h"
#include "diskio.h"
#include "ff.h"
#include "eval_arg.h"
return result;
}
+#pragma GCC diagnostic ignored "-Wclobbered"
+
command_ret_t cmd_process(uint_fast8_t flag, int argc, char * const argv[],
uint_fast8_t *repeatable)
{
#include "common.h"
#include "command.h"
#include "cmd_mem.h"
+#include "cmd_boot.h"
+#include "cmd_misc.h"
+#include "cmd_date.h"
+#include "cmd_run.h"
+#include "cmd_loadcpm3.h"
+#include "cmd_loadihex.h"
+#include "cmd_gpio.h"
+#include "cmd_sd.h"
+#include "cmd_fat.h"
+#include "cmd_attach.h"
+#include "env.h"
+#include "debug.h"
-extern command_ret_t do_echo(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_sleep(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_env_print(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_env_default(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_env_set(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_env_save(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_loadf(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_bootcf(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_loadcpm3(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_loadihex(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-#if defined(CONFIG_CMD_LOADB)
-extern command_ret_t do_load_serial_bin(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-#endif
-extern command_ret_t do_go(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_restart(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_console(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_dump_mem(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_mem_mm_avr(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_mem_nm_avr(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_eep_cp(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_busreq_pulse(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_date(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_gpio(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_sd(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_fat(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_run(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_source(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_attach(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-extern command_ret_t do_pr_free_avr(cmd_tbl_t *, uint_fast8_t, int, char * const []);
-
-extern cmd_tbl_t cmd_tbl_fat[];
-extern cmd_tbl_t cmd_tbl_sd[];
cmd_tbl_t cmd_tbl[] = {
* SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
-#include <string.h>
-#include <stdlib.h>
-#include <stdbool.h>
+#include "env.h"
#include <avr/eeprom.h>
#include "config.h"
#include "debug.h"
#include "xmalloc.h"
#include "crc.h"
-#include "command.h"
-#include "env.h"
#define ENV_SIZE (CONFIG_ENV_SIZE - sizeof(uint16_t) -1)
*/
#include "eval_arg.h"
-#include "common.h"
-#include <stdlib.h>
+#include "command.h" /* jump_buf */
#include <ctype.h>
#include <setjmp.h>
#include "print-utils.h"
-#include "command.h" /* jump_buf */
static jmp_buf eval_jbuf;
static char ch;
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_ATTACH_H
+#define CMD_ATTACH_H
+
+#include "command.h"
+
+command_ret_t do_attach(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+#endif /* CMD_ATTACH_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_BOOT_H
+#define CMD_BOOT_H
+
+#include "command.h"
+
+command_ret_t do_loadf(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_bootcf(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_busreq_pulse(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_go(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_restart(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_reset(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[]);
+command_ret_t do_console(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+
+
+#endif /* CMD_BOOT_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_DATE_H
+#define CMD_DATE_H
+
+#include "command.h"
+
+command_ret_t do_date(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+#endif /* CMD_DATE_H */
/*
- * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ * (C) Copyright 2014-2018 Leo C. <erbl259-lmu@yahoo.de>
*
* SPDX-License-Identifier: GPL-2.0
*/
#ifndef CMD_FAT_H
#define CMD_FAT_H
+#include "command.h"
+
+extern cmd_tbl_t cmd_tbl_fat[];
+
+command_ret_t do_fat(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
void setup_fatfs(void);
#endif /* CMD_FAT_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_GPIO_H
+#define CMD_GPIO_H
+
+#include "command.h"
+
+command_ret_t do_gpio(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+
+#endif /* CMD_GPIO_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_LOADCPM3_H
+#define CMD_LOADCPM3_H
+
+#include "command.h"
+
+command_ret_t do_loadcpm3(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+#endif /* CMD_LOADCPM3_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_LOADIHEX_H
+#define CMD_LOADIHEX_H
+
+#include "command.h"
+
+command_ret_t do_loadihex(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+#endif /* CMD_LOADIHEX_H */
#define CMD_MEM_H
#include "command.h"
-#include "cmd_mem.h"
extern command_ret_t do_mem_md(cmd_tbl_t *, uint_fast8_t, int, char * const []);
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_MISC_H
+#define CMD_MISC_H
+
+#include "command.h"
+
+command_ret_t do_echo(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[]);
+command_ret_t do_sleep(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[]);
+
+#endif /* CMD_MISC_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_RUN_H
+#define CMD_RUN_H
+
+#include "command.h"
+
+command_ret_t do_source(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_run(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+
+#endif /* CMD_RUN_H */
--- /dev/null
+/*
+ * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef CMD_SD_H
+#define CMD_SD_H
+
+#include "command.h"
+
+extern cmd_tbl_t cmd_tbl_sd[];
+
+command_ret_t do_sd(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+#endif /* CMD_SD_H */
extern int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
char *const argv[]);
-extern command_ret_t do_reset(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[]);
-
/*
* Command Flags:
*/
#include <stdio.h>
#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdlib.h>
#define GCC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
#ifndef DEBUG_H_
#define DEBUG_H_
-#include "common.h"
+#include "command.h"
+
+command_ret_t do_dump_mem(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_mem_mm_avr(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_mem_nm_avr(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_eep_cp(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_pr_free_avr(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+
+void printfreelist(const char * title);
+
#ifdef DEBUG
#define _DEBUG 1
#endif
#endif /* 0 */
-
-void printfreelist(const char * title);
-
-
#endif /* DEBUG_H_ */
#ifndef ENV_H
#define ENV_H
-#include <stdbool.h>
+#include "command.h"
-int env_init(void);
+command_ret_t do_env_print(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_env_default(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_env_set(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+command_ret_t do_env_save(cmd_tbl_t *, uint_fast8_t, int, char * const []);
+int env_init(void);
char *getenv_str(const MEMX char *name);
unsigned long getenv_ulong(const MEMX char *name, int base, unsigned long default_val);
bool getenv_yesno(const MEMX char *name);