From 23f1e8ba278619a9ea65299ec988cbd620103029 Mon Sep 17 00:00:00 2001 From: Terry Date: Mon, 30 Aug 2021 14:43:35 +0800 Subject: [PATCH] update 08/30 --- 嵌入式编程/嵌入式编程规范.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/嵌入式编程/嵌入式编程规范.md b/嵌入式编程/嵌入式编程规范.md index 6845fbc..d51a0b2 100644 --- a/嵌入式编程/嵌入式编程规范.md +++ b/嵌入式编程/嵌入式编程规范.md @@ -60,3 +60,12 @@ for (i = 0; i < 5; ++i) { ```c //这是一个注释 ``` +4. 数据格式 +* 变量声明都按u8/u16/u32,s8/s16/s32格式 +* 同类状态尽量按枚举类型定义,如 + ```c + enum U_SMS{SMS_WORK=0, SMS_CHARGE, SMS_SLEEP} flag; + ``` +* 同功能变量尽量定义结构体,便于管理和阅读 + +