Air quality sensor
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
esp-airsensor/main/console/commands/cmd_version.c

53 lines
1.5 KiB

//
// Created by MightyPork on 2018/12/08.
//
#include "console/cmd_common.h"
#include <esp_spi_flash.h>
#include <esp_system.h>
#include "application.h"
#include <console/cmddef.h>
/** 'version' command */
static int cmd_version(console_ctx_t *ctx, cmd_signature_t *reg)
{
static struct {
struct arg_end *end;
} cmd_args;
if (reg) {
cmd_args.end = arg_end(1);
reg->argtable = &cmd_args;
reg->command = "version";
reg->help = "Get version of the chip, SDK, and firmware.";
return 0;
}
esp_chip_info_t info;
esp_chip_info(&info);
console_printf("IDF Version: %s\n", esp_get_idf_version());
console_printf("Firmware: %s\n", APP_VERSION GIT_COUNT);
console_printf(" git: %s\n", GIT_HASH);
console_printf(" builded: %s\n", BUILD_TIMESTAMP);
console_printf("Chip model: %s\n", info.model == CHIP_ESP32 ? "ESP32" : "Unknow");
console_printf(" cores: %d\n", info.cores);
console_printf(" feature: %s%s%s%s%d%s\n",
info.features & CHIP_FEATURE_WIFI_BGN ? "/802.11bgn" : "",
info.features & CHIP_FEATURE_BLE ? "/BLE" : "",
info.features & CHIP_FEATURE_BT ? "/BT" : "",
info.features & CHIP_FEATURE_EMB_FLASH ? "/Embedded-Flash:" : "/External-Flash:",
spi_flash_get_chip_size() / (1024 * 1024), "MB");
console_printf("rev.number: %d\n", info.revision);
return 0;
}
void register_cmd_version(void)
{
console_cmd_register(cmd_version, "version");
}