feat: 完成eeprom及页面ui更新
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include "by_tiny_frame_parse.h"
|
||||
#include "by_tiny_frame_pack.h"
|
||||
|
||||
#include "jj_param.h"
|
||||
|
||||
void by_tiny_frame_read_write_run(void)
|
||||
{
|
||||
// empty
|
||||
@@ -10,35 +12,35 @@ void by_tiny_frame_read_write_run(void)
|
||||
|
||||
void by_tiny_frame_read_write_handle(by_tf_parse_frame_t frame_s, uint8_t status)
|
||||
{
|
||||
by_tf_pack_frame_t frame_pack_s;
|
||||
// by_tf_pack_frame_t frame_pack_s;
|
||||
|
||||
frame_pack_s.slave_id = BY_TF_DEVICE_SLAVE_ADDRESS;
|
||||
frame_pack_s.cmd = frame_s.cmd;
|
||||
frame_pack_s.reg_addr = frame_s.reg_addr;
|
||||
// frame_pack_s.slave_id = BY_TF_DEVICE_SLAVE_ADDRESS;
|
||||
// frame_pack_s.cmd = frame_s.cmd;
|
||||
// frame_pack_s.reg_addr = frame_s.reg_addr;
|
||||
|
||||
if (status) {
|
||||
// 接收出错,一般为 CRC 校验错误
|
||||
return;
|
||||
}
|
||||
// if (status) {
|
||||
// // 接收出错,一般为 CRC 校验错误
|
||||
// return;
|
||||
// }
|
||||
|
||||
switch (frame_s.cmd) {
|
||||
case 0x03:
|
||||
// 添加查询接口,操作完成后应答
|
||||
frame_pack_s.data = 0XFFFFFFFF; // 示例
|
||||
by_tiny_frame_pack_send(&frame_pack_s);
|
||||
break;
|
||||
case 0x06:
|
||||
// 添加写入接口,操作完成后应答
|
||||
frame_pack_s.data = frame_s.data;
|
||||
by_tiny_frame_pack_send(&frame_pack_s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// switch (frame_s.cmd) {
|
||||
// case 0x03:
|
||||
// // 添加查询接口,操作完成后应答,主机接收,即读取
|
||||
// frame_pack_s.data =(uint32_t)(addre[frame_pack_s.reg_addr]);
|
||||
// by_tiny_frame_pack_send(&frame_pack_s);
|
||||
// break;
|
||||
// case 0x06:
|
||||
// // 添加写入接口,操作完成后应答,主机发送,即写入
|
||||
// *addre[frame_pack_s.reg_addr] = frame_pack_s.data;
|
||||
// by_tiny_frame_pack_send(&frame_pack_s);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
|
||||
#if (BY_TF_DEBUG)
|
||||
printf("****** EXECUTE CMD SUCCESSFUL ******\r\n");
|
||||
printf("Device ID: 0x%0.2X\r\n", BY_TF_DEVICE_SLAVE_ADDRESS);
|
||||
printf("--cmd: %0.2X\n--reg_addr: %0.4X\n--data: %0.8X\r\n", frame_s.cmd, frame_s.reg_addr, frame_s.data);
|
||||
#endif
|
||||
// #if (BY_TF_DEBUG)
|
||||
// printf("****** EXECUTE CMD SUCCESSFUL ******\r\n");
|
||||
// printf("Device ID: 0x%0.2X\r\n", BY_TF_DEVICE_SLAVE_ADDRESS);
|
||||
// printf("--cmd: %0.2X\n--reg_addr: %0.4X\n--data: %0.8X\r\n", frame_s.cmd, frame_s.reg_addr, frame_s.data);
|
||||
// #endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user