Why should I configure define and include Paths in C/C + + in Keil in Stm32 before compiling?

Source: Internet
Author: User

This is a process of communication between Keil and the compiler, which, to be exact, is the configuration of the compiler to read the Keil
The arm series has some of the company's library compilers that communicate with some of the Keil configuration.
like the one you said, Define,include path.
Generally speaking, we use Keil do 51 or STR710 and so on some microcontroller program, do not need to configure the two options just now, why?
because the C51 and ARM7 compilers do not read the above configuration.
instead, the CORTEX-M3 compiler reads the above configuration and translates it into its own internal compiler configuration
For example: You write in define: This_my_def
well, when the compiler compiles, the file implicitly defines the sentence:
#define THIS_MY_DEF
Usually, we write define, all writeUSE_STDPERIPH_DRIVER,STM32F10X_HDof these two
then, when compiling, the file is implicitly defined .
#define Use_stdperiph_driver
#define STM32F10X_HD
These two macros determine some of the configuration of STM32 's library functions.
If you are free of that define text box, the compiler cannot find any configuration information and it will naturally go wrong.
If you have to keep the Define text box free, then you need to add it manually in Stm32F10x.h and many other files.
#define Use_stdperiph_driver
#define STM32F10X_HD
process is more cumbersome, if once changed the chip, the whole project has to be modified, the workload is too large, and error-prone, it's not as easy to operate once as it's configured.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Why should I configure define and include Paths in C/C + + in Keil in Stm32 before compiling?

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.