mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 15:00:46 +00:00
[FL-1221] Hardware info CLI command #481
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
1242327e14
commit
6d93f04f13
1 changed files with 15 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <api-hal-gpio.h>
|
||||
#include <rtc.h>
|
||||
#include <task-control-block.h>
|
||||
#include <time.h>
|
||||
|
||||
void cli_command_help(Cli* cli, string_t args, void* context) {
|
||||
(void)args;
|
||||
|
@ -90,6 +91,19 @@ void cli_command_log(Cli* cli, string_t args, void* context) {
|
|||
furi_stdglue_set_global_stdout_callback(NULL);
|
||||
}
|
||||
|
||||
void cli_command_hw_info(Cli* cli, string_t args, void* context) {
|
||||
printf(
|
||||
"%-20s %d.F%dB%dC%d\r\n",
|
||||
"HW version:",
|
||||
api_hal_version_get_hw_version(),
|
||||
api_hal_version_get_hw_target(),
|
||||
api_hal_version_get_hw_body(),
|
||||
api_hal_version_get_hw_connect());
|
||||
time_t time = api_hal_version_get_hw_timestamp();
|
||||
printf("%-20s %s\r", "Production date:", ctime(&time));
|
||||
printf("%-20s %s", "Name:", api_hal_version_get_name_ptr());
|
||||
}
|
||||
|
||||
void cli_command_vibro(Cli* cli, string_t args, void* context) {
|
||||
if(!string_cmp(args, "0")) {
|
||||
api_hal_vibro_on(false);
|
||||
|
@ -227,6 +241,7 @@ void cli_commands_init(Cli* cli) {
|
|||
cli_add_command(cli, "uid", cli_command_uuid, NULL);
|
||||
cli_add_command(cli, "date", cli_command_date, NULL);
|
||||
cli_add_command(cli, "log", cli_command_log, NULL);
|
||||
cli_add_command(cli, "hw_info", cli_command_hw_info, NULL);
|
||||
cli_add_command(cli, "vibro", cli_command_vibro, NULL);
|
||||
cli_add_command(cli, "led", cli_command_led, NULL);
|
||||
cli_add_command(cli, "gpio_set", cli_command_gpio_set, NULL);
|
||||
|
|
Loading…
Reference in a new issue