Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 4d333ba

Browse files
perigosorg-silva
authored andcommitted
rvswd: gate rvswd functionality behind platform define
1 parent 85fa83e commit 4d333ba

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/command.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ static bool cmd_help(target_s *t, int argc, const char **argv);
5151

5252
static bool cmd_jtag_scan(target_s *target, int argc, const char **argv);
5353
static bool cmd_swd_scan(target_s *target, int argc, const char **argv);
54+
#ifdef PLATFORM_HAS_RVSWD
5455
static bool cmd_rvswd_scan(target_s *target, int argc, const char **argv);
56+
#endif
5557
static bool cmd_auto_scan(target_s *t, int argc, const char **argv);
5658
static bool cmd_frequency(target_s *t, int argc, const char **argv);
5759
static bool cmd_targets(target_s *t, int argc, const char **argv);
@@ -83,7 +85,9 @@ const command_s cmd_list[] = {
8385
{"jtag_scan", cmd_jtag_scan, "Scan JTAG chain for devices"},
8486
{"swd_scan", cmd_swd_scan, "Scan SWD interface for devices: [TARGET_ID]"},
8587
{"swdp_scan", cmd_swd_scan, "Deprecated: use swd_scan instead"},
88+
#ifdef PLATFORM_HAS_RVSWD
8689
{"rvswd_scan", cmd_rvswd_scan, "Scan RVSWD for devices"},
90+
#endif
8791
{"auto_scan", cmd_auto_scan, "Automatically scan all chain types for devices"},
8892
{"frequency", cmd_frequency, "set minimum high and low times: [FREQ]"},
8993
{"targets", cmd_targets, "Display list of available targets"},
@@ -285,6 +289,7 @@ bool cmd_swd_scan(target_s *target, int argc, const char **argv)
285289
return true;
286290
}
287291

292+
#ifdef PLATFORM_HAS_RVSWD
288293
bool cmd_rvswd_scan(target_s *target, int argc, const char **argv)
289294
{
290295
(void)target;
@@ -327,6 +332,7 @@ bool cmd_rvswd_scan(target_s *target, int argc, const char **argv)
327332
morse(NULL, false);
328333
return true;
329334
}
335+
#endif
330336

331337
bool cmd_auto_scan(target_s *t, int argc, const char **argv)
332338
{

src/platforms/hosted/platform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void platform_buffer_flush(void);
4848
do { \
4949
} while (0)
5050
#define PLATFORM_HAS_POWER_SWITCH
51+
#define PLATFORM_HAS_RVSWD
5152

5253
#define PRODUCT_ID_ANY 0xffffU
5354

0 commit comments

Comments
 (0)