generated from hulk/gd32e23x_template
修改通信协议部分,修改版型为0x04
This commit is contained in:
parent
c12273fd46
commit
389d480da7
@ -20,7 +20,7 @@
|
|||||||
#define RX_BUFFER_SIZE 32
|
#define RX_BUFFER_SIZE 32
|
||||||
|
|
||||||
#define PROTOCOL_PACKAGE_HEADER 0xD5
|
#define PROTOCOL_PACKAGE_HEADER 0xD5
|
||||||
#define PROTOCOL_BOARD_TYPE 0x03
|
#define PROTOCOL_BOARD_TYPE 0x04
|
||||||
#define PROTOCOL_PACKAGE_LENGTH 0x02
|
#define PROTOCOL_PACKAGE_LENGTH 0x02
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -48,6 +48,6 @@ validation_result_t validate_package_type(uint8_t* data);
|
|||||||
|
|
||||||
validation_result_t validate_data_length(uint8_t* data);
|
validation_result_t validate_data_length(uint8_t* data);
|
||||||
|
|
||||||
void gd60914_tempture(void);
|
void gd60914_tempture_report(void);
|
||||||
|
|
||||||
#endif //RS485_PROTOCOL_H
|
#endif //RS485_PROTOCOL_H
|
||||||
|
@ -24,9 +24,7 @@ void process_command(uint8_t *cmd, size_t length) {
|
|||||||
// eddy_current_value_report();
|
// eddy_current_value_report();
|
||||||
} else if (strcmp(combined_str, "M2") == 0)
|
} else if (strcmp(combined_str, "M2") == 0)
|
||||||
{
|
{
|
||||||
// printf("%c%c%c%c%c%c", 0xB5, 0xF1, 0x02, g_temperature_uint8[1], g_temperature_uint8[0], 0xCC);
|
gd60914_tempture_report();
|
||||||
// tempture_value_report();
|
|
||||||
gd60914_tempture();
|
|
||||||
} else if (strcmp(combined_str, "M3") == 0)
|
} else if (strcmp(combined_str, "M3") == 0)
|
||||||
{
|
{
|
||||||
printf("%c%c%c%c%c%c", 0xB5, 0xF1, 0x02, 0x6F, 0x6B, 0xCC);
|
printf("%c%c%c%c%c%c", 0xB5, 0xF1, 0x02, 0x6F, 0x6B, 0xCC);
|
||||||
@ -95,7 +93,7 @@ validation_result_t validate_data_length(uint8_t *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gd60914_tempture(void) {
|
void gd60914_tempture_report(void) {
|
||||||
static uint8_t package_header[3] = {0xB5, 0xF0, 0x02};
|
static uint8_t package_header[3] = {0xB5, 0xF0, 0x02};
|
||||||
|
|
||||||
uint8_t combined_data[5];
|
uint8_t combined_data[5];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user