Embedded Programming (24) – How to Use the #ifndef Directive?

Embedded Programming (24) - How to Use the #ifndef Directive?

Lifetime Technical Support:186 3636 9649 Author Introduction: Fan Shengmin (186 3636 9649), Member of the Science Writers Association of Yuncheng City, Member of the Science Writers Association of Shanxi Province. Author of maker education. Published “Playing with Electronics” in 2016, “Super Fun Electronic Production” in 2017, “Electrical Experiments in Life” in 2018, “Arduino Programming and … Read more

Applications of Structures and Unions in Embedded Programming

Applications of Structures and Unions in Embedded Programming

01Union In the previous article “Combining Enumerations and Structures”, it was mentioned that a structure is like a packaging encapsulation, encapsulating some variables with common characteristics inside. A structure is a constructed type or complex type that can contain multiple members of different types. In the C language, there is another syntax very similar to … Read more

Applications of Embedded Programming: The Intricacies of Union

Applications of Embedded Programming: The Intricacies of Union

Concept of union In Chinese, union is referred to as a union, joint, or collective. Its definition format is the same as that of a struct, but its meaning is entirely different. Below is the definition format of a union: union union_name { member_list } union_variable_name; Since its definition format is the same as that … Read more

Layering Code Structure in Embedded Programming

Layering Code Structure in Embedded Programming

Follow and star our public account for exciting content ID: Technology Makes Dreams Greater Source: Online Materials For a beginner transitioning from novice to expert, a learning model like identifying problems → engaging in thought → proposing solutions is very effective. 1. Problems Encountered  Through this period of coding practice, I have accumulated some coding … 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

The Beauty of Mathematics: The Intricacies of Embedded Programming (with C Code)

The Beauty of Mathematics: The Intricacies of Embedded Programming (with C Code)

[Introduction] Ah, you have been successfully drawn in, not quite what you expected, huh?~~~ Just kidding, back to the point. Today, a netizen asked me a question about a sensor measuring a physical quantity and needing to determine its trend of change. I provided some suggestions, and here I will elaborate on those suggestions and … Read more

A Method for Context Switching and Perfect Decoupling in Embedded Programming

A Method for Context Switching and Perfect Decoupling in Embedded Programming

Follow “Embedded Mix” and select “Star the Official Account” to progress together! Source: CSDN Fast Context Switching – cpost Application It is commonly believed that time-consuming operations cannot be executed during interrupts, as this would affect system stability, especially in embedded programming. For programs with an operating system, interrupt handling can be divided into two … Read more

Sharing Years of Experience in Embedded Programming: A Different Perspective on Programming

Sharing Years of Experience in Embedded Programming: A Different Perspective on Programming

1. Limitations of Traditional Programming Structures When not using an RTOS, embedded software typically employs two traditional programming structures: one is called the “front-back structure” or “super loop structure,” which is essentially an event-driven programming method; the other is a time-triggered programming method, such as Michael J. Pont’s “time-triggered programming model.”In practical work, when the … Read more

A Solution for Context Switching in Embedded Programming

A Solution for Context Switching in Embedded Programming

Click the card below to follow Arm Technology Academy This article is from CSDN, and it mainly shares a solution for achieving high cohesion and low coupling during context switching in embedded programming.. Original link: https://blog.csdn.net/qq_34245464/article/details/111804661 The demands of embedded programming are ever-changing. To ensure system stability while maintaining code reusability, high cohesion and low … Read more

Don’t Overlook the C Language Standards in Embedded Programming!

Don't Overlook the C Language Standards in Embedded Programming!

Recently, during a code review, I noticed that many colleagues’ coding practices were teetering on the edge of risk, with one of the most glaring issues being the arbitrary placement of local variable definitions. For seasoned C programmers, most have developed the habit of “defining variables at the beginning of a statement block”. I vaguely … Read more