Interrupt program of the MCU interrupt module

#include // The header file of the MCU

#define uint unsigned int // macro defines unsigned integer

#define uchar unsigned char//macro definition unsigned char type

#include //The header file of the MCU

#define uint unsigned int // macro defines unsigned integer

#define uchar unsigned char//macro definition unsigned char type

Char code b[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,

0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff,

0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01, 0x00}; / / use hexadecimal to define the working state of the P2 port gossip

Uchar code temp[]={0x80,0xe3,0x44,0x41,0x23,0x11,0x10,0xc3,0x00,0x01};//with sixteen classics

/ / Use hexadecimal to define the digital display of digital tube 0~9

Uchar i; / / global definition

Void delay(uint TIme) //delay function

What is a macro definition?

1. Macro definition without parameters: Macro definition is also called macro substitution, macro replacement, referred to as "macro". Format: #define Identifier string The identifier is the so-called symbolic constant, also known as the "macro name". Preprocessing (precompilation) work is also called macro expansion: replace the macro name with a string. The key to mastering the concept of "macro" is "changing." Everything is changed to the premise, and you must change it before you do anything. Before you understand it accurately, you must "change". That is, before the specific analysis of the meaning and function of the relevant command or statement, it is necessary to change: Example: #define PI 3.1415926 Replace all the PIs appearing in the program with 3.1415926:

(1) Macro names are generally capitalized

(2) The use of macros can improve the versatility and legibility of the program, reduce inconsistencies, reduce input errors and facilitate modification. For example: array size common macro definition

(3) Preprocessing is the processing before compilation, and one of the tasks of the compilation work is the syntax check, and the preprocessing does not do the syntax check.

(4) There is no semicolon at the end of the macro definition;

(5) The macro definition is written outside the curly braces of the function, and the scope is followed by the program, usually at the very beginning of the file.

(6) You can terminate the scope of the macro definition with the #undef command.

(7) macro definitions can be nested

(8) The string " " never contains a macro

(9) The macro definition does not allocate memory, and the variable definition allocates memory.

Fiber Pen Nib

Fiber Pen Nib,Passive Capacitive Stylus Pen,Rubber Tip Stylus Pen,Microsoft Stylus Pen

Shenzhen Ruidian Technology CO., Ltd , https://www.wisonen.com

This entry was posted in on