mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-16 18:07:13 +03:00
68a3f6b4b7
* Add F5 target, lp5562 driver and api-hal-light. Update api-usage, switch to F5 by default. * API HAL: add i2c and hardware version api. Dolphin: show hardware version. * OTP version generator and flashing utility. * Assets script: fix code formatting * Backport F5 changes to F4 * F4: disable insomnia, prevent damage to BLE RX path * F5 HAL API Light: remove magic delay to fix magic BLE * Dolphin: HW target validation on start * invert RSSI indication in sub-1 * API HAL: rename board to body in version api * Gpio tester: detach and release viewport on exit Co-authored-by: aanper <mail@s3f.ru>
44 lines
898 B
C
44 lines
898 B
C
#pragma once
|
|
|
|
#include "cli.h"
|
|
|
|
#include <furi.h>
|
|
#include <api-hal.h>
|
|
|
|
#include <m-dict.h>
|
|
|
|
#define CLI_LINE_SIZE_MAX
|
|
|
|
typedef struct {
|
|
CliCallback callback;
|
|
void* context;
|
|
} CliCommand;
|
|
|
|
DICT_DEF2(CliCommandDict, string_t, STRING_OPLIST, CliCommand, M_POD_OPLIST)
|
|
|
|
typedef enum {
|
|
CliSymbolAsciiSOH = 0x01,
|
|
CliSymbolAsciiEOT = 0x04,
|
|
CliSymbolAsciiBell = 0x07,
|
|
CliSymbolAsciiBackspace = 0x08,
|
|
CliSymbolAsciiTab = 0x09,
|
|
CliSymbolAsciiCR = 0x0D,
|
|
CliSymbolAsciiEsc = 0x1B,
|
|
CliSymbolAsciiUS = 0x1F,
|
|
CliSymbolAsciiSpace = 0x20,
|
|
CliSymbolAsciiDel = 0x7F,
|
|
} CliSymbols;
|
|
|
|
struct Cli {
|
|
CliCommandDict_t commands;
|
|
osMutexId_t mutex;
|
|
string_t line;
|
|
};
|
|
|
|
Cli* cli_alloc();
|
|
void cli_free(Cli* cli);
|
|
void cli_reset_state(Cli* cli);
|
|
void cli_print_version();
|
|
void cli_putc(char c);
|
|
void cli_stdout_callback(void* _cookie, const char* data, size_t size);
|