Power: rename reset to reboot (#552)
This commit is contained in:
parent
c27d76d664
commit
d088c28659
@ -67,9 +67,9 @@ void power_menu_off_callback(void* context) {
|
||||
void power_menu_reset_dialog_result(DialogResult result, void* context) {
|
||||
Power* power = context;
|
||||
if(result == DialogResultLeft) {
|
||||
power_reset(power, PowerBootModeDfu);
|
||||
power_reboot(power, PowerBootModeDfu);
|
||||
} else if(result == DialogResultRight) {
|
||||
power_reset(power, PowerBootModeNormal);
|
||||
power_reboot(power, PowerBootModeNormal);
|
||||
} else if(result == DialogResultBack) {
|
||||
view_dispatcher_switch_to_view(power->view_dispatcher, VIEW_NONE);
|
||||
}
|
||||
@ -162,7 +162,7 @@ void power_off(Power* power) {
|
||||
view_dispatcher_switch_to_view(power->view_dispatcher, PowerViewDisconnect);
|
||||
}
|
||||
|
||||
void power_reset(Power* power, PowerBootMode mode) {
|
||||
void power_reboot(Power* power, PowerBootMode mode) {
|
||||
if(mode == PowerBootModeNormal) {
|
||||
api_hal_boot_set_mode(ApiHalBootModeNormal);
|
||||
} else if(mode == PowerBootModeDfu) {
|
||||
|
@ -12,8 +12,8 @@ typedef enum {
|
||||
*/
|
||||
void power_off(Power* power);
|
||||
|
||||
/** Reset device
|
||||
/** Reboot device
|
||||
* @param power - Power instance
|
||||
* @param mode - PowerBootMode
|
||||
*/
|
||||
void power_reset(Power* power, PowerBootMode mode);
|
||||
void power_reboot(Power* power, PowerBootMode mode);
|
||||
|
@ -6,14 +6,14 @@ void power_cli_poweroff(Cli* cli, string_t args, void* context) {
|
||||
power_off(power);
|
||||
}
|
||||
|
||||
void power_cli_reset(Cli* cli, string_t args, void* context) {
|
||||
void power_cli_reboot(Cli* cli, string_t args, void* context) {
|
||||
Power* power = context;
|
||||
power_reset(power, PowerBootModeNormal);
|
||||
power_reboot(power, PowerBootModeNormal);
|
||||
}
|
||||
|
||||
void power_cli_dfu(Cli* cli, string_t args, void* context) {
|
||||
Power* power = context;
|
||||
power_reset(power, PowerBootModeDfu);
|
||||
power_reboot(power, PowerBootModeDfu);
|
||||
}
|
||||
|
||||
void power_cli_factory_reset(Cli* cli, string_t args, void* context) {
|
||||
@ -23,7 +23,7 @@ void power_cli_factory_reset(Cli* cli, string_t args, void* context) {
|
||||
if(c == 'y' || c == 'Y') {
|
||||
printf("Data will be wiped after reboot.\r\n");
|
||||
api_hal_boot_set_flags(ApiHalBootFlagFactoryReset);
|
||||
power_reset(power, PowerBootModeNormal);
|
||||
power_reboot(power, PowerBootModeNormal);
|
||||
} else {
|
||||
printf("Safe choice.\r\n");
|
||||
}
|
||||
@ -45,7 +45,7 @@ void power_cli_otg(Cli* cli, string_t args, void* context) {
|
||||
|
||||
void power_cli_init(Cli* cli, Power* power) {
|
||||
cli_add_command(cli, "poweroff", power_cli_poweroff, power);
|
||||
cli_add_command(cli, "reset", power_cli_reset, power);
|
||||
cli_add_command(cli, "reboot", power_cli_reboot, power);
|
||||
cli_add_command(cli, "factory_reset", power_cli_factory_reset, power);
|
||||
cli_add_command(cli, "dfu", power_cli_dfu, power);
|
||||
cli_add_command(cli, "power_info", power_cli_info, power);
|
||||
|
Loading…
Reference in New Issue
Block a user