From 2877853cf132b4a87ffaa2eacbb76f021343cb78 Mon Sep 17 00:00:00 2001 From: murmur Date: Sun, 15 Dec 2024 18:14:44 +0800 Subject: [PATCH] update to static --- protocol.c | 2 +- protocol.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/protocol.c b/protocol.c index 6fdad7d..565af44 100644 --- a/protocol.c +++ b/protocol.c @@ -11,7 +11,7 @@ static DeviceStatus deviceStatus = { .initStatus = 1 }; -DeviceDefaultParam dp = {{ +DeviceParam dp = {{ {"pump1", 1, 100, 100, 100}, {"pump2", 2, 100, 100, 100}, {"valve1", 3, 100, 100, 100}, diff --git a/protocol.h b/protocol.h index 093567a..206f59f 100644 --- a/protocol.h +++ b/protocol.h @@ -9,10 +9,10 @@ #include #else // 重定向log_e等函数到printf - void log_e(const char *fmt, ...) { printf(fmt); } - void log_i(const char *fmt, ...) { printf(fmt); } - void log_d(const char *fmt, ...) { printf(fmt); } - void log_w(const char *fmt, ...) { printf(fmt); } +#define log_e printf +#define log_i printf +#define log_d printf +#define log_w printf #endif // 帧头帧尾定义 @@ -96,7 +96,7 @@ typedef union { }AlarmCode_t; // 用于输出具体的告警信息字符串 -const uint8_t alarmInfo[16][32]={ +static const uint8_t alarmInfo[16][32]={ "位置误差超限", "CCW方向禁止限位", "CW方向禁止限位", @@ -160,7 +160,7 @@ typedef union { } bits; uint16_t all; } StatusCode_t; -const uint8_t statusInfo[16][32]={ +static const uint8_t statusInfo[16][32]={ "使能", "采样中(软件示波器功能开启)", "驱动器报故障", @@ -402,10 +402,10 @@ typedef struct { typedef struct { MotorDefaultParam pump[2]; MotorDefaultParam valve[2]; -} DeviceDefaultParam; +} DeviceParam; -extern DeviceDefaultParam dp; +extern DeviceParam dp; // 函数声明 CmdFrameError_t ProcessHostCommand(uint8_t *rxBuf, uint16_t rxLen);