This commit is contained in:
2026-03-20 21:16:58 +08:00
parent 286ff98b8e
commit 90c3d919df
248 changed files with 94554 additions and 0 deletions

77
user/Utility/delay.c Executable file
View File

@@ -0,0 +1,77 @@
#include "../main/SystemInclude.h"
#include "delay.h"
void delay_ms(u16 ms)
{
u16 temp;
for (; ms > 0; ms--)
{
#if LOOP_1000US < 65535
for (temp = (u16)LOOP_1000US; temp > 0; temp--){
__NOP();
}
#if DELTA_1000US > 0
__NOP();
#endif
#if DELTA_1000US > 1
__NOP();
#endif
#if DELTA_1000US > 2
__NOP();
#endif
#if DELTA_1000US > 3
__NOP();
#endif
#if DELTA_1000US > 4
__NOP();
#endif
#if DELTA_1000US > 5
__NOP();
#endif
#else
// Clear_WDT();
delay_10us(100);
#endif
}
}
void delay_10us(u16 us)
{
u16 temp;
for (; us > 0; us--)
{
for (temp = (u16)LOOP_10US; temp > 0; temp--);
#if DELTA_10US > 0
__NOP();
#endif
#if DELTA_10US > 1
__NOP();
#endif
#if DELTA_10US > 2
__NOP();
#endif
#if DELTA_10US > 3
__NOP();
#endif
#if DELTA_10US > 4
__NOP();
#endif
#if DELTA_10US > 5
__NOP();
#endif
}
}