当前位置:网站首页>Embedded development program framework

Embedded development program framework

2022-07-06 04:36:00 Please trust me


framework design

stay 《 The code of 》 The first 5 In the chapter , Program design is divided into these levels :

  • The first 1 layer : software system , It's the whole system 、 Whole procedure
  • The first 2 layer : Break down into subsystems or packages . For example, we can split it into : Input subsystem 、 Display subsystem 、 Business system
  • The first 3 layer : Decompose into classes . stay C There are no classes in the language , You can use structures to describe subsystems .
  • The first 4 layer : Decompose into subroutines : Implement those structures ( There are function pointers in the structure ).

Concept of framework

 Insert picture description here
It means that our code is convenient for upper developers to read , We need to encapsulate the underlying driver , Buffer through the middle layer , So that the upper layer can easily call at the same time , Engineers who write business bare metal can also easily understand our code design . In fact, it is a very simple logic of engineering programming . adopt .c File to achieve a certain function , adopt .h The document states . So the main function main You can pass .h Header file to call .c File implementation function .

summary

There's no code this time , So sorry . Later code will be used in practice , Just pay attention to understanding logic .

原网站

版权声明
本文为[Please trust me]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202132206478984.html