hello world Firmware Library

其实正点原子有良好的模板工程。。。user 。lab文件 ,obj。

一脸蒙的是库函数的操作方式。。。。

为了便于管理,该项目文件夹内,我分了以下几个文件夹:"PROJ"存放工程文件,"APP"存放"main.c"、"aplication.c"文件,"BASEDRIVE"存放的"Uart.c"文件,"EXTIDRIVE"存放的是"Flash.c","DOC"存放的是"Readme"文件,对应".h"文件存放在对应文件夹。

  包含头文件时可写绝对路径:譬如"#include  XXX/EXTIDRIVE/‘Flash.h‘",但过于麻烦,也可将头文件所在的目录设置进编译软件,

  a)IAR的设置方法:

  在工程文件名右键,选择"Option"-->"C/C++complier"-->"Proprocessor"-->"Additonal Include directories"。

  b)KEIL的设置方法:

  “Project”-->”Option for Target XXX”-->”C/C++”-->”Include Paths”。

  这样直接写相对路径:"#include ‘Flash.h‘",头文件也可被编译器找到。

  前期铺垫这么多,现在开始进入正题:“多个.c文件相互包含.h文件该做如何处理”?

  在每个”.c”文件内声明变量与函数,某些变量/函数如果会被其它”.c”文件调用,则在对应的”.h”文件extern 该变量/函数,若有文件要使用这些变量/函数,只需包含其头文件即可。宏定义可直接在头文件内定义。

时间: 2024-08-08 00:17:06

hello world Firmware Library的相关文章

设置 TIM3_CH2 的 PWM 模式,使能 TIM3 的 CH2 输出

/** ****************************************************************************** * @file    stm32f10x_tim.h * @author  MCD Application Team * @version V3.5.0 * @date    11-March-2011 * @brief   This file contains all the functions prototypes for th

STM32F4 External event -- WFE 待机模式

The STM32F4xx are able to handle external or internal events in order to wake up the core (WFE). The wakeup event can be generated either by: (I've removed normal external interrupt mode details) or configuring an external or internal EXTI line in ev

HP StorageWorks MSL2024 Tape Libraries - Tape library Error Codes

Main error codes Error Code Description Details and Solution 80 Can not initialize bar code reader Power-cycle the unit and retry the operation 81 No response from bar code reader 82 No response from EEPROM on robotic controller 83 Robotic controller

win7 64位系统 PB连接oracle数据库出现“oracle library oci.dll could not be loaded”问题的解决方法

今天与大家分享一个自己的学习笔记,希望能给遇到同样问题的人带来帮助. 不知道大家在win7 64位系统下用 PB连接oracle数据库时,是否遇到过“oracle library oci.dll could not be loaded”问题. 今天,在win7 64位系统下用 PB连接oracle数据库时,一直出现上述错误,在百度上找了很久,都没有找到一个完整的解决方案,咨询了很多人,(他们都说是我的PB和oracle没装好,但我装的时候没出现任何问题,一切都很顺利,而且PB和oracle都能正

编译hadoop 的native library

os:centos 6.7 x64 要解决的问题:   WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 解决的必要性 hadoop的cache和短路读(Short-Circuit Local Reads)都需要native library的支持 解决步骤 编译方法是 http://had

安装python 第三方库遇到的安装问题 microsoft visual studio c++ 10.0 is required,Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

问题一: microsoft visual studio c++ 10.0 is required 安装scrapy时候出现需要vc c++ 10,有时安装其他也会有. 解决方法:安装vc 2010,安装过2017无效,安装过程也不一样. 问题二: 安装好,出现Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 解决办法: 1.pip install wheel 2. 到http://

java cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

出现java cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" 主要的愿意是因为没有jstl的jar包,如果你里面有了,那么可能是版本的问题,j2ee版本如果是1.4那么就要加jstl.jar包,如果是以上就不用加了,还有一个问题是jstl.jar包版本的问题,如果你里面是jstl1.1那么http://Java.sun.com/jsp/jstl/core就是这样,如果是1.0那

nginx安装报错./configure: error: the http rewrite module requires the pcre library.

nginx编译时报错: ./configure: error: the http rewrite module requires the pcre library. 解决方法: [[email protected] nginx-1.5.9]#  yum install zlib-devel -y

error: no curses/termcap library found

[[email protected] mysql-5.1.73]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install..