XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_main.c 文件参考
#include "lwip/err.h"
#include "lwip/sockets.h"
#include "lwip/sys.h"
#include "lwip/netdb.h"
#include "lwip/inet.h"
#include "xf_utils.h"
#include "xf_wifi.h"
#include "xf_netif.h"
#include "xf_osal.h"
#include "ex_easy_wifi.h"
xf_main.c 的引用(Include)关系图:

浏览源代码.

宏定义

#define PORT   CONFIG_EXAMPLE_PORT
 
#define EXAMPLE_DELAY_MS   1000
 
#define EX_THREAD_NAME   "ex_thread"
 
#define EX_THREAD_PRIORITY   XF_OSAL_PRIORITY_NORMOL
 
#define EX_THREAD_STACK_SIZE   (1024 * 4)
 

函数

static void _example_thread (void *argument)
 
void xf_main (void)
 全局函数定义: [Global Functions].
 

变量

static const char * TAG = "sta"
 
static const char * payload = "This is a message from client."
 
static xf_osal_thread_t s_thread_hdl = NULL
 
static const xf_osal_thread_attr_t s_thread_attr
 

详细描述

作者
catcatBlue (catca.nosp@m.tblu.nosp@m.e@qq..nosp@m.com)
版本
1.0
日期
2024-06-06

Copyright (c) 2024, CorAL. All rights reserved.

在文件 xf_main.c 中定义.

宏定义说明

◆ PORT

◆ EXAMPLE_DELAY_MS

◆ EX_THREAD_NAME

#define EX_THREAD_NAME   "ex_thread"

在文件 xf_main.c49 行定义.

◆ EX_THREAD_PRIORITY

#define EX_THREAD_PRIORITY   XF_OSAL_PRIORITY_NORMOL

在文件 xf_main.c50 行定义.

◆ EX_THREAD_STACK_SIZE

#define EX_THREAD_STACK_SIZE   (1024 * 4)

在文件 xf_main.c51 行定义.

函数说明

◆ _example_thread()

static void _example_thread ( void *  argument)
static

在文件 xf_main.c73 行定义.

◆ xf_main()

void xf_main ( void  )

全局函数定义: [Global Functions].

  1. 全局函数原型在**头文件**中声明并编写注释,此处可以不加 brief。

主函数。 正常情况下此行空白:函数之间需要有一个空行作为分隔

< 用于接收 _xf_template_func 的传出

< 防止警告

分支语句哪怕只有一句也必须加花括号。

判断语句中,如果一行不足以放下判断语句, 分行时需要将逻辑符号放在新行的开头。 此时最好还是用变量表达判断语句。

常量在前可以避免不必要的逻辑错误。 如 if (XF_TEMPL_FAIL = ret) 时编译会报错。

对于返回值为 void 的函数, return;可有可无,文件风格统一即可。

在文件 xf_main.c62 行定义.

变量说明

◆ TAG

const char* TAG = "sta"
static

在文件 xf_main.c45 行定义.

◆ payload

◆ s_thread_hdl

xf_osal_thread_t s_thread_hdl = NULL
static

在文件 xf_main.c48 行定义.

◆ s_thread_attr

const xf_osal_thread_attr_t s_thread_attr
static
初始值:
= {
.name = EX_THREAD_NAME,
.priority = EX_THREAD_PRIORITY,
.stack_size = EX_THREAD_STACK_SIZE,
}
#define EX_THREAD_PRIORITY
#define EX_THREAD_STACK_SIZE
#define EX_THREAD_NAME

在文件 xf_main.c52 行定义.