1.串口还是5ms
authord15521469561 <1731678236@qq.com>
Tue, 2 Jun 2026 01:25:28 +0000 (09:25 +0800)
committerd15521469561 <1731678236@qq.com>
Tue, 2 Jun 2026 01:25:28 +0000 (09:25 +0800)
2.编码器按键映射dpid功能实现
3.蓝牙闪烁灯功能实现
4.dpid数据接收处理优化

App/src/iot.c

index 0b5fead..72dd086 100644 (file)
@@ -18,16 +18,16 @@ IOT_INFO_T iot_info = {.heartbeat_time = 5};
 
 void Iot_Send_Mcu_Info(void)
 {
-    uint8_t product_reply[9+FW_HEADER_CODE_SIZE] = {0};
+    uint8_t product_reply[9+BLE_ADV_NAME_LEN] = {0};
     *(uint16_t*)&product_reply[0] = USB_VID;
     *(uint16_t*)&product_reply[2] = USB_PID_APP;
     *(uint16_t*)&product_reply[4] = FW_VERSION;
     *(uint16_t*)&product_reply[6] = BUILD_VERSION;
        
        
-    product_reply[8] = FW_HEADER_CODE_SIZE;
+    product_reply[8] = BLE_ADV_NAME_LEN;
        
-    memcpy(&product_reply[9], FW_HEADER_CODE, FW_HEADER_CODE_SIZE);
+    memcpy(&product_reply[9], BLE_ADV_NAME, BLE_ADV_NAME_LEN);
     Iot_Uart_Tx_Query_Add(0x01, product_reply, sizeof(product_reply));
    
 }
@@ -55,20 +55,19 @@ void uart_parse_set_dpid_frame(uint8_t cmd, uint8_t *data, uint16_t len)
                        break;
                }
         // 1. È¡ DPID (2¸ö×Ö½Ú)
-        uint16_t dpid = data[offset + 0] | (data[offset + 1] << 8);
-
-
+               uint16_t dpid = 0;
+               memcpy(&dpid,&data[offset+0],sizeof(uint16_t));
+               
+       
         // 2. È¡Êý¾Ý³¤¶È(2¸ö×Ö½Ú)
-        uint16_t data_len = data[offset + 3] | (data[offset + 4] << 8);
+               uint16_t data_len = 0;
+               memcpy(&data_len,&data[offset+3],sizeof(uint16_t));
 
         // 3. ¼ì²éÊ£ÓàµÄ³¤¶È¹»²»¹»
         if (offset + 5 + data_len > len || data_len  > 63 || data_len == 0) {
                        DUG_PRINTF("offset + 5 + data_len=%d, len=%d\n",offset + 5 + data_len,data_len);
             break;
         }
-                               
-        // 4.Êý¾ÝÖ¸Õë
-//        uint8_t *p_value = &data[offset + 5];
 
         // ==============================
         // ¸ù¾ÝÀàÐͽâÎöÊý¾Ý
@@ -106,8 +105,9 @@ void uart_parse_get_dpid_frame(uint8_t cmd, uint8_t *data, uint8_t len)
                {
                        break;
                }
-               uint16_t dpid = (data[i*sizeof(uint16_t) + 0] << 8) | data[i*sizeof(uint16_t) + 1];//ԭʼÊý¾ÝÊÇС¶ËÐò
-               DUG_PRINTF("dpid =%d\n",dpid);
+               uint16_t dpid = 0;
+               memcpy(&dpid,&data[i*sizeof(uint16_t) + 0],sizeof(uint16_t));
+//             DUG_PRINTF("dpid =%d\n",dpid);
         // ==============================
         // ¸ù¾ÝdpidÉϱ¨ÊôÐÔÊý¾Ý
         // ==============================
@@ -118,8 +118,6 @@ void uart_parse_get_dpid_frame(uint8_t cmd, uint8_t *data, uint8_t len)
                //send_dpid_dataΪ¶Á³öµÄÄÚÈÝ£¬¸ñʽΪ£º dpid ³¤¶È ÄÚÈÝ dpid ³¤¶È ÄÚÈÝ......
                if(Iot_Read_Object(dpid,tmp_buff,&string_type,&data_len))
                {
-                       //22*5 = 110 dpid 
-                       // 108 
                        uint16_t item_len = 5+data_len;
 //                     DUG_PRINTF("total_len =%d %d\n",total_len,item_len);
                        if(total_len + item_len >= sizeof(send_dpid_data))
@@ -130,11 +128,10 @@ void uart_parse_get_dpid_frame(uint8_t cmd, uint8_t *data, uint8_t len)
                                total_len=0;
                                memset(send_dpid_data,0,sizeof(send_dpid_data));
                        }
-                       send_dpid_data[total_len+0] = dpid & 0xff;
-                       send_dpid_data[total_len+1] = (dpid >> 8)&0xff;
-                       send_dpid_data[total_len+2] = string_type;
-                       send_dpid_data[total_len+3] = data_len & 0xff;
-                       send_dpid_data[total_len+4] = (data_len >> 8)&0xff;
+//                     
+                       memcpy(&send_dpid_data[total_len+0],&dpid,2);
+                       memcpy(&send_dpid_data[total_len+2],&string_type,1);
+                       memcpy(&send_dpid_data[total_len+3],&data_len,2);
                        
                        memcpy(&send_dpid_data[total_len+5],tmp_buff,data_len);
                        total_len+=item_len;
@@ -153,6 +150,8 @@ void uart_parse_get_dpid_frame(uint8_t cmd, uint8_t *data, uint8_t len)
 
 static uint8_t iot_factroy_flag = 0;
 static uint8_t factory_retry_count=0;
+static int64_t time_stamp = 0; // Ê±¼ä´Á ÊÀ½çʱ¼ä
+static int8_t time_zone = 8;//Ê±Çøµ¥Î» -24~+24
 //°´¼üʹÄÜiot»Ö¸´³ö³§ÉèÖÃ
 void Iot_Key_Factory_Reset(void)
 {
@@ -170,7 +169,7 @@ void Iot_Uart_Rx_Handle(uint8_t *data ,uint8_t len)
        if(data[1] != 0xE0)
        {
                DUG_PRINTF("IOT: ");
-               for(uint8_t i=0;i<len;i++)
+               for(uint8_t i=0;i<10;i++)
                {
                        DUG_PRINTF("%02x ", data[i]);
                }
@@ -183,6 +182,7 @@ void Iot_Uart_Rx_Handle(uint8_t *data ,uint8_t len)
        }
     if(len >= 4 && len <= IOT_UART_BUFFER_MAX && data[0] == FRAMEHEAD_IOT_TO_PANEL && Crc8_ROHC_Cal(&data[1], len-2) == data[len-1])
     {
+               DUG_PRINTF("recv:%02x\n", data[1]);
         switch (data[1])
         {
             case 0x00:
@@ -219,10 +219,16 @@ void Iot_Uart_Rx_Handle(uint8_t *data ,uint8_t len)
                 switch (data[3])
                 {
                     case 0x00:
-
+                                       {
+                                               DUG_PRINTF("mqtt:disconnect\n");
+                                       }
                                        break;
 
-                    case 0x01: break;
+                    case 0x01:
+                                       {
+                                               DUG_PRINTF("mqtt:connect\n");
+                                       }
+                                       break;
                     default: break;
                 }
             }
@@ -303,6 +309,13 @@ void Iot_Uart_Rx_Handle(uint8_t *data ,uint8_t len)
 //                iot_send_process(0,(uint8_t *)&led_key_profile[0],5);
                                
             }
+            break;
+                       
+                       case 0x12:
+            {
+                               memcpy(&time_zone,&data[4],1);
+                               memcpy(&time_stamp,&data[5],8);
+            }
             break;
                        
                        case 0x13:
@@ -316,6 +329,7 @@ void Iot_Uart_Rx_Handle(uint8_t *data ,uint8_t len)
             {
                                //°´¼üµÆÉÁ˸
                                key_led_status.ble_state = 1;
+                               Iot_Uart_Tx_Query_Add(0x14, NULL, 0);
             }
             break;
                        
@@ -455,11 +469,11 @@ void Iot_Uart_Tx_Query_Process(void)
 //                             DUG_PRINTF("iot iot_uart_tx_query[0].size£º%d\n",iot_uart_tx_query[0].size);
                                if(iot_uart_tx_query[0].buffer[0] != 0xb7 || iot_uart_tx_query[0].buffer[0] != 0xe0  ){
                                        DUG_PRINTF("iot send:\n");
-                                       for(uint8_t i=0;i<iot_uart_tx_query[0].size;i++)
-                                       {
-                                               DUG_PRINTF("%02x ", iot_uart_tx_query[0].buffer[i]);
-                                       }
-                                       DUG_PRINTF("\n");
+//                                     for(uint8_t i=0;i<iot_uart_tx_query[0].size;i++)
+//                                     {
+//                                             DUG_PRINTF("%02x ", iot_uart_tx_query[0].buffer[i]);
+//                                     }
+//                                     DUG_PRINTF("\n");
                                }
 #endif
                        for(uint8_t i=0;i<iot_uart_tx_query_cnt-1;i++)
@@ -531,9 +545,8 @@ void refresh_led_profile_brightness_callback(void *parm)
                        Led_Refresh_Brightness(LED_TELE);
                        break;
                case LED_KEY://°´¼ü
-                       Led_Refresh_Brightness(LED_KEY);
-                       break;
                case LED_ENC_PF:// ÐýÅ¥
+                       Led_Refresh_Brightness(LED_KEY);
                        Led_Refresh_Brightness(LED_ENC_PF);
                        break;
                
@@ -783,7 +796,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[8].data_max = 1;
        
        
-       dp_object[9].object = (void*)(uint32_t)base_connection.uart_conn;
+       dp_object[9].object = (void*)&is_connect_usb;
        dp_object[9].data_len =1;
        dp_object[9].rw_prop = IOT_READ_WRITE;
        dp_object[9].string_type = 0;
@@ -791,7 +804,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[9].data_max = 1;
        
        
-       // Ô¤Áô 9~16
+       // Ô¤Áô 10~16
        
        
        // °´¼ü1 °´¼üÓ³ÉäÖµ
@@ -801,7 +814,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[17].string_type = 0;
        dp_object[17].write_object = &iot_write_object[0];
        dp_object[17].data_min = 1;
-       dp_object[17].data_max = 255;
+       dp_object[17].data_max = 128;
        
        // °´¼ü2 °´¼üÓ³ÉäÖµ
        dp_object[18].object = (void*)&io_input_remap[0].key2;
@@ -810,7 +823,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[18].string_type = 0;
        dp_object[18].write_object = &iot_write_object[0];
        dp_object[18].data_min = 1;
-       dp_object[18].data_max = 255;
+       dp_object[18].data_max = 128;
        
        
        // °´¼ü3 °´¼üÓ³ÉäÖµ
@@ -820,7 +833,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[19].string_type = 0;
        dp_object[19].write_object = &iot_write_object[0];
        dp_object[19].data_min = 1;
-       dp_object[19].data_max = 255;
+       dp_object[19].data_max = 128;
        
        
        // °´¼ü4 °´¼üÓ³ÉäÖµ
@@ -830,7 +843,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[20].string_type = 0;
        dp_object[20].write_object = &iot_write_object[0];
        dp_object[20].data_min = 1;
-       dp_object[20].data_max = 255;
+       dp_object[20].data_max = 128;
        
        
        // °´¼ü5 °´¼üÓ³ÉäÖµ
@@ -840,7 +853,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[21].string_type = 0;
        dp_object[21].write_object = &iot_write_object[0];
        dp_object[21].data_min = 1;
-       dp_object[21].data_max = 255;
+       dp_object[21].data_max = 128;
        
        
        // °´¼ü6 °´¼üÓ³ÉäÖµ
@@ -850,7 +863,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[22].string_type = 0;
        dp_object[22].write_object = &iot_write_object[0];
        dp_object[22].data_min = 1;
-       dp_object[22].data_max = 255;
+       dp_object[22].data_max = 128;
        
        
        // °´¼ü7 °´¼üÓ³ÉäÖµ
@@ -860,7 +873,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[23].string_type = 0;
        dp_object[23].write_object = &iot_write_object[0];
        dp_object[23].data_min = 1;
-       dp_object[23].data_max = 255;
+       dp_object[23].data_max = 128;
        
        
        // °´¼ü8 °´¼üÓ³ÉäÖµ
@@ -870,7 +883,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[24].string_type = 0;
        dp_object[24].write_object = &iot_write_object[0];
        dp_object[24].data_min = 1;
-       dp_object[24].data_max = 255;
+       dp_object[24].data_max = 128;
        
        
        // °´¼ü9 °´¼üÓ³ÉäÖµ
@@ -880,7 +893,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[25].string_type = 0;
        dp_object[25].write_object = &iot_write_object[0];
        dp_object[25].data_min = 1;
-       dp_object[25].data_max = 255;
+       dp_object[25].data_max = 128;
        
        
        // °´¼ü10 °´¼üÓ³ÉäÖµ
@@ -890,7 +903,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[26].string_type = 0;
        dp_object[26].write_object = &iot_write_object[0];
        dp_object[26].data_min = 1;
-       dp_object[26].data_max = 255;
+       dp_object[26].data_max = 128;
        
        
        // °´¼ü11 °´¼üÓ³ÉäÖµ
@@ -900,7 +913,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[27].string_type = 0;
        dp_object[27].write_object = &iot_write_object[0];
        dp_object[27].data_min = 1;
-       dp_object[27].data_max = 255;
+       dp_object[27].data_max = 128;
        
        
        // °´¼ü12 °´¼üÓ³ÉäÖµ
@@ -910,7 +923,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[28].string_type = 0;
        dp_object[28].write_object = &iot_write_object[0];
        dp_object[28].data_min = 1;
-       dp_object[28].data_max = 255;
+       dp_object[28].data_max = 128;
        
        
        // ×óÉϲ¦Æ¬ °´¼üÓ³ÉäÖµ
@@ -920,7 +933,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[29].string_type = 0;
        dp_object[29].write_object = &iot_write_object[0];
        dp_object[29].data_min = 1;
-       dp_object[29].data_max = 255;
+       dp_object[29].data_max = 128;
        
        
        // ÓÒÉϲ¦Æ¬ °´¼üÓ³ÉäÖµ
@@ -930,7 +943,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[30].string_type = 0;
        dp_object[30].write_object = &iot_write_object[0];
        dp_object[30].data_min = 1;
-       dp_object[30].data_max = 255;
+       dp_object[30].data_max = 128;
        
        
        
@@ -941,7 +954,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[31].string_type = 0;
        dp_object[31].write_object = &iot_write_object[0];
        dp_object[31].data_min = 1;
-       dp_object[31].data_max = 255;
+       dp_object[31].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥°´ÏÂ-°´¼üÓ³ÉäÖµ
@@ -951,7 +964,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[32].string_type = 0;
        dp_object[32].write_object = &iot_write_object[0];
        dp_object[32].data_min = 1;
-       dp_object[32].data_max = 255;
+       dp_object[32].data_max = 128;
        
        
        // ×óÆßÏòÐýÅ¥ÉÏ-°´¼üÓ³ÉäÖµ
@@ -961,7 +974,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[33].string_type = 0;
        dp_object[33].write_object = &iot_write_object[0];
        dp_object[33].data_min = 1;
-       dp_object[33].data_max = 255;
+       dp_object[33].data_max = 128;
        
        
        // ×óÆßÏòÐýÅ¥ÏÂ-°´¼üÓ³ÉäÖµ
@@ -971,7 +984,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[34].string_type = 0;
        dp_object[34].write_object = &iot_write_object[0];
        dp_object[34].data_min = 1;
-       dp_object[34].data_max = 255;
+       dp_object[34].data_max = 128;
        
        
        // ×óÆßÏòÐýÅ¥×ó-°´¼üÓ³ÉäÖµ
@@ -981,7 +994,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[35].string_type = 0;
        dp_object[35].write_object = &iot_write_object[0];
        dp_object[35].data_min = 1;
-       dp_object[35].data_max = 255;
+       dp_object[35].data_max = 128;
        
        
        // ×óÆßÏòÐýÅ¥ÓÒ-°´¼üÓ³ÉäÖµ
@@ -991,7 +1004,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[36].string_type = 0;
        dp_object[36].write_object = &iot_write_object[0];
        dp_object[36].data_min = 1;
-       dp_object[36].data_max = 255;
+       dp_object[36].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥ÉÏ-°´¼üÓ³ÉäÖµ
@@ -1001,7 +1014,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[37].string_type = 0;
        dp_object[37].write_object = &iot_write_object[0];
        dp_object[37].data_min = 1;
-       dp_object[37].data_max = 255;
+       dp_object[37].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥ÏÂ-°´¼üÓ³ÉäÖµ
@@ -1011,7 +1024,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[38].string_type = 0;
        dp_object[38].write_object = &iot_write_object[0];
        dp_object[38].data_min = 1;
-       dp_object[38].data_max = 255;
+       dp_object[38].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥×ó-°´¼üÓ³ÉäÖµ
@@ -1021,7 +1034,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[39].string_type = 0;
        dp_object[39].write_object = &iot_write_object[0];
        dp_object[39].data_min = 1;
-       dp_object[39].data_max = 255;
+       dp_object[39].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥ÓÒ-°´¼üÓ³ÉäÖµ
@@ -1031,7 +1044,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[40].string_type = 0;
        dp_object[40].write_object = &iot_write_object[0];
        dp_object[40].data_min = 1;
-       dp_object[40].data_max = 255;
+       dp_object[40].data_max = 128;
        
        
        // ×óÆßÏòÐýÅ¥×óת-°´¼üÓ³ÉäÖµ
@@ -1041,7 +1054,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[41].string_type = 0;
        dp_object[41].write_object = &iot_write_object[0];
        dp_object[41].data_min = 1;
-       dp_object[41].data_max = 255;
+       dp_object[41].data_max = 128;
        
        
        // ×óÆßÏòÐýÅ¥ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1051,7 +1064,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[42].string_type = 0;
        dp_object[42].write_object = &iot_write_object[0];
        dp_object[42].data_min = 1;
-       dp_object[42].data_max = 255;
+       dp_object[42].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥×óת-°´¼üÓ³ÉäÖµ
@@ -1061,7 +1074,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[43].string_type = 0;
        dp_object[43].write_object = &iot_write_object[0];
        dp_object[43].data_min = 1;
-       dp_object[43].data_max = 255;
+       dp_object[43].data_max = 128;
        
        
        // ÓÒÆßÏòÐýÅ¥ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1071,7 +1084,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[44].string_type = 0;
        dp_object[44].write_object = &iot_write_object[0];
        dp_object[44].data_min = 1;
-       dp_object[44].data_max = 255;
+       dp_object[44].data_max = 128;
        
        
        // ×óÉÏÐýÅ¥×óת-°´¼üÓ³ÉäÖµ
@@ -1081,7 +1094,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[45].string_type = 0;
        dp_object[45].write_object = &iot_write_object[0];
        dp_object[45].data_min = 1;
-       dp_object[45].data_max = 255;
+       dp_object[45].data_max = 128;
        
        
        // ×óÉÏÐýÅ¥ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1091,7 +1104,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[46].string_type = 0;
        dp_object[46].write_object = &iot_write_object[0];
        dp_object[46].data_min = 1;
-       dp_object[46].data_max = 255;
+       dp_object[46].data_max = 128;
        
        
        // ÓÒÉÏÐýÅ¥×óת-°´¼üÓ³ÉäÖµ
@@ -1101,7 +1114,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[47].string_type = 0;
        dp_object[47].write_object = &iot_write_object[0];
        dp_object[47].data_min = 1;
-       dp_object[47].data_max = 255;
+       dp_object[47].data_max = 128;
        
        
        // ÓÒÉÏÐýÅ¥ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1111,7 +1124,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[48].string_type = 0;
        dp_object[48].write_object = &iot_write_object[0];
        dp_object[48].data_min = 1;
-       dp_object[48].data_max = 255;
+       dp_object[48].data_max = 128;
        
        
        // ×óϲ¦Æ¬(°´¼üģʽ)°´ÏÂ-°´¼üÓ³ÉäÖµ
@@ -1121,7 +1134,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[49].string_type = 0;
        dp_object[49].write_object = &iot_write_object[0];
        dp_object[49].data_min = 1;
-       dp_object[49].data_max = 255;
+       dp_object[49].data_max = 128;
        
        
        // ÓÒϲ¦Æ¬(°´¼üģʽ)°´ÏÂ-°´¼üÓ³ÉäÖµ
@@ -1131,7 +1144,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[50].string_type = 0;
        dp_object[50].write_object = &iot_write_object[0];
        dp_object[50].data_min = 1;
-       dp_object[50].data_max = 255;
+       dp_object[50].data_max = 128;
        
        
        // E1×óת-°´¼üÓ³ÉäÖµ
@@ -1141,7 +1154,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[51].string_type = 0;
        dp_object[51].write_object = &iot_write_object[0];
        dp_object[51].data_min = 1;
-       dp_object[51].data_max = 255;
+       dp_object[51].data_max = 128;
        
        
        // E1ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1151,7 +1164,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[52].string_type = 0;
        dp_object[52].write_object = &iot_write_object[0];
        dp_object[52].data_min = 1;
-       dp_object[52].data_max = 255;
+       dp_object[52].data_max = 128;
        
        
        // E2×óת-°´¼üÓ³ÉäÖµ
@@ -1161,7 +1174,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[53].string_type = 0;
        dp_object[53].write_object = &iot_write_object[0];
        dp_object[53].data_min = 1;
-       dp_object[53].data_max = 255;
+       dp_object[53].data_max = 128;
        
        
        // E2ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1171,7 +1184,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[54].string_type = 0;
        dp_object[54].write_object = &iot_write_object[0];
        dp_object[54].data_min = 1;
-       dp_object[54].data_max = 255;
+       dp_object[54].data_max = 128;
        
        
        // E3×óת-°´¼üÓ³ÉäÖµ
@@ -1181,7 +1194,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[55].string_type = 0;
        dp_object[55].write_object = &iot_write_object[0];
        dp_object[55].data_min = 1;
-       dp_object[55].data_max = 255;
+       dp_object[55].data_max = 128;
        
        
        // E3ÓÒת-°´¼üÓ³ÉäÖµ
@@ -1191,7 +1204,7 @@ void Iot_Dp_Object_Init(void)
        dp_object[56].string_type = 0;
        dp_object[56].write_object = &iot_write_object[0];
        dp_object[56].data_min = 1;
-       dp_object[56].data_max = 255;
+       dp_object[56].data_max = 128;
        
        
        // ×óϲ¦Æ¬(ÏßÐÔ)-°´¼üÓ³ÉäÖµ
@@ -1201,23 +1214,384 @@ void Iot_Dp_Object_Init(void)
        dp_object[57].string_type = 0;
        dp_object[57].write_object = &iot_write_object[0];
        dp_object[57].data_min = 1;
-       dp_object[57].data_max = 255;
+       dp_object[57].data_max = 128;
        
        
        // ÓÒϲ¦Æ¬(ÏßÐÔ)-°´¼üÓ³ÉäÖµ
-       dp_object[58].object = (void*)&io_input_remap[0].paddle_rd;
-       dp_object[58].data_len = sizeof(io_input_remap[0].paddle_rd);
-       dp_object[58].rw_prop = IOT_READ_WRITE;
-       dp_object[58].string_type = 0;
-       dp_object[58].write_object = &iot_write_object[0];
-       dp_object[58].data_min = 1;
-       dp_object[58].data_max = 255;
-       
-       
-       
-       // Ô¤Áô 9~16
-       
-       
+       dp_object[61].object = (void*)&io_input_remap[0].paddle_rd;
+       dp_object[61].data_len = sizeof(io_input_remap[0].paddle_rd);
+       dp_object[61].rw_prop = IOT_READ_WRITE;
+       dp_object[61].string_type = 0;
+       dp_object[61].write_object = &iot_write_object[0];
+       dp_object[61].data_min = 1;
+       dp_object[61].data_max = 128;
+       
+       //===========E1=====================
+       //E1-1µµ°´¼üÓ³ÉäÖµ
+       dp_object[59].object = (void*)&io_input_remap[0].abs_enc1_cnt1;
+       dp_object[59].data_len = sizeof(io_input_remap[0].abs_enc1_cnt1);
+       dp_object[59].rw_prop = IOT_READ_WRITE;
+       dp_object[59].string_type = 0;
+       dp_object[59].write_object = &iot_write_object[0];
+       dp_object[59].data_min = 1;
+       dp_object[59].data_max = 128;
+       
+       //E1-2µµ°´¼üÓ³ÉäÖµ
+       dp_object[60].object = (void*)&io_input_remap[0].abs_enc1_cnt2;
+       dp_object[60].data_len = sizeof(io_input_remap[0].abs_enc1_cnt2);
+       dp_object[60].rw_prop = IOT_READ_WRITE;
+       dp_object[60].string_type = 0;
+       dp_object[60].write_object = &iot_write_object[0];
+       dp_object[60].data_min = 1;
+       dp_object[60].data_max = 128;
+       
+       // E1-3µµ°´¼üÓ³ÉäÖµ
+       dp_object[61].object = (void*)&io_input_remap[0].abs_enc1_cnt3;
+       dp_object[61].data_len = sizeof(io_input_remap[0].abs_enc1_cnt3);
+       dp_object[61].rw_prop = IOT_READ_WRITE;
+       dp_object[61].string_type = 0;
+       dp_object[61].write_object = &iot_write_object[0];
+       dp_object[61].data_min = 1;
+       dp_object[61].data_max = 128;
+       
+       //E1-4µµ°´¼üÓ³ÉäÖµ
+       dp_object[62].object = (void*)&io_input_remap[0].abs_enc1_cnt4;
+       dp_object[62].data_len = sizeof(io_input_remap[0].abs_enc1_cnt4);
+       dp_object[62].rw_prop = IOT_READ_WRITE;
+       dp_object[62].string_type = 0;
+       dp_object[62].write_object = &iot_write_object[0];
+       dp_object[62].data_min = 1;
+       dp_object[62].data_max = 128;
+       
+       
+       //E1-5µµ°´¼üÓ³ÉäÖµ
+       dp_object[63].object = (void*)&io_input_remap[0].abs_enc1_cnt5;
+       dp_object[63].data_len = sizeof(io_input_remap[0].abs_enc1_cnt5);
+       dp_object[63].rw_prop = IOT_READ_WRITE;
+       dp_object[63].string_type = 0;
+       dp_object[63].write_object = &iot_write_object[0];
+       dp_object[63].data_min = 1;
+       dp_object[63].data_max = 128;
+       
+       
+       // E1-6µµ°´¼üÓ³ÉäÖµ
+       dp_object[64].object = (void*)&io_input_remap[0].abs_enc1_cnt6;
+       dp_object[64].data_len = sizeof(io_input_remap[0].abs_enc1_cnt6);
+       dp_object[64].rw_prop = IOT_READ_WRITE;
+       dp_object[64].string_type = 0;
+       dp_object[64].write_object = &iot_write_object[0];
+       dp_object[64].data_min = 1;
+       dp_object[64].data_max = 128;
+       
+       
+       // E1-7µµ°´¼üÓ³ÉäÖµ
+       dp_object[65].object = (void*)&io_input_remap[0].abs_enc1_cnt7;
+       dp_object[65].data_len = sizeof(io_input_remap[0].abs_enc1_cnt7);
+       dp_object[65].rw_prop = IOT_READ_WRITE;
+       dp_object[65].string_type = 0;
+       dp_object[65].write_object = &iot_write_object[0];
+       dp_object[65].data_min = 1;
+       dp_object[65].data_max = 128;
+       
+       
+       // E1-8µµ°´¼üÓ³ÉäÖµ
+       dp_object[66].object = (void*)&io_input_remap[0].abs_enc1_cnt8;
+       dp_object[66].data_len = sizeof(io_input_remap[0].abs_enc1_cnt8);
+       dp_object[66].rw_prop = IOT_READ_WRITE;
+       dp_object[66].string_type = 0;
+       dp_object[66].write_object = &iot_write_object[0];
+       dp_object[66].data_min = 1;
+       dp_object[66].data_max = 128;
+       
+       
+       
+       // E1-9µµ°´¼üÓ³ÉäÖµ
+       dp_object[67].object = (void*)&io_input_remap[0].abs_enc1_cnt9;
+       dp_object[67].data_len = sizeof(io_input_remap[0].abs_enc1_cnt9);
+       dp_object[67].rw_prop = IOT_READ_WRITE;
+       dp_object[67].string_type = 0;
+       dp_object[67].write_object = &iot_write_object[0];
+       dp_object[67].data_min = 1;
+       dp_object[67].data_max = 128;
+       
+       
+       
+       // E1-10µµ°´¼üÓ³ÉäÖµ
+       dp_object[68].object = (void*)&io_input_remap[0].abs_enc1_cnt10;
+       dp_object[68].data_len = sizeof(io_input_remap[0].abs_enc1_cnt10);
+       dp_object[68].rw_prop = IOT_READ_WRITE;
+       dp_object[68].string_type = 0;
+       dp_object[68].write_object = &iot_write_object[0];
+       dp_object[68].data_min = 1;
+       dp_object[68].data_max = 128;
+       
+       
+       
+       // E1-11µµ°´¼üÓ³ÉäÖµ
+       dp_object[69].object = (void*)&io_input_remap[0].abs_enc1_cnt11;
+       dp_object[69].data_len = sizeof(io_input_remap[0].abs_enc1_cnt11);
+       dp_object[69].rw_prop = IOT_READ_WRITE;
+       dp_object[69].string_type = 0;
+       dp_object[69].write_object = &iot_write_object[0];
+       dp_object[69].data_min = 1;
+       dp_object[69].data_max = 128;
+       
+       
+       //E1-12µµ°´¼üÓ³ÉäÖµ
+       dp_object[70].object = (void*)&io_input_remap[0].abs_enc1_cnt12;
+       dp_object[70].data_len = sizeof(io_input_remap[0].abs_enc1_cnt12);
+       dp_object[70].rw_prop = IOT_READ_WRITE;
+       dp_object[70].string_type = 0;
+       dp_object[70].write_object = &iot_write_object[0];
+       dp_object[70].data_min = 1;
+       dp_object[70].data_max = 128;
+       
+       
+       //=============E2===================
+       //E2-1µµ°´¼üÓ³ÉäÖµ
+       dp_object[71].object = (void*)&io_input_remap[0].abs_enc2_cnt1;
+       dp_object[71].data_len = sizeof(io_input_remap[0].abs_enc2_cnt1);
+       dp_object[71].rw_prop = IOT_READ_WRITE;
+       dp_object[71].string_type = 0;
+       dp_object[71].write_object = &iot_write_object[0];
+       dp_object[71].data_min = 1;
+       dp_object[71].data_max = 128;
+       
+       
+       //E2-2µµ°´¼üÓ³ÉäÖµ
+       dp_object[72].object = (void*)&io_input_remap[0].abs_enc2_cnt2;
+       dp_object[72].data_len = sizeof(io_input_remap[0].abs_enc2_cnt2);
+       dp_object[72].rw_prop = IOT_READ_WRITE;
+       dp_object[72].string_type = 0;
+       dp_object[72].write_object = &iot_write_object[0];
+       dp_object[72].data_min = 1;
+       dp_object[72].data_max = 128;
+       
+       
+       
+       //E2-3µµ°´¼üÓ³ÉäÖµ
+       dp_object[73].object = (void*)&io_input_remap[0].abs_enc2_cnt3;
+       dp_object[73].data_len = sizeof(io_input_remap[0].abs_enc2_cnt3);
+       dp_object[73].rw_prop = IOT_READ_WRITE;
+       dp_object[73].string_type = 0;
+       dp_object[73].write_object = &iot_write_object[0];
+       dp_object[73].data_min = 1;
+       dp_object[73].data_max = 128;
+       
+       //E2-4µµ°´¼üÓ³ÉäÖµ
+       dp_object[74].object = (void*)&io_input_remap[0].abs_enc2_cnt4;
+       dp_object[74].data_len = sizeof(io_input_remap[0].abs_enc2_cnt4);
+       dp_object[74].rw_prop = IOT_READ_WRITE;
+       dp_object[74].string_type = 0;
+       dp_object[74].write_object = &iot_write_object[0];
+       dp_object[74].data_min = 1;
+       dp_object[74].data_max = 128;
+       
+       
+       
+       //E2-5µµ°´¼üÓ³ÉäÖµ
+       dp_object[75].object = (void*)&io_input_remap[0].abs_enc2_cnt5;
+       dp_object[75].data_len = sizeof(io_input_remap[0].abs_enc2_cnt5);
+       dp_object[75].rw_prop = IOT_READ_WRITE;
+       dp_object[75].string_type = 0;
+       dp_object[75].write_object = &iot_write_object[0];
+       dp_object[75].data_min = 1;
+       dp_object[75].data_max = 128;
+       
+       //E2-6µµ°´¼üÓ³ÉäÖµ
+       dp_object[76].object = (void*)&io_input_remap[0].abs_enc2_cnt6;
+       dp_object[76].data_len = sizeof(io_input_remap[0].abs_enc2_cnt6);
+       dp_object[76].rw_prop = IOT_READ_WRITE;
+       dp_object[76].string_type = 0;
+       dp_object[76].write_object = &iot_write_object[0];
+       dp_object[76].data_min = 1;
+       dp_object[76].data_max = 128;
+       
+       
+       
+       //E2-7µµ°´¼üÓ³ÉäÖµ
+       dp_object[77].object = (void*)&io_input_remap[0].abs_enc2_cnt7;
+       dp_object[77].data_len = sizeof(io_input_remap[0].abs_enc2_cnt7);
+       dp_object[77].rw_prop = IOT_READ_WRITE;
+       dp_object[77].string_type = 0;
+       dp_object[77].write_object = &iot_write_object[0];
+       dp_object[77].data_min = 1;
+       dp_object[77].data_max = 128;
+       
+       
+       //E2-8µµ°´¼üÓ³ÉäÖµ
+       dp_object[78].object = (void*)&io_input_remap[0].abs_enc2_cnt8;
+       dp_object[78].data_len = sizeof(io_input_remap[0].abs_enc2_cnt8);
+       dp_object[78].rw_prop = IOT_READ_WRITE;
+       dp_object[78].string_type = 0;
+       dp_object[78].write_object = &iot_write_object[0];
+       dp_object[78].data_min = 1;
+       dp_object[78].data_max = 128;
+       
+       
+       
+       //E2-9µµ°´¼üÓ³ÉäÖµ
+       dp_object[79].object = (void*)&io_input_remap[0].abs_enc2_cnt9;
+       dp_object[79].data_len = sizeof(io_input_remap[0].abs_enc2_cnt9);
+       dp_object[79].rw_prop = IOT_READ_WRITE;
+       dp_object[79].string_type = 0;
+       dp_object[79].write_object = &iot_write_object[0];
+       dp_object[79].data_min = 1;
+       dp_object[79].data_max = 128;
+       
+       //E2-10µµ°´¼üÓ³ÉäÖµ
+       dp_object[80].object = (void*)&io_input_remap[0].abs_enc2_cnt10;
+       dp_object[80].data_len = sizeof(io_input_remap[0].abs_enc2_cnt10);
+       dp_object[80].rw_prop = IOT_READ_WRITE;
+       dp_object[80].string_type = 0;
+       dp_object[80].write_object = &iot_write_object[0];
+       dp_object[80].data_min = 1;
+       dp_object[80].data_max = 128;
+       
+       
+       
+       //E2-11µµ°´¼üÓ³ÉäÖµ
+       dp_object[81].object = (void*)&io_input_remap[0].abs_enc2_cnt11;
+       dp_object[81].data_len = sizeof(io_input_remap[0].abs_enc2_cnt11);
+       dp_object[81].rw_prop = IOT_READ_WRITE;
+       dp_object[81].string_type = 0;
+       dp_object[81].write_object = &iot_write_object[0];
+       dp_object[81].data_min = 1;
+       dp_object[81].data_max = 128;
+       
+       //E2-12µµ°´¼üÓ³ÉäÖµ
+       dp_object[82].object = (void*)&io_input_remap[0].abs_enc2_cnt12;
+       dp_object[82].data_len = sizeof(io_input_remap[0].abs_enc2_cnt12);
+       dp_object[82].rw_prop = IOT_READ_WRITE;
+       dp_object[82].string_type = 0;
+       dp_object[82].write_object = &iot_write_object[0];
+       dp_object[82].data_min = 1;
+       dp_object[82].data_max = 128;
+       
+       
+       //===============E3==================
+       //E3-1µµ°´¼üÓ³ÉäÖµ
+       dp_object[83].object = (void*)&io_input_remap[0].abs_enc3_cnt1;
+       dp_object[83].data_len = sizeof(io_input_remap[0].abs_enc3_cnt1);
+       dp_object[83].rw_prop = IOT_READ_WRITE;
+       dp_object[83].string_type = 0;
+       dp_object[83].write_object = &iot_write_object[0];
+       dp_object[83].data_min = 1;
+       dp_object[83].data_max = 128;
+       
+       
+       //E3-2µµ°´¼üÓ³ÉäÖµ
+       dp_object[84].object = (void*)&io_input_remap[0].abs_enc3_cnt2;
+       dp_object[84].data_len = sizeof(io_input_remap[0].abs_enc3_cnt2);
+       dp_object[84].rw_prop = IOT_READ_WRITE;
+       dp_object[84].string_type = 0;
+       dp_object[84].write_object = &iot_write_object[0];
+       dp_object[84].data_min = 1;
+       dp_object[84].data_max = 128;
+       
+       
+       
+       //E3-3µµ°´¼üÓ³ÉäÖµ
+       dp_object[85].object = (void*)&io_input_remap[0].abs_enc3_cnt3;
+       dp_object[85].data_len = sizeof(io_input_remap[0].abs_enc3_cnt3);
+       dp_object[85].rw_prop = IOT_READ_WRITE;
+       dp_object[85].string_type = 0;
+       dp_object[85].write_object = &iot_write_object[0];
+       dp_object[85].data_min = 1;
+       dp_object[85].data_max = 128;
+       
+       
+       //E3-4µµ°´¼üÓ³ÉäÖµ
+       dp_object[86].object = (void*)&io_input_remap[0].abs_enc3_cnt4;
+       dp_object[86].data_len = sizeof(io_input_remap[0].abs_enc3_cnt4);
+       dp_object[86].rw_prop = IOT_READ_WRITE;
+       dp_object[86].string_type = 0;
+       dp_object[86].write_object = &iot_write_object[0];
+       dp_object[86].data_min = 1;
+       dp_object[86].data_max = 128;
+       
+       
+       
+       //E3-5µµ°´¼üÓ³ÉäÖµ
+       dp_object[87].object = (void*)&io_input_remap[0].abs_enc3_cnt5;
+       dp_object[87].data_len = sizeof(io_input_remap[0].abs_enc3_cnt5);
+       dp_object[87].rw_prop = IOT_READ_WRITE;
+       dp_object[87].string_type = 0;
+       dp_object[87].write_object = &iot_write_object[0];
+       dp_object[87].data_min = 1;
+       dp_object[87].data_max = 128;
+       
+       
+       //E3-6µµ°´¼üÓ³ÉäÖµ
+       dp_object[88].object = (void*)&io_input_remap[0].abs_enc3_cnt6;
+       dp_object[88].data_len = sizeof(io_input_remap[0].abs_enc3_cnt6);
+       dp_object[88].rw_prop = IOT_READ_WRITE;
+       dp_object[88].string_type = 0;
+       dp_object[88].write_object = &iot_write_object[0];
+       dp_object[88].data_min = 1;
+       dp_object[88].data_max = 128;
+       
+       
+       
+       //E3-7µµ°´¼üÓ³ÉäÖµ
+       dp_object[89].object = (void*)&io_input_remap[0].abs_enc3_cnt7;
+       dp_object[89].data_len = sizeof(io_input_remap[0].abs_enc3_cnt7);
+       dp_object[89].rw_prop = IOT_READ_WRITE;
+       dp_object[89].string_type = 0;
+       dp_object[89].write_object = &iot_write_object[0];
+       dp_object[89].data_min = 1;
+       dp_object[89].data_max = 128;
+       
+       
+       //E3-8µµ°´¼üÓ³ÉäÖµ
+       dp_object[90].object = (void*)&io_input_remap[0].abs_enc3_cnt8;
+       dp_object[90].data_len = sizeof(io_input_remap[0].abs_enc3_cnt8);
+       dp_object[90].rw_prop = IOT_READ_WRITE;
+       dp_object[90].string_type = 0;
+       dp_object[90].write_object = &iot_write_object[0];
+       dp_object[90].data_min = 1;
+       dp_object[90].data_max = 128;
+       
+       
+       
+       //E3-9µµ°´¼üÓ³ÉäÖµ
+       dp_object[91].object = (void*)&io_input_remap[0].abs_enc3_cnt9;
+       dp_object[91].data_len = sizeof(io_input_remap[0].abs_enc3_cnt9);
+       dp_object[91].rw_prop = IOT_READ_WRITE;
+       dp_object[91].string_type = 0;
+       dp_object[91].write_object = &iot_write_object[0];
+       dp_object[91].data_min = 1;
+       dp_object[91].data_max = 128;
+       
+       //E3-10µµ°´¼üÓ³ÉäÖµ
+       dp_object[92].object = (void*)&io_input_remap[0].abs_enc3_cnt10;
+       dp_object[92].data_len = sizeof(io_input_remap[0].abs_enc3_cnt10);
+       dp_object[92].rw_prop = IOT_READ_WRITE;
+       dp_object[92].string_type = 0;
+       dp_object[92].write_object = &iot_write_object[0];
+       dp_object[92].data_min = 1;
+       dp_object[92].data_max = 128;
+       
+       //E3-11µµ°´¼üÓ³ÉäÖµ
+       dp_object[93].object = (void*)&io_input_remap[0].abs_enc3_cnt11;
+       dp_object[93].data_len = sizeof(io_input_remap[0].abs_enc3_cnt11);
+       dp_object[93].rw_prop = IOT_READ_WRITE;
+       dp_object[93].string_type = 0;
+       dp_object[93].write_object = &iot_write_object[0];
+       dp_object[93].data_min = 1;
+       dp_object[93].data_max = 128;
+       
+       //E3-12µµ°´¼üÓ³ÉäÖµ
+       dp_object[94].object = (void*)&io_input_remap[0].abs_enc3_cnt12;
+       dp_object[94].data_len = sizeof(io_input_remap[0].abs_enc3_cnt12);
+       dp_object[94].rw_prop = IOT_READ_WRITE;
+       dp_object[94].string_type = 0;
+       dp_object[94].write_object = &iot_write_object[0];
+       dp_object[94].data_min = 1;
+       dp_object[94].data_max = 128;
+       
+       
+       //=============תËÙµÆ========================
        // ×ªËÙµÆ1ÑÕɫֵ
        dp_object[271].object = (void*)&led_tele_profile[0][0][0];
        dp_object[271].data_len = sizeof(LED_COLOR_T);
@@ -2421,10 +2795,18 @@ uint8_t Iot_Write_Object(uint16_t dp_id, void* buf, uint8_t len)
 //                                             user_io_setting.race_telemetry_config.unit[i].key,user_io_setting.race_telemetry_config.unit[i].enc);
 //                                     
 //                                     }
-                                       DUG_PRINTF("data %d %d %d\n",*((uint8_t*)dp_object[dp_id].object),user_io_setting.paddle_mode.dual_clutch_point,user_io_setting.paddle_mode.key_point);
+                                       DUG_PRINTF("data %d dp_id:%d\n",*((uint8_t*)dp_object[dp_id].object),dp_id);
+                                       if(dp_id == 746)
+                                       {
+                                               *(uint8_t *)dp_object[747].object = (uint8_t)input;
+                                               Flash_Write_Query_Add(((IOT_WRITE_OBJECT_T*)dp_object[747].write_object)->addr, ((IOT_WRITE_OBJECT_T*)dp_object[747].write_object)->flag, ((IOT_WRITE_OBJECT_T*)dp_object[747].write_object)->var, ((IOT_WRITE_OBJECT_T*)dp_object[747].write_object)->size, 1);
+                                               
+                                               
+                                       }
                                        Flash_Write_Query_Add(((IOT_WRITE_OBJECT_T*)dp_object[dp_id].write_object)->addr, ((IOT_WRITE_OBJECT_T*)dp_object[dp_id].write_object)->flag, ((IOT_WRITE_OBJECT_T*)dp_object[dp_id].write_object)->var, ((IOT_WRITE_OBJECT_T*)dp_object[dp_id].write_object)->size, 1);
                                        
                                        
+                                       
                                        //ÊÇ·ñÐèҪˢÐÂ
                                        if(((IOT_WRITE_OBJECT_T*)dp_object[dp_id].write_object)->iot_refresh_cb != NULL)
                                        {