File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1069,7 +1069,7 @@ COMMAND_HANDLER(jlink_handle_jlink_jtag_command)
1069
1069
1070
1070
COMMAND_HANDLER (jlink_handle_target_power_command )
1071
1071
{
1072
- if (CMD_ARGC != 1 )
1072
+ if (CMD_ARGC > 1 )
1073
1073
return ERROR_COMMAND_SYNTAX_ERROR ;
1074
1074
1075
1075
if (!jaylink_has_cap (caps , JAYLINK_DEV_CAP_SET_TARGET_POWER )) {
@@ -1078,6 +1078,20 @@ COMMAND_HANDLER(jlink_handle_target_power_command)
1078
1078
return ERROR_OK ;
1079
1079
}
1080
1080
1081
+ if (!CMD_ARGC ) {
1082
+ uint32_t state ;
1083
+ int ret = jaylink_get_hardware_info (devh , JAYLINK_HW_INFO_TARGET_POWER ,
1084
+ & state );
1085
+
1086
+ if (ret != JAYLINK_OK ) {
1087
+ command_print (CMD , "Failed to retrieve target power state" );
1088
+ return ERROR_FAIL ;
1089
+ }
1090
+
1091
+ command_print (CMD , "%d" , (bool )state );
1092
+ return ERROR_OK ;
1093
+ }
1094
+
1081
1095
bool enable ;
1082
1096
COMMAND_PARSE_ON_OFF (CMD_ARGV [0 ], enable );
1083
1097
@@ -1859,7 +1873,7 @@ static const struct command_registration jlink_subcommand_handlers[] = {
1859
1873
.handler = & jlink_handle_target_power_command ,
1860
1874
.mode = COMMAND_EXEC ,
1861
1875
.help = "set the target power supply" ,
1862
- .usage = "< 0|1|on|off> "
1876
+ .usage = "[ 0|1|on|off] "
1863
1877
},
1864
1878
{
1865
1879
.name = "freemem" ,
You can’t perform that action at this time.
0 commit comments