Skip to content
Snippets Groups Projects
Commit a9b067ee authored by Thibaut VIARD's avatar Thibaut VIARD
Browse files

Updating delay API

parent 35623eae
No related branches found
No related tags found
No related merge requests found
......@@ -43,22 +43,6 @@ uint32_t micros( void )
// a runtime multiplication and shift, saving a few cycles
}
// original function:
// uint32_t micros( void )
// {
// uint32_t ticks ;
// uint32_t count ;
//
// SysTick->CTRL;
// do {
// ticks = SysTick->VAL;
// count = GetTickCount();
// } while (SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk);
//
// return count * 1000 + (SysTick->LOAD + 1 - ticks) / (SystemCoreClock/1000000) ;
// }
void delay( uint32_t ms )
{
if ( ms == 0 )
......@@ -74,6 +58,12 @@ void delay( uint32_t ms )
} while ( _ulTickCount - start < ms ) ;
}
void SysTick_Handler( void )
{
// Increment tick count each ms
_ulTickCount++ ;
}
#ifdef __cplusplus
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment