2024-05-31

This commit is contained in:
2584532475@qq.com committed 2024-05-31 16:57:54 +08:00
1 parent f8591b8b99
commit 4a963bd78c
27 files changed
+2956 -229

No files matched your search

+9
View File
@@ -21,6 +21,15 @@ uint32_t Bytes2Int (char * data)
return I.data;
}
int16_t Bytes2Int16 (char * data)
{
Int16Tobyte int16_byte;
int16_byte.byte[0] = data[1];
int16_byte.byte[1] = data[0];
return int16_byte.value;
}
// -----------------------------------------------------------------
// 函数功能: hex字符串转byte数组
+7
View File
@@ -15,6 +15,11 @@ typedef union
} Float;
typedef union{
int16_t value;
char byte[2];
}Int16Tobyte;
float Bytes2Float (char * data);
uint32_t Bytes2Int (char * data);
int hexstr_to_hexbyte (char *src, char *obj, uint16_t length);
@@ -23,6 +28,8 @@ uint32_t byte_to_Inverse(char * data);
// 754 תfloat
float float_to_iee754 (float ff1,char * data);
int16_t Bytes2Int16 (char * data);
#endif