Skip to content

Commit

Permalink
smps warnings and flag logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-M9CCUTI\ian committed Aug 2, 2024
1 parent d639162 commit 85822e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands/global/smps.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ void smps_handler(struct command_result *res){
}
}

if(!has_volts || volts<5.1f || volts>16.0f){
if(((!has_volts) && (!has_setpoints)) || volts<5.1f || volts>16.0f){

if(volts<5.1f || volts>16.0f){
printf("Invalid voltage: %f.2\r\n", volts);
}

prompt_result result;
//prompt voltage (float)
printf("%sSMPS\r\nVolts (5.1V-16.0V)%s", ui_term_color_info(), ui_term_color_reset());
ui_prompt_float(&result, 5.1f, 16.0f, 13.0f, true, &volts, false);
if(result.exit){
Expand Down

0 comments on commit 85822e3

Please sign in to comment.