Hello World Firmware Library

Source: Internet
Author: User

In fact, the right atom has a good template engineering ... User. Lab file, obj.

A face is a library function operation mode ....

For ease of administration, within the project folder, I divided the following folders: "PROJ" Storage project files, "APP" Storage "main.c", "aplication.c" files, "basedrive" stored "uart.c" file, "Extidrive" Storage is "flash.c", "DOC" is stored in the "Readme" file, corresponding to ". h" file stored in the corresponding folder.

Can write absolute path when containing header file: "#include xxx/extidrive/' Flash.h '", but too troublesome, can also set the directory where the header file is located in the compilation software,

A) How to set the IAR:

Right-click the project file name and select "option"-"C/c++complier"-"proprocessor"-"additonal Include directories".

b) How to set the Keil:

"Project"-"Option for Target XXX"--"C + +"--"Include Paths".

This writes the relative path directly: "#include ' Flash.h '", the header file can also be found by the compiler.

The pre-bedding so much, and now began to get to the point: "Multiple. c files each other contains. h files what to do with"?

Declare variables and functions within each ". C" file, if some variables/functions are called by other ". h" files, then the variable/function is extern in the corresponding "." File, and if there are files to use these variables/functions, simply include their header files. A macro definition can be defined directly within a header file.

Hello World Firmware Library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.