Liangxu Linux
Liangxu Linux
Dec 23, 2025 · Fundamentals

Why char s1[] and char *s2 Aren’t the Same: Deep Dive into C Arrays vs Pointers

This article explains the fundamental differences between C arrays and pointers by examining memory layout, mutability, sizeof behavior, function parameter handling, multidimensional arrays, and practical best‑practice guidelines, providing clear code examples that reveal why declarations like char s1[] = "liangxu" and char *s2 = "liangxu" behave differently.

Best PracticesC++Embedded C
0 likes · 14 min read
Why char s1[] and char *s2 Aren’t the Same: Deep Dive into C Arrays vs Pointers
Liangxu Linux
Liangxu Linux
Oct 29, 2025 · Fundamentals

Why Use a Lightweight Ring Buffer? Deep Dive into LwRB for Embedded Systems

This article explains why circular buffers are essential for efficient data‑stream handling in embedded systems, introduces the open‑source LwRB library, details its memory‑safe and thread‑safe design using C11 atomics, provides core data structures and example code, and compares ring buffers with normal buffers and message queues.

DMAEmbedded CRing Buffer
0 likes · 14 min read
Why Use a Lightweight Ring Buffer? Deep Dive into LwRB for Embedded Systems
Liangxu Linux
Liangxu Linux
Mar 22, 2025 · Backend Development

Boost CPU Efficiency and Code Clarity with State‑Machine Programming

The article explains how using a state‑machine approach in embedded C programs can eliminate wasteful delay loops, ensure logical completeness, and produce clearer, more maintainable code by structuring work around events and states.

CPU efficiencyEmbedded Ccode maintainability
0 likes · 5 min read
Boost CPU Efficiency and Code Clarity with State‑Machine Programming
Liangxu Linux
Liangxu Linux
Jun 15, 2024 · Fundamentals

Mastering Software Timers on STM32: Theory, Design, and Code

This guide explains what software timers are, their implementation principles in operating systems, and provides a complete STM32‑based example with data structures, state machines, and full C code for initialization, start, update, stop, and status queries.

Embedded CSTM32callback
0 likes · 10 min read
Mastering Software Timers on STM32: Theory, Design, and Code
Liangxu Linux
Liangxu Linux
Jun 10, 2024 · Fundamentals

Mastering Software Timers on STM32: From Theory to Practical Implementation

This article explains what software timers are, their implementation principles in operating systems, and provides a detailed STM32-based example—including clock tick handling, data structures, state management, and full C code for initializing, starting, updating, stopping, and testing timers.

Embedded CSTM32callback
0 likes · 10 min read
Mastering Software Timers on STM32: From Theory to Practical Implementation
Liangxu Linux
Liangxu Linux
Dec 21, 2023 · Fundamentals

Why Global Variables Kill Embedded C Projects—and How to Tame Them

The article warns that overusing global variables in os‑less embedded C projects creates tangled code, blurs system layers, and leads to maintenance nightmares, then offers two core principles and practical tips to limit, encapsulate, and manage globals for more reliable firmware.

Best PracticesEmbedded CMicrocontroller
0 likes · 7 min read
Why Global Variables Kill Embedded C Projects—and How to Tame Them
Liangxu Linux
Liangxu Linux
Jul 2, 2023 · Fundamentals

Mastering Table‑Driven Parameter Management for Low‑Memory MCUs

This article explains the latest updates to a table‑driven parameter management library for MCU devices, covering unified parameter definitions, macro‑based registration, key‑value and non‑key‑value storage options, configurable trimming, macro and function interfaces, and provides detailed C code examples and serialization demos.

Embedded CMCUmacro
0 likes · 11 min read
Mastering Table‑Driven Parameter Management for Low‑Memory MCUs
Liangxu Linux
Liangxu Linux
Jul 3, 2021 · Fundamentals

What’s the Hidden Trick Behind This Unusual C Macro in Kernel Code?

The author discovers an unusual macro definition in kernel source that omits the usual parameter list, explains the standard macro usage, shows the original and altered code snippets, and highlights why the macro without arguments works, offering a practical insight for C and embedded developers.

C macrosEmbedded Cc-language
0 likes · 2 min read
What’s the Hidden Trick Behind This Unusual C Macro in Kernel Code?