Master the ‘Black Magic’ of C Language Macros in 5 Minutes! `#` and `##` Double Your Code Efficiency

Master the 'Black Magic' of C Language Macros in 5 Minutes! `#` and `##` Double Your Code Efficiency

Are you still using the most basic<span>#define PI 3.14</span>?80% of embedded engineers have not truly harnessed the power of macros! When you see meaningless entries in your debug logs like<span>val=123</span>, when your code is filled with repetitive type conversions, and when you want to implement generic operations but feel helpless—today, these two symbols willrevolutionize your … Read more

Using C Language Bitwise Operations and Macros to Create a Configurable HV5812 + IV-18 Fluorescent Tube Driver

Using C Language Bitwise Operations and Macros to Create a Configurable HV5812 + IV-18 Fluorescent Tube Driver

For a while, I found the glow tube quite interesting, and I happened to see a small LCD screen of similar size. So, I created an LCD simulation of a glow tube clock using the LCD to display images (see “AI did half the work, making an LCD simulation glow tube clock” ). However, the … Read more

Summary of C Language Macros

Summary of C Language Macros

Here are some tips for C language macros to fill in the gaps. Macro Expansion Errors #define FUN(x) 1 + x * x int main() { printf("%d\n", 3*FUN(1)); return 0; } The macro expands to <span>3*1+1*1</span>, not <span>3*(1+1)</span>. To avoid this kind of error, always use parentheses in macros.<span>#define FUN(x) (1 + x * x)</span> … Read more

What Are the Differences Between Inline Functions and Macros in Embedded Development? How to Apply Them?

What Are the Differences Between Inline Functions and Macros in Embedded Development? How to Apply Them?

Follow + Star “Embedded Development Notes”, so you won’t miss out on exciting content! Friends who often write code should have encountered inline functions and macro definitions. These two types of writing are frequently seen in many codes, especially in large codebases where strictness and standardization are required, allowing one to learn many clever techniques … Read more

The Wonderful Uses of #define in C Language

The Wonderful Uses of #define in C Language

In C/C++ programming languages, when a program is compiled, it is sent to the compiler, which converts the program into machine language and then completes the compilation and execution of the program. The preprocessor is also known as the macro preprocessor. Macros in C/C++ can be defined as a set of program statements and can … Read more

Understanding the Use of do…while(0) in C Language Macros

Understanding the Use of do...while(0) in C Language Macros

In verification, when using the C language construct case, macros are often utilized. Sometimes, you may see a #define that wraps a piece of code with do…while(0), even though it only executes once. Why use do…while(0 and what is its purpose? The C language uses macros to implement a function: defining two integer variables x … Read more

Essential Macros for ICC: Must-Have for These 5 Classes!

Essential Macros for ICC: Must-Have for These 5 Classes!

Classes with battle pets (Death Knight, Hunter, Warlock, Enhancement Shaman, Balance Druid) should bind a macro for their main damage output skill to attack the green slime when fighting Professor ICC. This way, the pet can help share damage by targeting the green slime. Use the macro: /petattack Unstable Slime.

World of Warcraft: ICC Boss Strategy Guide for Combat Rogues (Bosses 1-4)

World of Warcraft: ICC Boss Strategy Guide for Combat Rogues (Bosses 1-4)

Get it at the end of the articleWhack-a-Mole WA+GSE One-Click Macro. Why can other combat rogues deal impressive DPS, while we always end up at the bottom? Perhaps all you lack is just a technique and a little understanding. Today, I bring you a practical sharing of ICC Bosses 1-4, hoping to bring some light … Read more