修改驱动程序

This commit is contained in:
2584532475@qq.com committed 2023-05-19 18:02:00 +08:00
1 parent 063c3fcc07
commit a69c1a58d6
39 files changed
+1627 -641

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#include "util.h"
float Bytes2Float(char * data)
{
Float ff ;
ff.byte[0] = data[1];
ff.byte[1] = data[0];
ff.byte[2] = data[3];
ff.byte[3] = data[2];
return ff.data;
}
+20
View File
@@ -0,0 +1,20 @@
#ifndef _UTIL_H
#define _UTIL_H
#include <stdint.h>
typedef union {
uint32_t data;
char byte[4];
} Int;
typedef union {
float data;
char byte[4];
} Float;
float Bytes2Float(char * data);
#endif