mirror of
https://github.com/EranMorkon/AMTS.git
synced 2023-12-28 16:48:38 +00:00
Software
This commit is contained in:
parent
4093cd295f
commit
dc99dcf6e8
41 changed files with 1775 additions and 19 deletions
23
Mieke/SW/ODD/systick.c
Normal file
23
Mieke/SW/ODD/systick.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include "systick.h"
|
||||
|
||||
volatile uint32_t SysTickCnt;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
SysTickCnt++;
|
||||
}
|
||||
|
||||
void systick_init(void)
|
||||
{
|
||||
RCC_ClocksTypeDef clocks;
|
||||
RCC_GetClocksFreq(&clocks);
|
||||
SysTick_Config(clocks.HCLK_Frequency/1000 - 1);
|
||||
|
||||
SysTickCnt = 0;
|
||||
}
|
||||
|
||||
void Wait(uint32_t ms)
|
||||
{
|
||||
uint32_t SysTickCntHold = SysTickCnt;
|
||||
while((SysTickCnt - SysTickCntHold) <= ms);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue