修改驱动程序
This commit is contained in:
1 parent
063c3fcc07
commit
a69c1a58d6
39 files changed
+1627
-641
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user