Jelajahi Sumber

增加称重超重报警定义

Liu Yang 2 bulan lalu
induk
melakukan
8305259067

+ 3 - 0
msg_definitions/VKFly.xml

@@ -232,6 +232,9 @@
       <entry value="2048" name="VKFLY_SYS_ERROR1_H2P_LOW">
         <description>Battery bms link lost.</description>
       </entry>
+      <entry value="4096" name="VKFLY_SYS_ERROR1_OVER_WEIGHT">
+        <description>Battery bms link lost.</description>
+      </entry>
     </enum>
 
     <enum name="VKFLY_SYS_ERROR3" bitmask="true">

+ 2 - 0
readme.md

@@ -160,6 +160,7 @@ typedef enum VKFLY_SYS_ERROR1
     VKFLY_SYS_ERROR1_ECU_FUEL_LOW=512, /* 发动及油量低 | */
     VKFLY_SYS_ERROR1_ECU_LINK_LOST=1024, /* 发动机数据断开 |*/
     VKFLY_SYS_ERROR1_H2P_LOW=2048, /* 氢气压低 | */
+    VKFLY_SYS_ERROR1_OVER_WEIGHT=4096, /* 负载超重 |*/
 } VKFLY_SYS_ERROR1;
 ```
 
@@ -1849,6 +1850,7 @@ VKins 系统的状态数据自定义消息, 主要用于一些自定状态的传
 | FW_THR_OFF      | 油门行程灭车             | UINT16 | 范围500~2500                                                                      |
 | FW_THR_MIN      | 油门行程怠速             | UINT16 | 范围500~2500                                                                      |
 | FW_THR_MAX      | 油门行程最大             | UINT16 | 范围500~2500                                                                      |
+| PL_WEI_MAX      | 称重超重门限             | UINT32 | 单位g, 范围 0~1000000g, 0表示不启用                                               |
 
 #### 9.2.1 FS_CONF_A 参数说明
 

+ 3 - 2
v2.0/VKFly/VKFly.h

@@ -10,7 +10,7 @@
     #error Wrong include order: MAVLINK_VKFLY.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
 #endif
 
-#define MAVLINK_VKFLY_XML_HASH -2374734789491976015
+#define MAVLINK_VKFLY_XML_HASH 6787792515331487296
 
 #ifdef __cplusplus
 extern "C" {
@@ -206,7 +206,8 @@ typedef enum VKFLY_SYS_ERROR1
    VKFLY_SYS_ERROR1_ECU_FUEL_LOW=512, /* Battery bms link lost. | */
    VKFLY_SYS_ERROR1_ECU_LINK_LOST=1024, /* Battery bms link lost. | */
    VKFLY_SYS_ERROR1_H2P_LOW=2048, /* Battery bms link lost. | */
-   VKFLY_SYS_ERROR1_ENUM_END=2049, /*  | */
+   VKFLY_SYS_ERROR1_OVER_WEIGHT=4096, /* Battery bms link lost. | */
+   VKFLY_SYS_ERROR1_ENUM_END=4097, /*  | */
 } VKFLY_SYS_ERROR1;
 #endif
 

+ 1 - 1
v2.0/VKFly/mavlink.h

@@ -6,7 +6,7 @@
 #ifndef MAVLINK_H
 #define MAVLINK_H
 
-#define MAVLINK_PRIMARY_XML_HASH -2374734789491976015
+#define MAVLINK_PRIMARY_XML_HASH 6787792515331487296
 
 #ifndef MAVLINK_STX
 #define MAVLINK_STX 253

+ 1 - 1
v2.0/VKFly/version.h

@@ -7,7 +7,7 @@
 #ifndef MAVLINK_VERSION_H
 #define MAVLINK_VERSION_H
 
-#define MAVLINK_BUILD_DATE "Mon May 19 2025"
+#define MAVLINK_BUILD_DATE "Tue May 27 2025"
 #define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
  

+ 1 - 1
v2.0/common/common.h

@@ -10,7 +10,7 @@
     #error Wrong include order: MAVLINK_COMMON.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
 #endif
 
-#define MAVLINK_COMMON_XML_HASH -7846703562892100548
+#define MAVLINK_COMMON_XML_HASH -4277103603278670099
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
v2.0/common/mavlink.h

@@ -6,7 +6,7 @@
 #ifndef MAVLINK_H
 #define MAVLINK_H
 
-#define MAVLINK_PRIMARY_XML_HASH -7846703562892100548
+#define MAVLINK_PRIMARY_XML_HASH -4277103603278670099
 
 #ifndef MAVLINK_STX
 #define MAVLINK_STX 253

+ 1 - 1
v2.0/common/version.h

@@ -7,7 +7,7 @@
 #ifndef MAVLINK_VERSION_H
 #define MAVLINK_VERSION_H
 
-#define MAVLINK_BUILD_DATE "Mon May 19 2025"
+#define MAVLINK_BUILD_DATE "Tue May 27 2025"
 #define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
  

+ 15 - 9
v2.0/mavlink_helpers.h

@@ -742,18 +742,24 @@ MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg,
 
 	case MAVLINK_PARSE_STATE_GOT_PAYLOAD: {
 		const mavlink_msg_entry_t *e = mavlink_get_msg_entry(rxmsg->msgid);
-		uint8_t crc_extra = e?e->crc_extra:0;
-		mavlink_update_checksum(rxmsg, crc_extra);
-		if (c != (rxmsg->checksum & 0xFF)) {
+		if (e == NULL) {
+			// Message not found in CRC_EXTRA table.
 			status->parse_state = MAVLINK_PARSE_STATE_GOT_BAD_CRC1;
+			rxmsg->ck[0] = c;
 		} else {
-			status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1;
-		}
-                rxmsg->ck[0] = c;
+			uint8_t crc_extra = e->crc_extra;
+			mavlink_update_checksum(rxmsg, crc_extra);
+			if (c != (rxmsg->checksum & 0xFF)) {
+				status->parse_state = MAVLINK_PARSE_STATE_GOT_BAD_CRC1;
+			} else {
+				status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1;
+			}
+			rxmsg->ck[0] = c;
 
-		// zero-fill the packet to cope with short incoming packets
-                if (e && status->packet_idx < e->max_msg_len) {
-                        memset(&_MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx], 0, e->max_msg_len - status->packet_idx);
+			// zero-fill the packet to cope with short incoming packets
+				if (e && status->packet_idx < e->max_msg_len) {
+					memset(&_MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx], 0, e->max_msg_len - status->packet_idx);
+			}
 		}
 		break;
         }

+ 1 - 1
v2.0/minimal/mavlink.h

@@ -6,7 +6,7 @@
 #ifndef MAVLINK_H
 #define MAVLINK_H
 
-#define MAVLINK_PRIMARY_XML_HASH -7092616748274636242
+#define MAVLINK_PRIMARY_XML_HASH -6102303167187483753
 
 #ifndef MAVLINK_STX
 #define MAVLINK_STX 253

+ 1 - 1
v2.0/minimal/minimal.h

@@ -10,7 +10,7 @@
     #error Wrong include order: MAVLINK_MINIMAL.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
 #endif
 
-#define MAVLINK_MINIMAL_XML_HASH -7092616748274636242
+#define MAVLINK_MINIMAL_XML_HASH -6102303167187483753
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
v2.0/minimal/version.h

@@ -7,7 +7,7 @@
 #ifndef MAVLINK_VERSION_H
 #define MAVLINK_VERSION_H
 
-#define MAVLINK_BUILD_DATE "Mon May 19 2025"
+#define MAVLINK_BUILD_DATE "Tue May 27 2025"
 #define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 22
  

+ 1 - 1
v2.0/standard/mavlink.h

@@ -6,7 +6,7 @@
 #ifndef MAVLINK_H
 #define MAVLINK_H
 
-#define MAVLINK_PRIMARY_XML_HASH 8986179789204880499
+#define MAVLINK_PRIMARY_XML_HASH -1822840776637762224
 
 #ifndef MAVLINK_STX
 #define MAVLINK_STX 253

+ 1 - 1
v2.0/standard/standard.h

@@ -10,7 +10,7 @@
     #error Wrong include order: MAVLINK_STANDARD.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
 #endif
 
-#define MAVLINK_STANDARD_XML_HASH 8986179789204880499
+#define MAVLINK_STANDARD_XML_HASH -1822840776637762224
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
v2.0/standard/version.h

@@ -7,7 +7,7 @@
 #ifndef MAVLINK_VERSION_H
 #define MAVLINK_VERSION_H
 
-#define MAVLINK_BUILD_DATE "Mon May 19 2025"
+#define MAVLINK_BUILD_DATE "Tue May 27 2025"
 #define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 22