Created
November 1, 2017 12:55
-
-
Save hocarm/542f2b884dc47fa44c6d5a904fc168ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t counter_1ms; | |
void Delay_ns(__IO uint32_t nCount) | |
{ | |
while(nCount--) | |
{ | |
} | |
} | |
void Delay_us(__IO uint32_t nCount) | |
{ | |
while(nCount--) | |
{ | |
Delay_ns(35); | |
} | |
} | |
void __delay_ms(uint32_t ms) | |
{ | |
counter_1ms = 0; | |
while(counter_1ms < ms); | |
} | |
void System_Init(void) | |
{ | |
//cau hinh systick | |
SysTick_Config(SystemCoreClock/1000); | |
//cau hinh 1ms ngat 1 lan | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment