Embedded C Coding Rules

Posted zjbfvfv

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Embedded C Coding Rules相关的知识,希望对你有一定的参考价值。

1. Using inline to replace #define when there are paramters

2. Using unsigned int only for bit-operations

3. Using fixed-width type int e.g. uint8_t, int8_t, etc.

4. Using const as many as you can to avoid mis-modification

5. Using static as many as you can to limit the functions/variables scope

6. Using volatile for interrupt or mutti-task shared varaibles

7. Using {} even there is only one line code in scope

8. Using const to replace #define Marco

 

more rules later

以上是关于Embedded C Coding Rules的主要内容,如果未能解决你的问题,请参考以下文章

将参数从 C 传递到 Embedded Mono

Embedded C Parse Server 迁移服务器URL

Qt/Embedded 简介

Windows Embedded Standard 7 找不到我的 .dll

C++ Unresolved External Symbols Embedded Lua(基于 longjmp 问题)(不重复)

PowerPC Embedded Application Binary Interface (EABI)初探