[FL-2297, FL-2289] Power info command, Validator fixes (#1097)

* Power info command, validator fixes
* strdup in validator, fix memory leak
* furi_hal_crypto fixed again
* FuriHal: limit ARR and CC in speaker hal
* FuriHal: LL_TIM_DisableAllOutputs in speaker stop
* Rpc: fix memory leak in screen streaming
* Get rid of crypto_enable/crypto_disable

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-04-07 18:00:45 +03:00
committed by GitHub
parent 02b9cf90d5
commit d635890342
24 changed files with 372 additions and 55 deletions

View File

@@ -20,6 +20,14 @@ void power_cli_reboot2dfu(Cli* cli, string_t args) {
power_reboot(PowerBootModeDfu);
}
static void power_cli_info_callback(const char* key, const char* value, bool last, void* context) {
printf("%-24s: %s\r\n", key, value);
}
void power_cli_info(Cli* cli, string_t args) {
furi_hal_power_info_get(power_cli_info_callback, NULL);
}
void power_cli_debug(Cli* cli, string_t args) {
furi_hal_power_dump_state();
}
@@ -52,6 +60,7 @@ static void power_cli_command_print_usage() {
printf("\toff\t - shutdown power\r\n");
printf("\treboot\t - reboot\r\n");
printf("\treboot2dfu\t - reboot to dfu bootloader\r\n");
printf("\tinfo\t - show power info\r\n");
printf("\tdebug\t - show debug information\r\n");
printf("\t5v <0 or 1>\t - enable or disable 5v ext\r\n");
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
@@ -84,6 +93,11 @@ void power_cli(Cli* cli, string_t args, void* context) {
break;
}
if(string_cmp_str(cmd, "info") == 0) {
power_cli_info(cli, args);
break;
}
if(string_cmp_str(cmd, "debug") == 0) {
power_cli_debug(cli, args);
break;