add systick ; issue -- i2c transfer unstable

This commit is contained in:
2025-11-12 21:26:40 +08:00
parent 4dc04bdd7e
commit 79d7fca725
11 changed files with 241 additions and 165 deletions

View File

@@ -5,10 +5,10 @@
/* ARM Compiler 6 半主机模式禁用声明 */
#if (__ARMCC_VERSION >= 6010050)
__asm(".global __use_no_semihosting\n\t");
__asm(".global __ARM_use_no_argv \n\t");
__asm(".global __use_no_semihosting\n\t");
__asm(".global __ARM_use_no_argv \n\t");
#else
#pragma import(__use_no_semihosting)
#pragma import(__use_no_semihosting)
#endif
FILE __stdout;
@@ -17,7 +17,7 @@ FILE __stdout;
void _sys_exit(int x)
{
x = x;
while (1)
while(1)
; /* 死循环防止程序异常退出 */
}
@@ -25,7 +25,7 @@ void _sys_exit(int x)
int fputc(int c, FILE *stream)
{
/* 等待UART发送缓冲区就绪 */
while (DL_UART_Main_isBusy(UART_0_INST))
while(DL_UART_Main_isBusy(UART_0_INST))
;
/* 发送字符 */
@@ -37,7 +37,7 @@ int fputs(const char *restrict s, FILE *restrict stream)
{
uint16_t i, len;
len = strlen(s);
for (i = 0; i < len; i++)
for(i = 0; i < len; i++)
{
fputc(s[i], stream);
}