mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-22 05:14:46 -07:00
35 lines
1.5 KiB
C
35 lines
1.5 KiB
C
#pragma once
|
|
|
|
#include "cli.h"
|
|
#include <flipper_application/flipper_application.h>
|
|
|
|
void cli_commands_init(Cli* cli);
|
|
|
|
#define PLUGIN_APP_ID "cli"
|
|
#define PLUGIN_API_VERSION 1
|
|
|
|
typedef struct {
|
|
char* name;
|
|
CliExecuteCallback execute_callback;
|
|
CliCommandFlag flags;
|
|
size_t stack_depth;
|
|
} CliCommandDescriptor;
|
|
|
|
#define CLI_COMMAND_INTERFACE(name, execute_callback, flags, stack_depth) \
|
|
static const CliCommandDescriptor cli_##name##_desc = { \
|
|
#name, \
|
|
&execute_callback, \
|
|
flags, \
|
|
stack_depth, \
|
|
}; \
|
|
\
|
|
static const FlipperAppPluginDescriptor plugin_descriptor_##name = { \
|
|
.appid = PLUGIN_APP_ID, \
|
|
.ep_api_version = PLUGIN_API_VERSION, \
|
|
.entry_point = &cli_##name##_desc, \
|
|
}; \
|
|
\
|
|
const FlipperAppPluginDescriptor* cli_##name##_ep(void) { \
|
|
return &plugin_descriptor_##name; \
|
|
}
|