From 4c91d4bf82f6db13fcdf6462f9ff8b158fe36f19 Mon Sep 17 00:00:00 2001 From: 95384 <664090429@qq.com> Date: Wed, 27 Nov 2024 16:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E7=9E=AC=E6=97=B6=E9=A3=8E=E9=80=9F?= =?UTF-8?q?=E9=A3=8E=E5=90=91=EF=BC=8C=E6=9E=81=E5=A4=A7=E6=9E=81=E5=B0=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=9B=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Inc/frt_protocol.h | 80 ++++++++++++++------------- App/Src/frt_protocol.c | 122 +++++++++++++++++++++++++++++------------ 2 files changed, 129 insertions(+), 73 deletions(-) diff --git a/App/Inc/frt_protocol.h b/App/Inc/frt_protocol.h index a639737..efe9998 100644 --- a/App/Inc/frt_protocol.h +++ b/App/Inc/frt_protocol.h @@ -22,46 +22,50 @@ typedef enum /* 寄存器地址 */ typedef enum { - FRT_REGISTER_MIN_WIND_DIRECTION = 0, /* 最小风向 */ - FRT_REGISTER_AVERAGE_WIND_DIRECTION = 1, /* 平均风向 */ - FRT_REGISTER_MAX_WIND_DIRECTION = 2, /* 最大风向 */ - FRT_REGISTER_MIN_WIND_SPEED = 3, /* 最小风速 */ - FRT_REGISTER_AVERAGE_WIND_SPEED = 4, /* 平均风速 */ - FRT_REGISTER_MAX_WIND_SPEED = 5, /* 最大风速 */ - FRT_REGISTER_TEMPERATURE = 6, /* 大气温度 */ - FRT_REGISTER_HUMIDITY = 7, /* 大气湿度 */ - FRT_REGISTER_PRESSURE = 8, /* 大气压 */ - FRT_REGISTER_RAIN = 9, /* 雨量 */ - FRT_REGISTER_PRECIPITATION_INTENSITY = 10, /* 总辐射 */ + FRT_REGISTER_MIN_WIND_DIRECTION = 0, /* 最小风向 */ + FRT_REGISTER_AVERAGE_WIND_DIRECTION = 1, /* 平均风向 */ + FRT_REGISTER_INSTANTANEOUS_WIND_DIRECTION = 2, /* 瞬时风向 */ + FRT_REGISTER_MAX_WIND_DIRECTION = 3, /* 最大风向 */ + FRT_REGISTER_MIN_WIND_SPEED = 4, /* 最小风速 */ + FRT_REGISTER_THROUGH_WIND_SPEED = 5, /* 极小风速 */ + FRT_REGISTER_AVERAGE_WIND_SPEED = 6, /* 平均风速 */ + FRT_REGISTER_INSTANTANEOUS_WIND_SPEED = 7, /* 瞬时风速 */ + FRT_REGISTER_PEAK_WIND_SPEED = 8, /* 极大风速 */ + FRT_REGISTER_MAX_WIND_SPEED = 9, /* 最大风速 */ + FRT_REGISTER_TEMPERATURE = 10, /* 大气温度 */ + FRT_REGISTER_HUMIDITY = 11, /* 大气湿度 */ + FRT_REGISTER_PRESSURE = 12, /* 大气压 */ + FRT_REGISTER_RAIN = 13, /* 雨量 */ + FRT_REGISTER_PRECIPITATION_INTENSITY = 14, /* 总辐射 */ - FRT_REGISTER_DEVICE_ADDR = 20, /* 设备地址 */ - FRT_REGISTER_COMMU_BAUDRATE = 21, /* 波特率 */ - FRT_REGISTER_SPEED_AVERAGE_TIME = 22, /* 风速平均时间 */ - FRT_REGISTER_TEMPHUM_UPDATE_TIME = 23, /* 温湿度更新时间 */ - FRT_REGISTER_RAIN_POWER_CONTROL = 24, /* 雨量电源控制 */ - FRT_REGISTER_RAIN_REST = 25, /* 雨量复位 */ - FRT_REGISTER_SOFT_REST = 26, /* 软件复位 */ - FRT_REGISTER_REST_DEFAULT_SETTING = 27, /* 恢复出厂设置 */ - FRT_REGISTER_PROTOCOL_SETTING = 28, /* 设置协议:0-ASCII;1-MODBUS协议 */ + FRT_REGISTER_DEVICE_ADDR = 20, /* 设备地址 */ + FRT_REGISTER_COMMU_BAUDRATE = 21, /* 波特率 */ + FRT_REGISTER_SPEED_AVERAGE_TIME = 22, /* 风速平均时间 */ + FRT_REGISTER_TEMPHUM_UPDATE_TIME = 23, /* 温湿度更新时间 */ + FRT_REGISTER_RAIN_POWER_CONTROL = 24, /* 雨量电源控制 */ + FRT_REGISTER_RAIN_REST = 25, /* 雨量复位 */ + FRT_REGISTER_SOFT_REST = 26, /* 软件复位 */ + FRT_REGISTER_REST_DEFAULT_SETTING = 27, /* 恢复出厂设置 */ + FRT_REGISTER_PROTOCOL_SETTING = 28, /* 设置协议:0-ASCII;1-MODBUS协议 */ - FRT_REGISTER_TRANSDUCER_CFG_1R5 = 30, /* 换能器参数 */ - FRT_REGISTER_TRANSDUCER_CFG_4R5 = 31, /* 换能器参数 */ - FRT_REGISTER_TRANSDUCER_CFG_8R0 = 32, /* 换能器参数 */ - FRT_REGISTER_RSSI_RANGE = 33, /* RSSI有效范围 */ - FRT_REGISTER_DISTANCE = 34, /* 换能器表面距离 */ - FRT_REGISTER_ERROR_LOG = 35, /* 错误日志 */ - FRT_REGISTER_WIND_C = 36, /* 计算得到的风速 */ - FRT_REGISTER_LINEAR_POINT_X_1 = 37, /* 线性插值原始点1 */ - FRT_REGISTER_LINEAR_POINT_X_2 = 38, /* 线性插值原始点2 */ - FRT_REGISTER_LINEAR_POINT_X_3 = 39, /* 线性插值原始点3 */ - FRT_REGISTER_LINEAR_POINT_X_4 = 40, /* 线性插值原始点4 */ - FRT_REGISTER_LINEAR_POINT_X_5 = 41, /* 线性插值原始点5 */ - FRT_REGISTER_LINEAR_POINT_Y_1 = 42, /* 线性插值校准点1 */ - FRT_REGISTER_LINEAR_POINT_Y_2 = 43, /* 线性插值校准点2 */ - FRT_REGISTER_LINEAR_POINT_Y_3 = 44, /* 线性插值校准点3 */ - FRT_REGISTER_LINEAR_POINT_Y_4 = 45, /* 线性插值校准点4 */ - FRT_REGISTER_LINEAR_POINT_Y_5 = 46, /* 线性插值校准点5 */ - FRT_REGISTER_LINEAR_ENABLE = 47, /* 线性插值使能 */ + FRT_REGISTER_TRANSDUCER_CFG_1R5 = 30, /* 换能器参数 */ + FRT_REGISTER_TRANSDUCER_CFG_4R5 = 31, /* 换能器参数 */ + FRT_REGISTER_TRANSDUCER_CFG_8R0 = 32, /* 换能器参数 */ + FRT_REGISTER_RSSI_RANGE = 33, /* RSSI有效范围 */ + FRT_REGISTER_DISTANCE = 34, /* 换能器表面距离 */ + FRT_REGISTER_ERROR_LOG = 35, /* 错误日志 */ + FRT_REGISTER_WIND_C = 36, /* 计算得到的风速 */ + FRT_REGISTER_LINEAR_POINT_X_1 = 37, /* 线性插值原始点1 */ + FRT_REGISTER_LINEAR_POINT_X_2 = 38, /* 线性插值原始点2 */ + FRT_REGISTER_LINEAR_POINT_X_3 = 39, /* 线性插值原始点3 */ + FRT_REGISTER_LINEAR_POINT_X_4 = 40, /* 线性插值原始点4 */ + FRT_REGISTER_LINEAR_POINT_X_5 = 41, /* 线性插值原始点5 */ + FRT_REGISTER_LINEAR_POINT_Y_1 = 42, /* 线性插值校准点1 */ + FRT_REGISTER_LINEAR_POINT_Y_2 = 43, /* 线性插值校准点2 */ + FRT_REGISTER_LINEAR_POINT_Y_3 = 44, /* 线性插值校准点3 */ + FRT_REGISTER_LINEAR_POINT_Y_4 = 45, /* 线性插值校准点4 */ + FRT_REGISTER_LINEAR_POINT_Y_5 = 46, /* 线性插值校准点5 */ + FRT_REGISTER_LINEAR_ENABLE = 47, /* 线性插值使能 */ }FRT_MsgRegister; #pragma pack(push,1) diff --git a/App/Src/frt_protocol.c b/App/Src/frt_protocol.c index 94a41d9..c41616b 100644 --- a/App/Src/frt_protocol.c +++ b/App/Src/frt_protocol.c @@ -17,9 +17,13 @@ static u_int16_t FRT_ReadReg(unsigned char regId); /* 璇 */ static u_int16_t FRT_ReadRegMinWindDiretion(void *pMsg); static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg); +static u_int16_t FRT_ReadRegInstantaneousWindDirection(void *pMsg); static u_int16_t FRT_ReadRegMaxWindDirection(void *pMsg); static u_int16_t FRT_ReadRegMinWindSpeed(void *pMsg); +static u_int16_t FRT_ReadRegThroughWindSpeed(void *pMsg); static u_int16_t FRT_ReadRegAverageWindSpeed(void *pMsg); +static u_int16_t FRT_ReadRegInstantaneousWindSpeed(void *pMsg); +static u_int16_t FRT_ReadRegPeakWindSpeed(void *pMsg); static u_int16_t FRT_ReadRegMaxWindSpeed(void *pMsg); static u_int16_t FRT_ReadRegTemperature(void *pMsg); static u_int16_t FRT_ReadRegHumidity(void *pMsg); @@ -83,40 +87,44 @@ FRT_FuncionMsgProcTable_s g_MsgTbl[] = /* 璇诲瘎瀛樺櫒澶勭悊琛 */ FRT_RegProcTable_s g_RegTbl[] = { - { FRT_REGISTER_MIN_WIND_DIRECTION, FRT_ReadRegMinWindDiretion }, /* 鏈灏忛鍚 */ - { FRT_REGISTER_AVERAGE_WIND_DIRECTION, FRT_ReadRegAverageWindDirection }, /* 骞冲潎椋庡悜 */ - { FRT_REGISTER_MAX_WIND_DIRECTION, FRT_ReadRegMaxWindDirection }, /* 鏈澶ч鍚 */ - { FRT_REGISTER_MIN_WIND_SPEED, FRT_ReadRegMinWindSpeed }, /* 鏈灏忛閫 */ - { FRT_REGISTER_AVERAGE_WIND_SPEED, FRT_ReadRegAverageWindSpeed }, /* 骞冲潎椋庨 */ - { FRT_REGISTER_MAX_WIND_SPEED, FRT_ReadRegMaxWindSpeed }, /* 鏈澶ч閫 */ - { FRT_REGISTER_TEMPERATURE, FRT_ReadRegTemperature }, /* 澶ф皵娓╁害 */ - { FRT_REGISTER_HUMIDITY, FRT_ReadRegHumidity }, /* 澶ф皵婀垮害 */ - { FRT_REGISTER_PRESSURE, FRT_ReadRegPressure }, /* 澶ф皵鍘 */ - { FRT_REGISTER_RAIN, FRT_ReadRegRain }, /* 闆ㄩ噺 */ - { FRT_REGISTER_PRECIPITATION_INTENSITY, FRT_ReadRegPrecipitationIntensity }, /* 鎬昏緪灏 */ - { FRT_REGISTER_DEVICE_ADDR, FRT_ReadRegDeviceAddr }, /* 璁惧鍦板潃 */ - { FRT_REGISTER_COMMU_BAUDRATE, FRT_ReadRegCommuBaudRate }, /* 娉㈢壒鐜 */ - { FRT_REGISTER_SPEED_AVERAGE_TIME, FRT_ReadRegSpeedAverageTime }, /* 椋庨熷钩鍧囨椂闂 */ - { FRT_REGISTER_TEMPHUM_UPDATE_TIME, FRT_ReadRegTempHumUpdateTime }, /* 娓╂箍搴︽洿鏂版椂闂 */ - { FRT_REGISTER_RAIN_POWER_CONTROL, FRT_ReadRegRainPowerCtl }, /* 闆ㄩ噺鐢垫簮鏃堕棿 */ - { FRT_REGISTER_TRANSDUCER_CFG_1R5, FRT_ReadRegTransducerCFG1R5 }, /* 璇绘崲鑳藉櫒鍙傛暟瀵勫瓨鍣ㄥ1R5 */ - { FRT_REGISTER_TRANSDUCER_CFG_4R5, FRT_ReadRegTransducerCFG4R5 }, /* 璇绘崲鑳藉櫒鍙傛暟瀵勫瓨鍣ㄥ4R5 */ - { FRT_REGISTER_TRANSDUCER_CFG_8R0, FRT_ReadRegTransducerCFG8R0 }, /* 璇绘崲鑳藉櫒鍙傛暟瀵勫瓨鍣ㄥ8R0 */ - { FRT_REGISTER_RSSI_RANGE, FRT_ReadRegRSSIRange }, /* 璇籖SSI鏈夋晥鑼冨洿 */ - { FRT_REGISTER_DISTANCE, FRT_ReadRegDISTANCE }, /* 璇绘帰澶磋〃闈㈡湁鏁堣窛绂 */ - { FRT_REGISTER_ERROR_LOG, FRT_ReadRegErrorData }, /* 璇婚敊璇棩蹇 */ - { FRT_REGISTER_WIND_C, FRT_ReadRegWindC }, /* 璇昏绠楀緱鍒扮殑椋庨 */ - { FRT_REGISTER_LINEAR_POINT_X_1, FRT_ReadRegPoint_1X }, /* 绾挎ф彃鍊煎師濮嬬偣1 */ - { FRT_REGISTER_LINEAR_POINT_X_2, FRT_ReadRegPoint_2X }, /* 绾挎ф彃鍊煎師濮嬬偣2 */ - { FRT_REGISTER_LINEAR_POINT_X_3, FRT_ReadRegPoint_3X }, /* 绾挎ф彃鍊煎師濮嬬偣3 */ - { FRT_REGISTER_LINEAR_POINT_X_4, FRT_ReadRegPoint_4X }, /* 绾挎ф彃鍊煎師濮嬬偣4 */ - { FRT_REGISTER_LINEAR_POINT_X_5, FRT_ReadRegPoint_5X }, /* 绾挎ф彃鍊煎師濮嬬偣5 */ - { FRT_REGISTER_LINEAR_POINT_Y_1, FRT_ReadRegPoint_1Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣1 */ - { FRT_REGISTER_LINEAR_POINT_Y_2, FRT_ReadRegPoint_2Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣2 */ - { FRT_REGISTER_LINEAR_POINT_Y_3, FRT_ReadRegPoint_3Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣3 */ - { FRT_REGISTER_LINEAR_POINT_Y_4, FRT_ReadRegPoint_4Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣4 */ - { FRT_REGISTER_LINEAR_POINT_Y_5, FRT_ReadRegPoint_5Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣5 */ - { FRT_REGISTER_LINEAR_ENABLE, FRT_ReadRegLinearEnable }, /* 绾挎ф彃鍊间娇鑳 */ + { FRT_REGISTER_MIN_WIND_DIRECTION, FRT_ReadRegMinWindDiretion }, /* 鏈灏忛鍚 */ + { FRT_REGISTER_AVERAGE_WIND_DIRECTION, FRT_ReadRegAverageWindDirection }, /* 骞冲潎椋庡悜 */ + { FRT_REGISTER_INSTANTANEOUS_WIND_DIRECTION, FRT_ReadRegInstantaneousWindDirection }, /* 鐬椂椋庡悜 */ + { FRT_REGISTER_MAX_WIND_DIRECTION, FRT_ReadRegMaxWindDirection }, /* 鏈澶ч鍚 */ + { FRT_REGISTER_MIN_WIND_SPEED, FRT_ReadRegMinWindSpeed }, /* 鏈灏忛閫 */ + { FRT_REGISTER_THROUGH_WIND_SPEED, FRT_ReadRegThroughWindSpeed }, /* 鏋佸皬椋庨 */ + { FRT_REGISTER_AVERAGE_WIND_SPEED, FRT_ReadRegAverageWindSpeed }, /* 骞冲潎椋庨 */ + { FRT_REGISTER_INSTANTANEOUS_WIND_SPEED, FRT_ReadRegInstantaneousWindSpeed }, /* 鐬椂椋庨 */ + { FRT_REGISTER_PEAK_WIND_SPEED, FRT_ReadRegPeakWindSpeed }, /* 鏋佸ぇ椋庨 */ + { FRT_REGISTER_MAX_WIND_SPEED, FRT_ReadRegMaxWindSpeed }, /* 鏈澶ч閫 */ + { FRT_REGISTER_TEMPERATURE, FRT_ReadRegTemperature }, /* 澶ф皵娓╁害 */ + { FRT_REGISTER_HUMIDITY, FRT_ReadRegHumidity }, /* 澶ф皵婀垮害 */ + { FRT_REGISTER_PRESSURE, FRT_ReadRegPressure }, /* 澶ф皵鍘 */ + { FRT_REGISTER_RAIN, FRT_ReadRegRain }, /* 闆ㄩ噺 */ + { FRT_REGISTER_PRECIPITATION_INTENSITY, FRT_ReadRegPrecipitationIntensity }, /* 鎬昏緪灏 */ + { FRT_REGISTER_DEVICE_ADDR, FRT_ReadRegDeviceAddr }, /* 璁惧鍦板潃 */ + { FRT_REGISTER_COMMU_BAUDRATE, FRT_ReadRegCommuBaudRate }, /* 娉㈢壒鐜 */ + { FRT_REGISTER_SPEED_AVERAGE_TIME, FRT_ReadRegSpeedAverageTime }, /* 椋庨熷钩鍧囨椂闂 */ + { FRT_REGISTER_TEMPHUM_UPDATE_TIME, FRT_ReadRegTempHumUpdateTime }, /* 娓╂箍搴︽洿鏂版椂闂 */ + { FRT_REGISTER_RAIN_POWER_CONTROL, FRT_ReadRegRainPowerCtl }, /* 闆ㄩ噺鐢垫簮鏃堕棿 */ + { FRT_REGISTER_TRANSDUCER_CFG_1R5, FRT_ReadRegTransducerCFG1R5 }, /* 璇绘崲鑳藉櫒鍙傛暟瀵勫瓨鍣ㄥ1R5 */ + { FRT_REGISTER_TRANSDUCER_CFG_4R5, FRT_ReadRegTransducerCFG4R5 }, /* 璇绘崲鑳藉櫒鍙傛暟瀵勫瓨鍣ㄥ4R5 */ + { FRT_REGISTER_TRANSDUCER_CFG_8R0, FRT_ReadRegTransducerCFG8R0 }, /* 璇绘崲鑳藉櫒鍙傛暟瀵勫瓨鍣ㄥ8R0 */ + { FRT_REGISTER_RSSI_RANGE, FRT_ReadRegRSSIRange }, /* 璇籖SSI鏈夋晥鑼冨洿 */ + { FRT_REGISTER_DISTANCE, FRT_ReadRegDISTANCE }, /* 璇绘帰澶磋〃闈㈡湁鏁堣窛绂 */ + { FRT_REGISTER_ERROR_LOG, FRT_ReadRegErrorData }, /* 璇婚敊璇棩蹇 */ + { FRT_REGISTER_WIND_C, FRT_ReadRegWindC }, /* 璇昏绠楀緱鍒扮殑椋庨 */ + { FRT_REGISTER_LINEAR_POINT_X_1, FRT_ReadRegPoint_1X }, /* 绾挎ф彃鍊煎師濮嬬偣1 */ + { FRT_REGISTER_LINEAR_POINT_X_2, FRT_ReadRegPoint_2X }, /* 绾挎ф彃鍊煎師濮嬬偣2 */ + { FRT_REGISTER_LINEAR_POINT_X_3, FRT_ReadRegPoint_3X }, /* 绾挎ф彃鍊煎師濮嬬偣3 */ + { FRT_REGISTER_LINEAR_POINT_X_4, FRT_ReadRegPoint_4X }, /* 绾挎ф彃鍊煎師濮嬬偣4 */ + { FRT_REGISTER_LINEAR_POINT_X_5, FRT_ReadRegPoint_5X }, /* 绾挎ф彃鍊煎師濮嬬偣5 */ + { FRT_REGISTER_LINEAR_POINT_Y_1, FRT_ReadRegPoint_1Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣1 */ + { FRT_REGISTER_LINEAR_POINT_Y_2, FRT_ReadRegPoint_2Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣2 */ + { FRT_REGISTER_LINEAR_POINT_Y_3, FRT_ReadRegPoint_3Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣3 */ + { FRT_REGISTER_LINEAR_POINT_Y_4, FRT_ReadRegPoint_4Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣4 */ + { FRT_REGISTER_LINEAR_POINT_Y_5, FRT_ReadRegPoint_5Y }, /* 绾挎ф彃鍊兼牎鍑嗙偣5 */ + { FRT_REGISTER_LINEAR_ENABLE, FRT_ReadRegLinearEnable }, /* 绾挎ф彃鍊间娇鑳 */ }; /* 鍐欏瘎瀛樺櫒澶勭悊琛 */ @@ -197,6 +205,17 @@ static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg) return FRT_swap_endian_16(value); } +/** + * @brief 璇荤灛鏃堕鍚戝瘎瀛樺櫒鍊 + * @param + * @retval + */ +static u_int16_t FRT_ReadRegInstantaneousWindDirection(void *pMsg) +{ + u_int16_t value = (u_int16_t)(g_stMcs_Para.instantaneous_wind_direction *10); + return FRT_swap_endian_16(value); +} + /** * @brief 璇绘渶澶ч鍚戝瘎瀛樺櫒鍊 * @param @@ -219,6 +238,17 @@ static u_int16_t FRT_ReadRegMinWindSpeed(void *pMsg) return FRT_swap_endian_16(value); } +/** + * @brief 璇绘渶灏忛閫熷瘎瀛樺櫒鍊 + * @param + * @retval + */ +static u_int16_t FRT_ReadRegThroughWindSpeed(void *pMsg) +{ + u_int16_t value=(u_int16_t)(g_stMcs_Para.trough_wind_speed *10); + return FRT_swap_endian_16(value); +} + /** * @brief 璇诲钩鍧囬閫熷瘎瀛樺櫒鍊 * @param @@ -230,6 +260,28 @@ static u_int16_t FRT_ReadRegAverageWindSpeed(void *pMsg) return FRT_swap_endian_16(value); } +/** + * @brief 璇荤灛鏃堕閫熷瘎瀛樺櫒鍊 + * @param + * @retval + */ +static u_int16_t FRT_ReadRegInstantaneousWindSpeed(void *pMsg) +{ + u_int16_t value=(u_int16_t)(g_stMcs_Para.instantaneous_wind_speed *10); + return FRT_swap_endian_16(value); +} + +/** + * @brief 璇绘瀬澶ч閫熷瘎瀛樺櫒鍊 + * @param + * @retval + */ +static u_int16_t FRT_ReadRegPeakWindSpeed(void *pMsg) +{ + u_int16_t value=(u_int16_t)(g_stMcs_Para.peak_wind_speed *10); + return FRT_swap_endian_16(value); +} + /** * @brief 璇绘渶澶ч閫熷瘎瀛樺櫒鍊 * @param @@ -538,7 +590,7 @@ static u_int16_t FRT_ReadRegErrorData(void *pMsg) */ static u_int16_t FRT_ReadRegWindC(void *pMsg) { - u_int16_t value=weather_info.wind_c = 0; + u_int16_t value=(u_int16_t)(weather_info.wind_c *10); return FRT_swap_endian_16(value); }