top of page
Macros — Complete Guide for Embedded C
What is a Macro and How It Works at Compilation Stage Macros are handled by the C Preprocessor, which runs before the actual compilation begins. The compilation pipeline looks like this: Source.c → [Preprocessor] → Expanded.i → [Compiler] → object.o → [Linker] → final.elf The preprocessor performs textual substitution — it finds every macro usage and replaces it with the defined text, literally copy-pasting the expansion into the source before the compiler ever se
Ashok Kumar Kumawat
Feb 226 min read
qualifiers interacting with storage classes
1. Concept Overview When qualifiers (const, volatile, signed, unsigned) are combined with storage classes (static, extern, register), they define scope, lifetime, mutability, and optimization rules. const volatile: Read-only from software, but value may change unexpectedly (common in hardware registers). static volatile: Persistent variable across function calls, but updated asynchronously (ISR flags). extern const: Shared constant across modules. extern volatile: Shared hard
Ashok Kumar Kumawat
Feb 82 min read
Data type in c
Alright Ashok, let’s dive into Data Types in Embedded C with the structured breakdown you asked for. I’ll keep this focused on embedded industry applications, resource-constrained environments, and safety-critical practices. 1. Concept Overview Data types define how the compiler interprets and allocates memory for variables. Common C types: char, int, short, long, float, double. In embedded systems, sizes are implementation-dependent (e.g., int may be 16-bit on some MCUs, 32-
Ashok Kumar Kumawat
Feb 82 min read
bottom of page