59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
/*
|
|
* cc.h - STM32F407VET6 平台的 LwIP 架构特定配置文件
|
|
*/
|
|
|
|
#ifndef __ARCH_CC_H__
|
|
#define __ARCH_CC_H__
|
|
|
|
/* 包含标准库头文件 */
|
|
#include <stdio.h>
|
|
|
|
/* 包含错误码定义 */
|
|
#include "errno.h"
|
|
|
|
/* 使用系统提供的struct timeval定义 */
|
|
#define LWIP_TIMEVAL_PRIVATE 0
|
|
#include <sys/time.h>
|
|
|
|
/* ---------- 编译器配置 ---------- */
|
|
|
|
/* 内联函数 */
|
|
#define LWIP_INLINE inline
|
|
|
|
/* 打包结构体 */
|
|
#define PACK_STRUCT_BEGIN
|
|
#define PACK_STRUCT_STRUCT
|
|
#define PACK_STRUCT_END
|
|
#define PACK_STRUCT_FIELD(x) x
|
|
#define PACK_STRUCT_USE_INCLUDES
|
|
|
|
/* 编译器特定的属性 */
|
|
#define LWIP_UNUSED(x) (void)(x)
|
|
|
|
/* ---------- 调试配置 ---------- */
|
|
|
|
/* 调试输出函数 */
|
|
#define LWIP_PLATFORM_DIAG(x) printf x
|
|
|
|
/* 平台断言函数 */
|
|
#define LWIP_PLATFORM_ASSERT(msg) \
|
|
do { \
|
|
printf("Assertion failed at %s:%d: %s\n", __FILE__, __LINE__, msg); \
|
|
while (1); \
|
|
} while (0)
|
|
|
|
/* ---------- 编译器屏障 ---------- */
|
|
|
|
/* 编译器屏障指令 */
|
|
#define LWIP_COMPILER_BARRIER() __asm__ volatile ("" ::: "memory")
|
|
|
|
/* ---------- 优化配置 ---------- */
|
|
|
|
/* 启用内联函数 */
|
|
#define LWIP_NO_INLINE 0
|
|
|
|
/* 启用快速内存分配 */
|
|
#define MEM_ALIGNMENT 4
|
|
|
|
#endif /* __ARCH_CC_H__ */
|