C++ Design Patterns: Observer Pattern

The Observer Pattern is a behavioral design pattern that defines a one-to-many dependency between objects. When the state of one object (the Subject) changes, all dependent objects (the Observers) are notified and updated automatically. This pattern is also known as the “publish-subscribe” pattern. Core Roles of the Observer Pattern Subject: The object being observed, which … Read more

CUTEHSM – An Efficient Hierarchical State Machine in C

CUTEHSM - An Efficient Hierarchical State Machine in C

Why Do We Need an Elegant Hierarchical State Machine? Traditional State Machine Implementation: // Traditional implementation: 4 function pointers + complex state transition logic typedef struct { void (*entry)(); void (*exit)(); void (*work)(); void (*event)(); // … more function pointers } TraditionalState; This design not only leads to code redundancy but also has a rigid … Read more

Control and Implementation of the Embedded Linux Input Subsystem

Control and Implementation of the Embedded Linux Input Subsystem

3、Input System 3.1、What is the Input System? Before understanding the input system, let’s first understand what input devices are. Common input devices include keyboards, mice, joysticks, graphics tablets, touch screens, etc. Users exchange data with the Linux system through these input devices. To unify the management and processing of these devices, the Linux system implements … Read more

Using Events in Embedded Development with MCU

Using Events in Embedded Development with MCU

It is assumed that everyone has learned about inter-task communication. If you haven’t, don’t worry; you can check out the previous content. In the context of inter-task communication, we are generally waiting for an event to occur. But what if we need to wait for multiple events? Surely, none of you here are without a … Read more

Graphical User Interface: Basics of C Language GUI Programming

Graphical User Interface: Basics of C Language GUI Programming

Graphical User Interface: Basics of C Language GUI Programming A graphical user interface (GUI) is the standard interaction method for modern applications, allowing users to interact with programs through images and visual indicators rather than relying solely on text commands. While many developers prefer to use higher-level languages for GUI programming, such as Python or … Read more

Python GUI Tutorial: A Beginner’s Guide to Building Desktop Applications with Tkinter

Python GUI Tutorial: A Beginner's Guide to Building Desktop Applications with Tkinter

Python’s GUI Big Brother – Understanding Tkinter Hey, want to create a small window program with Python but don’t know where to start? You’ve come to the right place! Tkinter is the built-in GUI (Graphical User Interface) Swiss Army knife of Python! No need for extra installations, it’s ready to use right out of the … Read more

Discussing My Microcontroller Programming Ideas

Discussing My Microcontroller Programming Ideas

Wu Jianying Microcontroller Development Board Address Store:【Wu Jianying’s Shop】 Address:【https://item.taobao.com/item.htm?_u=ukgdp5a7629&id=524088004171】 I have developed microcontroller products for two years, and during the process of programming microcontrollers, I gradually formed a generally fixed overall framework, which can also be referred to as a programming idea. I present it here for everyone’s reference. First, classify the peripheral chips, … Read more