35 lines
765 B
C
35 lines
765 B
C
#ifndef __SYSCALLS_H
|
|
#define __SYSCALLS_H
|
|
|
|
#include <errno.h>
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <time.h>
|
|
#include "usart.h"
|
|
|
|
#define HUART1 (&huart1)
|
|
#define HUART2 (&huart2)
|
|
|
|
// 条件编译,适配不同平台 (GNU, GCC)
|
|
#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__ */
|
|
|
|
int _read(int file, char *ptr, int len);
|
|
int _write(int file, char *ptr, int len);
|
|
|
|
PUTCHAR_PROTOTYPE;
|
|
GETCHAR_PROTOTYPE;
|
|
|
|
void delay_us(uint16_t us);
|
|
void my_printf(UART_HandleTypeDef *huart, const char *buf, ...);
|
|
|
|
#endif
|