XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_main.c 文件参考
#include "xf_hal.h"
xf_main.c 的引用(Include)关系图:

浏览源代码.

宏定义

#define TIM0_NUM   0
 
#define TIM0_FREQ   1000*1000
 
#define TIM0_AUTO_RELOAD   false
 
#define TIM0_TARGET_TICKS   500*1000
 
#define TIM1_NUM   1
 
#define TIM1_FREQ   1000*1000
 
#define TIM1_AUTO_RELOAD   true
 
#define TIM1_TARGET_TICKS   500*1000
 
#define TAG   "timer_base"
 

函数

static void time0_callback (xf_tim_num_t tim_num, uint32_t ticks, void *user_data)
 
static void time1_callback (xf_tim_num_t tim_num, uint32_t ticks, void *user_data)
 
void xf_main (void)
 全局函数定义: [Global Functions].
 

详细描述

作者
your name (you@d.nosp@m.omai.nosp@m.n.com)
版本
0.1
日期
2023-10-23

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

在文件 xf_main.c 中定义.

宏定义说明

◆ TIM0_NUM

#define TIM0_NUM   0

在文件 xf_main.c23 行定义.

◆ TIM0_FREQ

#define TIM0_FREQ   1000*1000

在文件 xf_main.c24 行定义.

◆ TIM0_AUTO_RELOAD

#define TIM0_AUTO_RELOAD   false

在文件 xf_main.c25 行定义.

◆ TIM0_TARGET_TICKS

#define TIM0_TARGET_TICKS   500*1000

在文件 xf_main.c26 行定义.

◆ TIM1_NUM

#define TIM1_NUM   1

◆ TIM1_FREQ

#define TIM1_FREQ   1000*1000

◆ TIM1_AUTO_RELOAD

#define TIM1_AUTO_RELOAD   true

◆ TIM1_TARGET_TICKS

#define TIM1_TARGET_TICKS   500*1000

◆ TAG

#define TAG   "timer_base"

在文件 xf_main.c33 行定义.

函数说明

◆ time0_callback()

static void time0_callback ( xf_tim_num_t  tim_num,
uint32_t  ticks,
void *  user_data 
)
static

在文件 xf_main.c63 行定义.

◆ time1_callback()

static void time1_callback ( xf_tim_num_t  tim_num,
uint32_t  ticks,
void *  user_data 
)
static

◆ xf_main()

void xf_main ( void  )

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

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

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

< 用于接收 _xf_template_func 的传出

< 防止警告

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

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

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

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

在文件 xf_main.c50 行定义.