You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
611 B

6 months ago
#include "systick_timer.h"
static uint32_t tick_count;
volatile uint32_t nDelayCount;
/*-------------------------------------------------------------------------*//**
* @brief This function handles SysTick Handler.
* @param None
* @return None
*//*-------------------------------------------------------------------------*/
void SysTick_Handler( void )
{
tick_count++;
if(nDelayCount != 0)
{
nDelayCount--;
}
}
uint32_t millis(void)
{
return tick_count;
}
void Delay_ms(uint32_t nDelay)
{
nDelayCount = nDelay;
while(nDelayCount != 0);
}