Why Global Variables Are Commonly Used in C Language Development for Microcontrollers

Why Global Variables Are Commonly Used in C Language Development for Microcontrollers

Click the aboveblue text to follow us In C language development for microcontrollers, the use of global variables is indeed very common. This programming style is mainly due to several important reasons: 1 Performance and Resource Constraints In embedded systems, resources (such as memory and CPU time) are often very limited. Using global variables can … Read more

The Dominance of Global Variables in Microcontroller Development

The Dominance of Global Variables in Microcontroller Development

⚡ The Dominance of Global Variables in Microcontroller Development Global variables, often “disliked” in desktop application development, are widely used in the field of microcontrollers. This seemingly contradictory phenomenon hides the unique operating environment and development constraints of embedded systems. // Typical microcontroller program structure volatile uint8_t flag = 0; // Interrupt flag uint32_t system_ticks … Read more

The Importance of Modular Programming and Driver Separation in Embedded Systems

The Importance of Modular Programming and Driver Separation in Embedded Systems

Follow and star our official account, to access exciting content Source: zhzht19861011 Introduction When a project team undertakes a relatively complex engineering task, it means that you are no longer working alone. Instead, you collaborate with team members, each responsible for a part of the project. For example, you might only be responsible for the … Read more

Minimizing Global Variables in Embedded C Programming

Minimizing Global Variables in Embedded C Programming

This article discusses the issue of global variables in embedded C programming. In embedded systems, especially in OS-less microcontroller programs, a common mistake is the excessive use of global variables. This phenomenon is often seen among programmers transitioning from early assembly languages and beginners, who tend to use global variables almost like function parameters. They … Read more

Discussing the Issues of Global Variables in Embedded C Programming

Discussing the Issues of Global Variables in Embedded C Programming

Having worked for several years, I have grown from a technical novice to someone who now considers themselves a junior expert. This journey has involved a lot of self-directed learning through various resources. Whether in forums, bookstores, or magazines, I often encounter either shallow posts from beginners or overly abstract conceptual articles. When I finally … Read more

The Importance of Modular Programming and Driver Separation in Embedded Development

The Importance of Modular Programming and Driver Separation in Embedded Development

Introduction When a project team undertakes a relatively complex engineering task, it means that you are no longer working alone. Instead, you collaborate with team members, each responsible for a part of the project. For instance, you might only be responsible for the communication or display section. At this point, you should write your part … Read more

Understanding the Significance of the Stack in Embedded Programming

Understanding the Significance of the Stack in Embedded Programming

Follow+Star Public Account, don’t miss out on exciting content Author | Li Xiaoyao Source | Technology Makes Dreams Greater What is a Variable? Variables can generally be subdivided as shown in the figure below: The focus of this section is to help everyone understand the “stack” in the memory model, temporarily disregarding the case of … Read more

CMake Variables: Master Common Variables and Environment Variables

CMake Variables: Master Common Variables and Environment Variables

1. CMake Variable Reference and Definition (1) Use ${} to reference variables. In statements like IF, use the variable name directly without ${}. (2) Custom variables can be defined implicitly and explicitly. For example, the PROJECT command implicitly defines <projectname>_BINARY_DIR and <projectname>_SOURCE_DIR. Explicitly defining variables can be done using the SET command. For example: SET(HELLO_SRC … Read more

Understanding Variables in CMake

Understanding Variables in CMake

Variables are an important component of CMake scripts, used to control various aspects of the build process. From specifying compiler options to setting installation paths and managing dependencies, the influence of variables can be seen everywhere. This article summarizes the concepts and usage of variables based on the official documentation. Basic Concepts When we mention … Read more

Essential C Language Knowledge Before Revising 408

Essential C Language Knowledge Before Revising 408

It is said that starred candidates have all succeeded in their exams. Follow the guidance to avoid getting lost. Please recommend this to more graduate students. Hello everyone, this is Wangzai~ Many students preparing for the 26th exam do not know how to review for 408, feeling completely lost. They start by reviewing data structures, … Read more