diff options
author | Leo C | 2018-07-21 13:27:15 +0200 |
---|---|---|
committer | Leo C | 2018-07-21 13:27:15 +0200 |
commit | 7eecbdacec66226ebc3959411883aeaebcf9791d (patch) | |
tree | 1e4f850854c5f4f73410a6e85ecc761544ec5c8a /include | |
parent | 5caa8c2b8906f17ca97aad2be3d746c3b5fef8f3 (diff) | |
download | z180-stamp-7eecbdacec66226ebc3959411883aeaebcf9791d.zip |
Remove extern declarations from command_tbl.c, create .h files for that.
# Conflicts:
# avr/env.c
Diffstat (limited to 'include')
-rw-r--r-- | include/cmd_attach.h | 14 | ||||
-rw-r--r-- | include/cmd_boot.h | 22 | ||||
-rw-r--r-- | include/cmd_date.h | 14 | ||||
-rw-r--r-- | include/cmd_fat.h | 8 | ||||
-rw-r--r-- | include/cmd_gpio.h | 15 | ||||
-rw-r--r-- | include/cmd_loadcpm3.h | 14 | ||||
-rw-r--r-- | include/cmd_loadihex.h | 14 | ||||
-rw-r--r-- | include/cmd_mem.h | 1 | ||||
-rw-r--r-- | include/cmd_misc.h | 15 | ||||
-rw-r--r-- | include/cmd_run.h | 16 | ||||
-rw-r--r-- | include/cmd_sd.h | 16 | ||||
-rw-r--r-- | include/command.h | 2 | ||||
-rw-r--r-- | include/common.h | 3 | ||||
-rw-r--r-- | include/debug.h | 15 | ||||
-rw-r--r-- | include/env.h | 8 |
15 files changed, 166 insertions, 11 deletions
diff --git a/include/cmd_attach.h b/include/cmd_attach.h new file mode 100644 index 0000000..2bd7363 --- /dev/null +++ b/include/cmd_attach.h @@ -0,0 +1,14 @@ +/* + * (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 */ diff --git a/include/cmd_boot.h b/include/cmd_boot.h new file mode 100644 index 0000000..015a215 --- /dev/null +++ b/include/cmd_boot.h @@ -0,0 +1,22 @@ +/* + * (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 */ diff --git a/include/cmd_date.h b/include/cmd_date.h new file mode 100644 index 0000000..cd98f2a --- /dev/null +++ b/include/cmd_date.h @@ -0,0 +1,14 @@ +/* + * (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 */ diff --git a/include/cmd_fat.h b/include/cmd_fat.h index 66be559..ed96a52 100644 --- a/include/cmd_fat.h +++ b/include/cmd_fat.h @@ -1,5 +1,5 @@ /* - * (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 */ @@ -7,6 +7,12 @@ #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 */ diff --git a/include/cmd_gpio.h b/include/cmd_gpio.h new file mode 100644 index 0000000..d2f211d --- /dev/null +++ b/include/cmd_gpio.h @@ -0,0 +1,15 @@ +/* + * (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 */ diff --git a/include/cmd_loadcpm3.h b/include/cmd_loadcpm3.h new file mode 100644 index 0000000..5ef2a9d --- /dev/null +++ b/include/cmd_loadcpm3.h @@ -0,0 +1,14 @@ +/* + * (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 */ diff --git a/include/cmd_loadihex.h b/include/cmd_loadihex.h new file mode 100644 index 0000000..7ca53cf --- /dev/null +++ b/include/cmd_loadihex.h @@ -0,0 +1,14 @@ +/* + * (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 */ diff --git a/include/cmd_mem.h b/include/cmd_mem.h index 625ab8d..b019d27 100644 --- a/include/cmd_mem.h +++ b/include/cmd_mem.h @@ -8,7 +8,6 @@ #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 []); diff --git a/include/cmd_misc.h b/include/cmd_misc.h new file mode 100644 index 0000000..f0f56a7 --- /dev/null +++ b/include/cmd_misc.h @@ -0,0 +1,15 @@ +/* + * (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 */ diff --git a/include/cmd_run.h b/include/cmd_run.h new file mode 100644 index 0000000..4691a55 --- /dev/null +++ b/include/cmd_run.h @@ -0,0 +1,16 @@ +/* + * (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 */ diff --git a/include/cmd_sd.h b/include/cmd_sd.h new file mode 100644 index 0000000..0a5f5e5 --- /dev/null +++ b/include/cmd_sd.h @@ -0,0 +1,16 @@ +/* + * (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 */ diff --git a/include/command.h b/include/command.h index 2ea7505..e44512e 100644 --- a/include/command.h +++ b/include/command.h @@ -124,8 +124,6 @@ static inline int bootm_maybe_autostart(cmd_tbl_t *cmdtp UNUSED, const char *cmd 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: */ diff --git a/include/common.h b/include/common.h index 1064bf3..eb38853 100644 --- a/include/common.h +++ b/include/common.h @@ -9,6 +9,9 @@ #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__) diff --git a/include/debug.h b/include/debug.h index 0ee0129..0d60177 100644 --- a/include/debug.h +++ b/include/debug.h @@ -11,7 +11,16 @@ #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 @@ -43,8 +52,4 @@ #endif #endif /* 0 */ - -void printfreelist(const char * title); - - #endif /* DEBUG_H_ */ diff --git a/include/env.h b/include/env.h index bc44413..1dbe30f 100644 --- a/include/env.h +++ b/include/env.h @@ -7,10 +7,14 @@ #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); |