diff --git a/sdk/bsp/include/sim_ctrl.h b/sdk/bsp/include/sim_ctrl.h index 657dba1..c796afc 100644 --- a/sdk/bsp/include/sim_ctrl.h +++ b/sdk/bsp/include/sim_ctrl.h @@ -3,8 +3,10 @@ #define SIM_END_REG 0xE0000000 #define SIM_STDOUT_REG 0xE0000004 +#define SIM_DUMP_REG 0xE0000008 void sim_ctrl_init(); void sim_end(); +void sim_dump_enable(uint8_t en); #endif diff --git a/sdk/bsp/lib/sim_ctrl.c b/sdk/bsp/lib/sim_ctrl.c index e1ca878..adc4b9d 100644 --- a/sdk/bsp/lib/sim_ctrl.c +++ b/sdk/bsp/lib/sim_ctrl.c @@ -17,3 +17,11 @@ void sim_end() { *(volatile int *)SIM_END_REG = 1; } + +void sim_dump_enable(uint8_t en) +{ + if (en) + *(volatile int *)SIM_DUMP_REG = 1; + else + *(volatile int *)SIM_DUMP_REG = 0; +}