aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-05-06 09:49:12 -0700
committerTim Newsome <tim@sifive.com>2022-05-06 09:56:47 -0700
commitecd736dc53e7dac43fbe358aea5e7639cbfeb7ee (patch)
tree22261b3894a211c662a26e6ae49c5c24fc16ef13
parente191bccc730389c9bca661077dbc7121828cf946 (diff)
downloadriscv-openocd-ecd736dc53e7dac43fbe358aea5e7639cbfeb7ee.zip
riscv-openocd-ecd736dc53e7dac43fbe358aea5e7639cbfeb7ee.tar.gz
riscv-openocd-ecd736dc53e7dac43fbe358aea5e7639cbfeb7ee.tar.bz2
Properly use enum.
Change-Id: I0edef6053fac388db38a22fe7557623fa93ec705 Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com>
-rw-r--r--src/target/riscv/riscv-013.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index e179e82..99ecc00 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -1510,7 +1510,7 @@ typedef enum {
static int set_group(struct target *target, bool *supported, unsigned group, grouptype_t grouptype)
{
uint32_t write = set_field(DM_DMCS2_HGWRITE, DM_DMCS2_GROUP, group);
- write = set_field(write, DM_DMCS2_GROUPTYPE, 1);
+ write = set_field(write, DM_DMCS2_GROUPTYPE, (grouptype == HALTGROUP) ? 1 : 0);
if (dmi_write(target, DM_DMCS2, write) != ERROR_OK)
return ERROR_FAIL;
uint32_t read;