summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/console.h5
-rw-r--r--include/host_command.h6
2 files changed, 10 insertions, 1 deletions
diff --git a/include/console.h b/include/console.h
index 01cf13d6ea..1f7a24f0f3 100644
--- a/include/console.h
+++ b/include/console.h
@@ -142,7 +142,10 @@ void console_has_input(void);
* @param shorthelp String with one-line description of command.
* @param longhelp String with long description of command.
*/
-#ifdef CONFIG_CONSOLE_CMDHELP
+#ifndef HAS_TASK_CONSOLE
+#define DECLARE_CONSOLE_COMMAND(name, routine, argdesc, shorthelp, longhelp) \
+ int (routine)(int argc, char **argv) __attribute__((unused))
+#elif defined(CONFIG_CONSOLE_CMDHELP)
#define DECLARE_CONSOLE_COMMAND(name, routine, argdesc, shorthelp, longhelp) \
static const char __con_cmd_label_##name[] = #name; \
const struct console_command __keep __con_cmd_##name \
diff --git a/include/host_command.h b/include/host_command.h
index c987df561b..c9dcd3ddd8 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -194,10 +194,16 @@ int host_request_expected_size(const struct ec_host_request *r);
void host_packet_receive(struct host_packet *pkt);
/* Register a host command handler */
+#ifdef HAS_TASK_HOSTCMD
#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
const struct host_command __keep __host_cmd_##command \
__attribute__((section(".rodata.hcmds"))) \
= {routine, command, version_mask}
+#else
+#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
+ int (routine)(struct host_cmd_handler_args *args) \
+ __attribute__((unused))
+#endif
/**