2022-12-17 02:43 AM
I copied the code snippet and vtimer.c from RTC_Virtual_Timer project to BLE_Beacon project. But HAL_VTimerStart_ms always returns 0x01 error(=timer already started). Similarly, I copied the same code to Micro_Sleep_Test project, it works normally with 0x00. It's unlikely, does that mean the BLE stack is using the same VTimer? (The BLE stack seems to have some VTimer functions. Micro_Sleep_Test project does not use the BLE stack.)
Why does the difference occur? and Is there a workaround?
2022-12-20 01:12 AM
HAL_VTimerStart_ms() of BLE_Beacon project is
int HAL_VTimerStart_ms(uint8_t timerNum, int32_t msRelTimeout);
Other hand, HAL_VTimerStart_ms() of RTC_Virtual_Timer project is
int HAL_VTimerStart_ms(VTIMER_HandleType *timerHandle, uint32_t msRelTimeout);
The difference was the first argument.
Why is it making such a difference, it's annoying!
When I set the "uint8_t timerNum", VTimer in the BLE_Beacon project is working correctly.