修改谐波含有量上报按3位小数计算
authorkyz <kongyuzhong@google.com>
Sun, 1 Dec 2024 06:37:56 +0000 (14:37 +0800)
committerkyz <kongyuzhong@google.com>
Sun, 1 Dec 2024 06:37:56 +0000 (14:37 +0800)
STM32/code/mcu_com/mcu_com_energy.c

index 80d4a15234a76acb8ace53d563875199f275283d..65ee3a59206d84c8328edf0ace0a816783bf4f75 100644 (file)
@@ -244,14 +244,14 @@ void Mcu_Energy_Get_power_info(void)
 void Mcu_Energy_Get_harmonic_info(void)
 {
     //A/B/C µçѹг²¨º¬ÓÐÂÊ  int32  Ð¡Êýµãºó3λ
-    g_energy.harm.ThdU_D3[0] = swap_u32( rn_harm_data.HarmonicThdU[0] );
-    g_energy.harm.ThdU_D3[1] = swap_u32( rn_harm_data.HarmonicThdU[1] );
-    g_energy.harm.ThdU_D3[2] = swap_u32( rn_harm_data.HarmonicThdU[2] );
+    g_energy.harm.ThdU_D3[0] = swap_u32( rn_harm_data.HarmonicThdU[0] *10 );
+    g_energy.harm.ThdU_D3[1] = swap_u32( rn_harm_data.HarmonicThdU[1] *10 );
+    g_energy.harm.ThdU_D3[2] = swap_u32( rn_harm_data.HarmonicThdU[2] *10 );
 
     //A/B/C µçÁ÷г²¨º¬ÓÐÂÊ  int32  Ð¡Êýµãºó3λ
-    g_energy.harm.ThdI_D3[0] = swap_u32( rn_harm_data.HarmonicThdI[0] );
-    g_energy.harm.ThdI_D3[1] = swap_u32( rn_harm_data.HarmonicThdI[1] );
-    g_energy.harm.ThdI_D3[2] = swap_u32( rn_harm_data.HarmonicThdI[2] );
+    g_energy.harm.ThdI_D3[0] = swap_u32( rn_harm_data.HarmonicThdI[0] *10 );
+    g_energy.harm.ThdI_D3[1] = swap_u32( rn_harm_data.HarmonicThdI[1] *10 );
+    g_energy.harm.ThdI_D3[2] = swap_u32( rn_harm_data.HarmonicThdI[2] *10 );
 
     //A/B/C µçѹг²¨×ܺ¬Á¿  int32  Ð¡Êýµãºó3λ
     g_energy.harm.ThdUrms_D3[0] = swap_u32( rn_harm_data.HarmonicThdUrms[0] );
@@ -521,7 +521,7 @@ void McuCom_Send_Energy(void)
     UART_Tx_One_Frame(PORT_UART_HOST, (uint8_t*)&g_energy.unbalance, sizeof(g_energy.unbalance));
     HAL_Delay(5);
 
-    //·â×°²¢·¢Ëͼäг²¨Êý¾Ý°ü
+    //·â×°²¢·¢ËÍÉÁ±ä²¨Êý¾Ý°ü
     Mcu_Energy_Get_flick_info();
     g_energy.flick.packet_head.head = MCU_ARM_COM_HEAD;
     g_energy.flick.packet_head.type = 0x41;