diff --git a/apps/system/components/VectorCoreDriver/src/driver.c b/apps/system/components/VectorCoreDriver/src/driver.c index ca807af..6564a53 100644 --- a/apps/system/components/VectorCoreDriver/src/driver.c +++ b/apps/system/components/VectorCoreDriver/src/driver.c @@ -3,8 +3,11 @@ #include "vc_top/vc_top.h" -#define CTRL (csr + VC_TOP_CTRL_REG_OFFSET) +#define CSR_OFFSET (void *)csr + +#define VCTOP_REG(name) \ + *((volatile uint32_t *)(CSR_OFFSET + VC_TOP_##name##_REG_OFFSET)) void vctop_set_ctrl(uint32_t ctrl) { - *((volatile uint32_t*)CTRL) = ctrl; + VCTOP_REG(CTRL) = ctrl; }