Hi,
I'm starting to do some projects in CH32V307VCT6, I'm using MounRiver Studio and FreeRTOS, there is Delay_Us function in debug.c file, But it seems this function is modifying the systick and when I use it, it would ruin the FreeRTOS,
How can I reimplement the Delay_Us function without modifying the systick, Also I could not find any info about the systick regs or any other system peripherals like NVIC in CH32V parts, the peripherals window in debug mode also would not show them, so I wonder where the info is hidden?
this is the original Delay_Us function in debug.c
void Delay_Us(uint32_t n)
{
uint32_t i;
SysTick->SR &= ~(1 << 0);
i = (uint32_t)n * p_us;
SysTick->CMP = i;
SysTick->CTLR |= (1 << 4) | (1 << 5) | (1 << 0);
while((SysTick->SR & (1 << 0)) != (1 << 0))
;
SysTick->CTLR &= ~(1 << 0);
}