Essential Embedded C Language Macro Techniques You Must Know

Essential Embedded C Language Macro Techniques You Must Know

Word Count: 2000 Practicality Index: ⭐⭐⭐⭐⭐ 01 Macro Print Function In our embedded development, using printf to print some information is a common debugging method. However, when the amount of printed information is large, it can be difficult to know which information is printed in which function. Especially for printing exceptions, we need to quickly … Read more

Common Uses of Preprocessor Directives in Embedded Software

Common Uses of Preprocessor Directives in Embedded Software

Many excellent codes utilize preprocessor directives to enhance their functionality. Today, we will discuss the content related to preprocessor directives. The common preprocessing directives are as follows: # directive, has no effect #include includes a source code file #define defines a macro #undef undefines a macro #if if the given condition is true, compile the … Read more

How to Add Built-in Macros to riscv-gcc

The riscv-gcc tool includes some built-in macro parameters. We can use these built-in macros to determine the behavior of the compiler. 1. Viewing GCC Built-in Macro Parameters Here, we take the riscv-nuclei-elf-gcc toolchain released by Chipone Technology as an example. Using the following command, we can get the built-in macro parameters of this tool: riscv-nuclei-elf-gcc … Read more