From 3a4c25dc4d49f5f1771308e46c32903640dac73e Mon Sep 17 00:00:00 2001 From: bmy <2583236812@qq.com> Date: Fri, 23 Feb 2024 21:25:55 +0800 Subject: [PATCH] =?UTF-8?q?refact:=20=E5=B0=86=E8=AF=BB=E5=86=99=E7=9A=84?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=B1=82=E6=8E=A5=E5=8F=A3=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E4=B8=BB=E4=BB=8E=E5=88=86=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tiny_frame_read.c => by_tiny_frame_master_read.c} | 0 app/tiny_frame/by_tiny_frame_master_read.h | 11 +++++++++++ ...ny_frame_write.c => by_tiny_frame_master_write.c} | 0 ...ny_frame_write.h => by_tiny_frame_master_write.h} | 12 +++++++----- app/tiny_frame/by_tiny_frame_read.h | 6 ------ app/tiny_frame/by_tiny_frame_slave_read_write.c | 2 ++ app/tiny_frame/by_tiny_frame_slave_read_write.h | 12 ++++++++++++ 7 files changed, 32 insertions(+), 11 deletions(-) rename app/tiny_frame/{by_tiny_frame_read.c => by_tiny_frame_master_read.c} (100%) create mode 100644 app/tiny_frame/by_tiny_frame_master_read.h rename app/tiny_frame/{by_tiny_frame_write.c => by_tiny_frame_master_write.c} (100%) rename app/tiny_frame/{by_tiny_frame_write.h => by_tiny_frame_master_write.h} (77%) delete mode 100644 app/tiny_frame/by_tiny_frame_read.h create mode 100644 app/tiny_frame/by_tiny_frame_slave_read_write.c create mode 100644 app/tiny_frame/by_tiny_frame_slave_read_write.h diff --git a/app/tiny_frame/by_tiny_frame_read.c b/app/tiny_frame/by_tiny_frame_master_read.c similarity index 100% rename from app/tiny_frame/by_tiny_frame_read.c rename to app/tiny_frame/by_tiny_frame_master_read.c diff --git a/app/tiny_frame/by_tiny_frame_master_read.h b/app/tiny_frame/by_tiny_frame_master_read.h new file mode 100644 index 0000000..b0453bc --- /dev/null +++ b/app/tiny_frame/by_tiny_frame_master_read.h @@ -0,0 +1,11 @@ +#ifndef _BY_TINY_FRAME_MASTER_READ_H__ +#define _BY_TINY_FRAME_MASTER_READ_H__ + +#include "by_tiny_frame_config.h" + +#if defined(BY_TF_DEVICE_MASTER) + +#define BY_TINY_FRAME_WRITE_CMD_CODE (0x03) + +#endif +#endif diff --git a/app/tiny_frame/by_tiny_frame_write.c b/app/tiny_frame/by_tiny_frame_master_write.c similarity index 100% rename from app/tiny_frame/by_tiny_frame_write.c rename to app/tiny_frame/by_tiny_frame_master_write.c diff --git a/app/tiny_frame/by_tiny_frame_write.h b/app/tiny_frame/by_tiny_frame_master_write.h similarity index 77% rename from app/tiny_frame/by_tiny_frame_write.h rename to app/tiny_frame/by_tiny_frame_master_write.h index 5a84cae..fd1499a 100644 --- a/app/tiny_frame/by_tiny_frame_write.h +++ b/app/tiny_frame/by_tiny_frame_master_write.h @@ -1,16 +1,18 @@ -#ifndef _BY_TINY_FRAME_WRITE_H__ -#define _BY_TINY_FRAME_WRITE_H__ +#ifndef _BY_TINY_FRAME_MASTER_WRITE_H__ +#define _BY_TINY_FRAME_MASTER_WRITE_H__ #include "by_tiny_frame_config.h" + +#if defined(BY_TF_DEVICE_MASTER) + #include "by_tiny_frame_parse.h" #include "by_tiny_frame_pack.h" #define BY_TINY_FRAME_WRITE_CMD_CODE (0x06) -#if defined(BY_TF_DEVICE_MASTER) + extern void by_tiny_frame_write(uint8_t slave_id, uint16_t reg_addr, uint32_t data); -#elif + #endif - #endif diff --git a/app/tiny_frame/by_tiny_frame_read.h b/app/tiny_frame/by_tiny_frame_read.h deleted file mode 100644 index ca4081f..0000000 --- a/app/tiny_frame/by_tiny_frame_read.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _BY_TINY_FRAME_READ_H__ -#define _BY_TINY_FRAME_READ_H__ - -#define BY_TINY_FRAME_WRITE_CMD_CODE (0x03) - -#endif diff --git a/app/tiny_frame/by_tiny_frame_slave_read_write.c b/app/tiny_frame/by_tiny_frame_slave_read_write.c new file mode 100644 index 0000000..f906eb5 --- /dev/null +++ b/app/tiny_frame/by_tiny_frame_slave_read_write.c @@ -0,0 +1,2 @@ +#include "by_tiny_frame_slave_read_write.h" + diff --git a/app/tiny_frame/by_tiny_frame_slave_read_write.h b/app/tiny_frame/by_tiny_frame_slave_read_write.h new file mode 100644 index 0000000..35f790e --- /dev/null +++ b/app/tiny_frame/by_tiny_frame_slave_read_write.h @@ -0,0 +1,12 @@ +#ifndef _BY_TINY_FRAME_SLAVE_READ_WRITE_H__ +#define _BY_TINY_FRAME_SLAVE_READ_WRITE_H__ + +#include "by_tiny_frame_config.h" + +#if defined(BY_TF_DEVICE_SLAVE) + +#define BY_TINY_FRAME_WRITE_CMD_CODE (0x03) +#define BY_TINY_FRAME_WRITE_CMD_CODE (0x06) + +#endif +#endif