Error Handling Patterns in C — With Practical Examples
Learn the 5 most common error handling patterns in C: return codes, output parameters, goto cleanup, error callbacks, and error structs. With practical examples.
Master C programming for embedded systems — pointers, structures, bitwise operations, memory management, volatile, preprocessor macros, and common pitfalls. Every example targets real microcontrollers.
Learn the 5 most common error handling patterns in C: return codes, output parameters, goto cleanup, error callbacks, and error structs. With practical examples.
Learn 5 essential refactoring techniques in C: extract function, replace magic numbers, guard clauses, explaining variables, and consolidate duplicates.
Learn how to test embedded C code with unit tests and mocks. Use Unity/CMock frameworks to test on your PC without hardware.
Compare 4 firmware architecture patterns: super-loop, time-triggered, event-driven, and RTOS-based. Choose the right one for your embedded project.
Learn how to design a Hardware Abstraction Layer (HAL) in C. Build portable, testable embedded code with clean hardware interfaces and mock implementations.
Build a complete driver interface in C combining Strategy, Factory, and DIP patterns. One interface, multiple hardware implementations, fully testable.
Learn the Liskov Substitution Principle with practical C examples. See how interchangeable modules (like storage drivers) should behave consistently through a common interface.
Learn the Open/Closed Principle with practical C examples using function pointers. See how to extend behavior without modifying existing, tested code.
Learn how to use a config.h header file to enable and disable features at compile time in embedded C projects. Covers board variants, debug logging,… Read More »Using a Config File for Feature Selection in Embedded C
Learn how to create and use static libraries (.a) and dynamic shared libraries (.so/.dll) in C. Covers compilation steps, linking, runtime loading with dlopen, and… Read More »Using Static and Dynamic Library Files in C