Car/Core/Inc/syscalls.h

35 lines
765 B
C
Raw Permalink Normal View History

2024-07-13 15:22:46 +08:00
#ifndef __SYSCALLS_H
#define __SYSCALLS_H
2024-07-14 16:07:46 +08:00
2024-07-13 15:22:46 +08:00
#include <errno.h>
#include <signal.h>
2024-07-14 17:27:15 +08:00
#include <stdarg.h>
2024-07-13 15:22:46 +08:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2024-07-13 15:22:46 +08:00
#include <time.h>
2024-07-14 21:03:50 +08:00
#include "usart.h"
2024-07-13 15:22:46 +08:00
2024-07-14 17:27:15 +08:00
#define HUART1 (&huart1)
#define HUART2 (&huart2)
2024-07-14 21:03:50 +08:00
// 条件编译,适配不同平台 (GNU, GCC)
2024-07-13 15:22:46 +08:00
#ifdef __GNUC__
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#define GETCHAR_PROTOTYPE int __io_getchar(void)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#define GETCHAR_PROTOTYPE int fgetc(FILE *f)
#endif /* __GNUC__ */
2024-07-14 21:03:50 +08:00
int _read(int file, char *ptr, int len);
int _write(int file, char *ptr, int len);
2024-07-13 15:22:46 +08:00
2024-07-14 21:03:50 +08:00
PUTCHAR_PROTOTYPE;
GETCHAR_PROTOTYPE;
2024-07-14 17:27:15 +08:00
2024-07-14 21:03:50 +08:00
void delay_us(uint16_t us);
void my_printf(UART_HandleTypeDef *huart, const char *buf, ...);
2024-07-14 17:27:15 +08:00
2024-07-13 15:22:46 +08:00
#endif