-
Couldn't load subscription status.
- Fork 10
Open
Description
You write
arduino/cores/w600/wiring_time.c
Lines 39 to 50 in 6148ebc
| uint32_t micros(void) | |
| { | |
| /* Ensure COUNTFLAG is reset by reading SysTick control and status register */ | |
| LL_SYSTICK_IsActiveCounterFlag(); | |
| uint32_t m = tls_os_get_time(); | |
| uint32_t u = SysTick->LOAD - SysTick->VAL; | |
| if(LL_SYSTICK_IsActiveCounterFlag) { | |
| m = tls_os_get_time(); | |
| u = SysTick->LOAD - SysTick->VAL; | |
| } | |
| return (uint32_t)( m * 2000 + (u * 2000) / SysTick->LOAD); | |
| } |
and you write
arduino/cores/w600/wiring_time.c
Lines 16 to 19 in 6148ebc
| static inline uint32_t LL_SYSTICK_IsActiveCounterFlag(void) | |
| { | |
| return ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == (SysTick_CTRL_COUNTFLAG_Msk)); | |
| } |
By which you can see that in line 45, you are not calling the function and checking its return value, you are doing if(function name), and since function name is also the address of the function, the if statement will always have a true statement.
Metadata
Metadata
Assignees
Labels
No labels