From 85822e3815a0096d43ef88b39cfa12f0995676ce Mon Sep 17 00:00:00 2001 From: "DESKTOP-M9CCUTI\\ian" Date: Fri, 2 Aug 2024 13:58:17 +0200 Subject: [PATCH] smps warnings and flag logic --- commands/global/smps.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/global/smps.c b/commands/global/smps.c index d5cfa34b..da621668 100644 --- a/commands/global/smps.c +++ b/commands/global/smps.c @@ -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){