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

C Language Daily Problems with Solutions

C Language Daily Problems with Solutions

1.String “\\“ABC\“\\“ has a length of . A. 11 B. 7 C. 5 D. 3 Answer Explanation: The string constant consists of several characters, and the string length does not count ‘\0’ (the null terminator character), so in this question, \\ is one byte, \” is one byte, A is one byte, B is one … Read more

Mastering Const in Microcontroller Programming

Mastering Const in Microcontroller Programming

Click the blue text above Follow us! The const keyword in C is crucial, and today we will delve into the definition and practical applications of const so that it is no longer a mystery. In C, the const keyword is an abbreviation for constant, meaning it remains unchanged. It is usually translated as constant, … Read more

Understanding Pointers in C Programming

Understanding Pointers in C Programming

Memory Address After we write a program source file and compile it, the resulting binary executable file is stored on the computer’s hard drive. At this point, it is a static file, generally referred to as a program. When this program is started, the operating system will perform the following actions: 1. Copy the program’s … Read more