Skip to content

Commit

Permalink
rvswd: gate rvswd functionality behind platform define
Browse files Browse the repository at this point in the history
  • Loading branch information
perigoso authored and rg-silva committed Jan 17, 2024
1 parent 85fa83e commit 4d333ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ static bool cmd_help(target_s *t, int argc, const char **argv);

static bool cmd_jtag_scan(target_s *target, int argc, const char **argv);
static bool cmd_swd_scan(target_s *target, int argc, const char **argv);
#ifdef PLATFORM_HAS_RVSWD
static bool cmd_rvswd_scan(target_s *target, int argc, const char **argv);
#endif
static bool cmd_auto_scan(target_s *t, int argc, const char **argv);
static bool cmd_frequency(target_s *t, int argc, const char **argv);
static bool cmd_targets(target_s *t, int argc, const char **argv);
Expand Down Expand Up @@ -83,7 +85,9 @@ const command_s cmd_list[] = {
{"jtag_scan", cmd_jtag_scan, "Scan JTAG chain for devices"},
{"swd_scan", cmd_swd_scan, "Scan SWD interface for devices: [TARGET_ID]"},
{"swdp_scan", cmd_swd_scan, "Deprecated: use swd_scan instead"},
#ifdef PLATFORM_HAS_RVSWD
{"rvswd_scan", cmd_rvswd_scan, "Scan RVSWD for devices"},
#endif
{"auto_scan", cmd_auto_scan, "Automatically scan all chain types for devices"},
{"frequency", cmd_frequency, "set minimum high and low times: [FREQ]"},
{"targets", cmd_targets, "Display list of available targets"},
Expand Down Expand Up @@ -285,6 +289,7 @@ bool cmd_swd_scan(target_s *target, int argc, const char **argv)
return true;
}

#ifdef PLATFORM_HAS_RVSWD
bool cmd_rvswd_scan(target_s *target, int argc, const char **argv)
{
(void)target;
Expand Down Expand Up @@ -327,6 +332,7 @@ bool cmd_rvswd_scan(target_s *target, int argc, const char **argv)
morse(NULL, false);
return true;
}
#endif

bool cmd_auto_scan(target_s *t, int argc, const char **argv)
{
Expand Down
1 change: 1 addition & 0 deletions src/platforms/hosted/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void platform_buffer_flush(void);
do { \
} while (0)
#define PLATFORM_HAS_POWER_SWITCH
#define PLATFORM_HAS_RVSWD

#define PRODUCT_ID_ANY 0xffffU

Expand Down

0 comments on commit 4d333ba

Please sign in to comment.