update 解决相关bug
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -55,7 +55,7 @@
|
||||
/* #define HAL_HASH_MODULE_ENABLED */
|
||||
/* #define HAL_I2C_MODULE_ENABLED */
|
||||
/* #define HAL_I2S_MODULE_ENABLED */
|
||||
/* #define HAL_IWDG_MODULE_ENABLED */
|
||||
#define HAL_IWDG_MODULE_ENABLED
|
||||
/* #define HAL_LTDC_MODULE_ENABLED */
|
||||
/* #define HAL_RNG_MODULE_ENABLED */
|
||||
/* #define HAL_RTC_MODULE_ENABLED */
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "dma.h"
|
||||
#include "iwdg.h"
|
||||
#include "spi.h"
|
||||
#include "usart.h"
|
||||
#include "gpio.h"
|
||||
@@ -73,7 +74,7 @@ int main(void)
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||
HAL_Init();
|
||||
HAL_Init();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
@@ -96,6 +97,7 @@ int main(void)
|
||||
MX_SPI2_Init();
|
||||
MX_USART3_UART_Init();
|
||||
MX_USART6_UART_Init();
|
||||
// MX_IWDG_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
app_init();
|
||||
//HAL_GPIO_WritePin(JK1_GPIO_Port,JK1_Pin,GPIO_PIN_SET);
|
||||
@@ -130,8 +132,9 @@ void SystemClock_Config(void)
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
|
||||
@@ -407,6 +407,62 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>../Core/Src/dma.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>iwdg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>../Core/Src/iwdg.c</FilePath>
|
||||
<FileOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>2</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>2</AlwaysBuild>
|
||||
<GenerateAssemblyFile>2</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>2</AssembleAssemblyFile>
|
||||
<PublicsOnly>2</PublicsOnly>
|
||||
<StopOnExitCode>11</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<FileArmAds>
|
||||
<Cads>
|
||||
<interw>2</interw>
|
||||
<Optim>0</Optim>
|
||||
<oTime>2</oTime>
|
||||
<SplitLS>2</SplitLS>
|
||||
<OneElfS>2</OneElfS>
|
||||
<Strict>2</Strict>
|
||||
<EnumInt>2</EnumInt>
|
||||
<PlainCh>2</PlainCh>
|
||||
<Ropi>2</Ropi>
|
||||
<Rwpi>2</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>2</uThumb>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<uC99>2</uC99>
|
||||
<uGnu>2</uGnu>
|
||||
<useXO>2</useXO>
|
||||
<v6Lang>0</v6Lang>
|
||||
<v6LangP>0</v6LangP>
|
||||
<vShortEn>2</vShortEn>
|
||||
<vShortWch>2</vShortWch>
|
||||
<v6Lto>2</v6Lto>
|
||||
<v6WtE>2</v6WtE>
|
||||
<v6Rtti>2</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
</FileArmAds>
|
||||
</FileOption>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>spi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -484,9 +540,9 @@
|
||||
<GroupName>Drivers/STM32F4xx_HAL_Driver</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_spi.c</FileName>
|
||||
<FileName>stm32f4xx_hal_iwdg.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c</FilePath>
|
||||
<FilePath>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c</FilePath>
|
||||
<FileOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>2</UseCPPCompiler>
|
||||
@@ -604,6 +660,62 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_spi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c</FilePath>
|
||||
<FileOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>2</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>2</AlwaysBuild>
|
||||
<GenerateAssemblyFile>2</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>2</AssembleAssemblyFile>
|
||||
<PublicsOnly>2</PublicsOnly>
|
||||
<StopOnExitCode>11</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<FileArmAds>
|
||||
<Cads>
|
||||
<interw>2</interw>
|
||||
<Optim>0</Optim>
|
||||
<oTime>2</oTime>
|
||||
<SplitLS>2</SplitLS>
|
||||
<OneElfS>2</OneElfS>
|
||||
<Strict>2</Strict>
|
||||
<EnumInt>2</EnumInt>
|
||||
<PlainCh>2</PlainCh>
|
||||
<Ropi>2</Ropi>
|
||||
<Rwpi>2</Rwpi>
|
||||
<wLevel>0</wLevel>
|
||||
<uThumb>2</uThumb>
|
||||
<uSurpInc>2</uSurpInc>
|
||||
<uC99>2</uC99>
|
||||
<uGnu>2</uGnu>
|
||||
<useXO>2</useXO>
|
||||
<v6Lang>0</v6Lang>
|
||||
<v6LangP>0</v6LangP>
|
||||
<vShortEn>2</vShortEn>
|
||||
<vShortWch>2</vShortWch>
|
||||
<v6Lto>2</v6Lto>
|
||||
<v6WtE>2</v6WtE>
|
||||
<v6Rtti>2</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
</FileArmAds>
|
||||
</FileOption>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32f4xx_hal_tim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Stack_Size EQU 0x800
|
||||
Stack_Size EQU 0x400
|
||||
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
@@ -40,7 +40,7 @@ __initial_sp
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Heap_Size EQU 0x400
|
||||
Heap_Size EQU 0x200
|
||||
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
|
||||
@@ -115,21 +115,25 @@ Dma.USART6_TX.9.Priority=DMA_PRIORITY_LOW
|
||||
Dma.USART6_TX.9.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
|
||||
File.Version=6
|
||||
GPIO.groupedBy=Group By Peripherals
|
||||
IWDG.IPParameters=Reload,Prescaler
|
||||
IWDG.Prescaler=IWDG_PRESCALER_128
|
||||
IWDG.Reload=750
|
||||
KeepUserPlacement=false
|
||||
Mcu.CPN=STM32F407VGT6
|
||||
Mcu.Family=STM32F4
|
||||
Mcu.IP0=DMA
|
||||
Mcu.IP1=NVIC
|
||||
Mcu.IP10=USART6
|
||||
Mcu.IP2=RCC
|
||||
Mcu.IP3=SPI1
|
||||
Mcu.IP4=SPI2
|
||||
Mcu.IP5=SYS
|
||||
Mcu.IP6=UART4
|
||||
Mcu.IP7=USART1
|
||||
Mcu.IP8=USART2
|
||||
Mcu.IP9=USART3
|
||||
Mcu.IPNb=11
|
||||
Mcu.IP1=IWDG
|
||||
Mcu.IP10=USART3
|
||||
Mcu.IP11=USART6
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=RCC
|
||||
Mcu.IP4=SPI1
|
||||
Mcu.IP5=SPI2
|
||||
Mcu.IP6=SYS
|
||||
Mcu.IP7=UART4
|
||||
Mcu.IP8=USART1
|
||||
Mcu.IP9=USART2
|
||||
Mcu.IPNb=12
|
||||
Mcu.Name=STM32F407V(E-G)Tx
|
||||
Mcu.Package=LQFP100
|
||||
Mcu.Pin0=PH0-OSC_IN
|
||||
@@ -164,14 +168,15 @@ Mcu.Pin34=PB5
|
||||
Mcu.Pin35=PB6
|
||||
Mcu.Pin36=PB7
|
||||
Mcu.Pin37=PB8
|
||||
Mcu.Pin38=VP_SYS_VS_Systick
|
||||
Mcu.Pin38=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin39=VP_SYS_VS_Systick
|
||||
Mcu.Pin4=PA2
|
||||
Mcu.Pin5=PA3
|
||||
Mcu.Pin6=PA5
|
||||
Mcu.Pin7=PA6
|
||||
Mcu.Pin8=PA7
|
||||
Mcu.Pin9=PC4
|
||||
Mcu.PinsNb=39
|
||||
Mcu.PinsNb=40
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F407VGTx
|
||||
@@ -366,7 +371,7 @@ ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UAScriptAfterPath=
|
||||
ProjectManager.UAScriptBeforePath=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_UART4_Init-UART4-false-HAL-true,5-MX_USART1_UART_Init-USART1-false-HAL-true,6-MX_USART2_UART_Init-USART2-false-HAL-true,7-MX_SPI1_Init-SPI1-false-HAL-true,8-MX_SPI2_Init-SPI2-false-HAL-true,9-MX_USART3_UART_Init-USART3-false-HAL-true,10-MX_USART6_UART_Init-USART6-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_UART4_Init-UART4-false-HAL-true,5-MX_USART1_UART_Init-USART1-false-HAL-true,6-MX_USART2_UART_Init-USART2-false-HAL-true,7-MX_SPI1_Init-SPI1-false-HAL-true,8-MX_SPI2_Init-SPI2-false-HAL-true,9-MX_USART3_UART_Init-USART3-false-HAL-true,10-MX_USART6_UART_Init-USART6-false-HAL-true,11-MX_IWDG_Init-IWDG-false-HAL-true
|
||||
RCC.48MHZClocksFreq_Value=84000000
|
||||
RCC.AHBFreq_Value=168000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||
@@ -423,6 +428,8 @@ USART3.IPParameters=VirtualMode
|
||||
USART3.VirtualMode=VM_ASYNC
|
||||
USART6.IPParameters=VirtualMode
|
||||
USART6.VirtualMode=VM_ASYNC
|
||||
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
|
||||
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
board=custom
|
||||
|
||||
@@ -57,6 +57,7 @@ app_timer_class_t app_timer_task[] =
|
||||
******************************************/
|
||||
void app_init(void)
|
||||
{
|
||||
// Wdg.Init();
|
||||
/*flash*/
|
||||
w25q32.init();
|
||||
|
||||
@@ -72,6 +73,8 @@ void app_init(void)
|
||||
/*<2A><><EFBFBD><EFBFBD>*/
|
||||
W5500.Init();
|
||||
|
||||
|
||||
|
||||
/*<2A><>ĻͨѶ*/
|
||||
tjc_hmi.init();
|
||||
|
||||
@@ -89,7 +92,6 @@ void app_init(void)
|
||||
relay.init();
|
||||
buzzer.init();
|
||||
led.init();
|
||||
|
||||
leakage.init();
|
||||
/*com<6F>ڰ<EFBFBD><DAB0><EFBFBD>*/
|
||||
app_com.init();
|
||||
@@ -97,8 +99,7 @@ void app_init(void)
|
||||
|
||||
/*<2A><>ʱ<EFBFBD><CAB1><EFBFBD>ã<EFBFBD>ʱ<EFBFBD><CAB1>Ƭ<EFBFBD><C6AC>ѯ*/
|
||||
app_timer.init(APP_TIMER_TASK_NUM,app_timer_task);
|
||||
|
||||
//Wdg.Init();
|
||||
|
||||
}
|
||||
|
||||
/******************************************
|
||||
@@ -112,7 +113,7 @@ void app_task(void)
|
||||
{
|
||||
app_timer.task();
|
||||
task_idle();
|
||||
W5500.Task();
|
||||
// W5500.Task();
|
||||
}
|
||||
/*<2A><><EFBFBD><EFBFBD>ִ<EFBFBD>еĺ<D0B5><C4BA><EFBFBD>*/
|
||||
void task_idle(void)
|
||||
@@ -123,6 +124,7 @@ void task_idle(void)
|
||||
com_uart4.rx_task(&com_uart4);
|
||||
com_uart6.rx_task(&com_uart6);
|
||||
W5500.Task();
|
||||
// Wdg.Feed();
|
||||
}
|
||||
|
||||
void task_10ms(void)
|
||||
@@ -160,6 +162,7 @@ void task_1s(void)
|
||||
DS1302.Task();
|
||||
buzzer.task();
|
||||
relay.task();
|
||||
W5500.Monitor_task();
|
||||
}
|
||||
|
||||
void task_2s(void)
|
||||
|
||||
@@ -163,7 +163,7 @@ void app_leakage_task(void)
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> */
|
||||
if(p_leakage->sub_device_data[sub_device_index].flash_data.shield != UNBLOCKED)
|
||||
if(p_leakage->sub_device_data[sub_device_index].shield != UNBLOCKED)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ typedef struct
|
||||
{
|
||||
u8 state; /*״̬ ʹ<><CAB9> <20><>ʹ<EFBFBD><CAB9>*/
|
||||
u8 com; /*<2A>˿<EFBFBD>*/
|
||||
u8 baudrate; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
u8 shield; /*<2A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>״̬*/
|
||||
u8 baudrate; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
u8 modbus_id; /*modbus id*/
|
||||
u8 device_name[APP_LEAKAGE_STRING_NANE_LEN]; /*<2A>豸<EFBFBD><E8B1B8>*/
|
||||
u8 region_name[APP_LEAKAGE_STRING_NANE_LEN]; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
@@ -45,6 +44,7 @@ typedef struct
|
||||
}ch_data[APP_LEAKAGE_SUB_DEVICE_CH_NUM]; /*ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
u8 heartbeat; /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-59ѭ<39><D1AD>*/
|
||||
u8 test_mode; /*<2A><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>0=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1-4=<3D><><EFBFBD>Զ<EFBFBD>Ӧͨ<D3A6><CDA8>*/
|
||||
u8 shield; /*<2A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>״̬*/
|
||||
}app_leakage_sub_device_class_t;
|
||||
|
||||
|
||||
@@ -59,6 +59,14 @@ typedef struct
|
||||
u8 sub_device_index[APP_LEAKAGE_SUB_DEVICE_NUM]; /*<2A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
}app_leakage_region_data_class_t;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýṹ<C3BD><E1B9B9> */
|
||||
typedef struct {
|
||||
u8 ip[4];
|
||||
u8 mask[4];
|
||||
u8 gateway[4];
|
||||
u16 port;
|
||||
}network_config_t;
|
||||
|
||||
/* <20><>ʷ<EFBFBD><CAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>ṹ */
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -20,10 +20,13 @@
|
||||
#define BSP_W5500_PORT_DATA_RECEIVE 0x01 /*<2A>˿ڽ<CBBF><DABD>յ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>*/
|
||||
#define BSP_W5500_PORT_DATA_TRANSMITOK 0x02 /*<2A>˿ڷ<CBBF><DAB7><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
|
||||
static u8 last_link_status = 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>·״̬
|
||||
|
||||
static void bsp_W5500_Interrupt_Process(void);
|
||||
static void bsp_W5500_Init(void);
|
||||
static void bsp_W5500_Task(void);
|
||||
static void Write_SOCK_Data_Buffer(bsp_W5500_Class_t *pW5500_Class, u8 *dat_ptr, u16 size);
|
||||
static void network_monitor_task(void);
|
||||
|
||||
bsp_W5500_t W5500 =
|
||||
{
|
||||
@@ -36,6 +39,7 @@ bsp_W5500_t W5500 =
|
||||
|
||||
.Init = bsp_W5500_Init,
|
||||
.Task = bsp_W5500_Task,
|
||||
.Monitor_task = network_monitor_task,
|
||||
.Socket_Send = Write_SOCK_Data_Buffer,
|
||||
|
||||
.W5500_Class[0] =
|
||||
@@ -741,7 +745,7 @@ void bsp_W5500_Socket_Set(bsp_W5500_Class_t *pW5500_Class)
|
||||
|
||||
static void bsp_W5500_Init()
|
||||
{
|
||||
u8 i;
|
||||
u8 i,ver;
|
||||
W5500_Hardware_Reset(); /*Ӳ<><D3B2><EFBFBD><EFBFBD>λW5500*/
|
||||
W5500_Init(); /*<2A><>ʼ<EFBFBD><CABC>W5500<30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
Detect_Gateway(); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
@@ -751,7 +755,9 @@ static void bsp_W5500_Init()
|
||||
bsp_W5500_Socket_Init(&pW5500->W5500_Class[i]);
|
||||
pW5500->W5500_Class[i].Run_State = 0; /*<2A><>λ״̬*/
|
||||
//bsp_W5500_Socket_Set(&pW5500->W5500_Class[i]); /*W5500<30>˿ڳ<CBBF>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void bsp_W5500_Task(void)
|
||||
@@ -781,3 +787,25 @@ static void bsp_W5500_Task(void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief <20><>ȡ W5500 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·״̬
|
||||
* @return 1: <20><>·<EFBFBD><C2B7><EFBFBD><EFBFBD>, 0: <20><>·<EFBFBD>Ͽ<EFBFBD>
|
||||
*/
|
||||
static u8 w5500_get_link_status(void)
|
||||
{
|
||||
u8 phycfgr = Read_W5500_1Byte(PHYCFGR); // <20><>ȡ PHYCFGR <20>Ĵ<EFBFBD><C4B4><EFBFBD>
|
||||
return (phycfgr & LINK) ? 1 : 0; // <20><><EFBFBD><EFBFBD> LINK λ
|
||||
}
|
||||
|
||||
|
||||
static void network_monitor_task(void)
|
||||
{
|
||||
u8 current_link = w5500_get_link_status();
|
||||
|
||||
if (last_link_status == 0 && current_link == 1) {
|
||||
/*<2A><>·<EFBFBD>ӶϿ<D3B6><CFBF><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ӣ<EFBFBD>ִ<EFBFBD>лָ<D0BB><D6B8><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
W5500.Init();
|
||||
}
|
||||
|
||||
last_link_status = current_link;
|
||||
}
|
||||
|
||||
@@ -261,6 +261,7 @@ typedef struct
|
||||
void (*Interrupt_Process)(void); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
void (*Init)(void); /*<2A><>ʼ<EFBFBD><CABC>*/
|
||||
void (*Task)(void); /*<2A><><EFBFBD><EFBFBD>*/
|
||||
void (*Monitor_task)(void); /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
void (*Socket_Send)(bsp_W5500_Class_t *, u8 *, u16 ); /*<2A>˿ڷ<CBBF><DAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
}bsp_W5500_t;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "bsp_Wdg.h"
|
||||
|
||||
//#include "iwdg.h"
|
||||
#include "iwdg.h"
|
||||
|
||||
static void bsp_Wdg_Init(void);
|
||||
static void bsp_Wdg_Feed(void);
|
||||
@@ -15,11 +15,12 @@ bsp_Wdg_t *pWdg = &Wdg;
|
||||
|
||||
static void bsp_Wdg_Init(void)
|
||||
{
|
||||
// __HAL_DBGMCU_FREEZE_IWDG(); //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3>£<EFBFBD><C2A3><EFBFBD><EFBFBD>ῴ<EFBFBD>Ź<EFBFBD><C5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
__HAL_DBGMCU_FREEZE_IWDG(); //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3>£<EFBFBD><C2A3><EFBFBD><EFBFBD>ῴ<EFBFBD>Ź<EFBFBD><C5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
Wdg.Feed();
|
||||
}
|
||||
|
||||
static void bsp_Wdg_Feed(void)
|
||||
{
|
||||
// HAL_IWDG_Refresh(&hiwdg);
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "app_leakage.h"
|
||||
#include "bsp_W5500.h"
|
||||
|
||||
/* spi flash Ƭѡ<C6AC><D1A1><EFBFBD><EFBFBD> - pb12 */
|
||||
#define W25Q32_CS_LOW() HAL_GPIO_WritePin(SPI2_CS_GPIO_Port, SPI2_CS_Pin, GPIO_PIN_RESET)
|
||||
@@ -95,12 +96,27 @@ static void gui_tjc_hmi_read_device_info_from_w25q(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void gui_tjc_hmi_read_network_config_from_w25q(void)
|
||||
{
|
||||
network_config_t config;
|
||||
w25q32.read(W25Q32_NETWORK_CONFIG_ADDR, (uint8_t*)&config, sizeof(config));
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ԣ<EFBFBD><D4A3>жϵ<D0B6>һ<EFBFBD><D2BB>IP<49>ֽڲ<D6BD><DAB2><EFBFBD>0xFF<46><46><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݣ<EFBFBD> */
|
||||
if (config.ip[0] != 0xFF && config.ip[0] != 0x00) {
|
||||
memcpy(W5500.IP_Addr, config.ip, 4);
|
||||
memcpy(W5500.Sub_Mask, config.mask, 4);
|
||||
memcpy(W5500.Gateway_IP, config.gateway, 4);
|
||||
W5500.W5500_Class[0].ConfigData.Port[0] = (config.port >> 8) & 0xFF;
|
||||
W5500.W5500_Class[0].ConfigData.Port[1] = config.port & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
static void w25q32_init(void) {
|
||||
W25Q32_CS_HIGH(); /* <20><>ʼʱƬѡ<C6AC><D1A1><EFBFBD><EFBFBD> */
|
||||
w25q32_wake_up(); /* <20><><EFBFBD><EFBFBD>оƬ */
|
||||
gui_tjc_hmi_read_device_info_from_w25q();
|
||||
gui_tjc_hmi_read_network_config_from_w25q();
|
||||
}
|
||||
|
||||
/* <20><>ȡоƬid */
|
||||
|
||||
@@ -55,6 +55,8 @@ void w25q32_sector_erase(uint32_t sector_addr);
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4>洢<EFBFBD><E6B4A2>ַ - ʹ<>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>14<31><34> */
|
||||
#define W25Q32_BUZZER_STATE_ADDR 0x00E000 /*<2A>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC>1<EFBFBD>ֽڣ<D6BD>*/
|
||||
|
||||
#define W25Q32_NETWORK_CONFIG_ADDR 0x00F000 /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô洢<C3B4><E6B4A2>ַ<EFBFBD><D6B7>ʹ<EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
/* w25q32 <20><><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9> */
|
||||
typedef struct {
|
||||
void (*init)(void);
|
||||
|
||||
@@ -39,6 +39,16 @@
|
||||
#define HMI_PROTO_GUI_HELP (0x17)/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#define HMI_PROTO_GUI_TIME (0x18)/*ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>*/
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD>ID*/
|
||||
#define GUI_MAIN (10)/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
#define GUI_CURR_ALARM (11)/*ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
#define GUI_DETALL_MAIN (12)/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F>ϸ<EFBFBD><CFB8>Ϣ*/
|
||||
#define GUI_LOGIN (13)/*<2A><>½<EFBFBD><C2BD><EFBFBD><EFBFBD>*/
|
||||
#define GUI_HISTORY_ALARM (14)/*<2A><>ʷ<EFBFBD><CAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
#define GUI_TCP_CONFIG (15)/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>*/
|
||||
#define GUI_DEVICE_CONFIG (16)/*<2A>豸<EFBFBD><E8B1B8><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>*/
|
||||
#define GUI_TIME (18)/*ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD>*/
|
||||
|
||||
#define HMI_PROTO_ASCII_RX_DELINITER (0xAA)/*<2A><><EFBFBD>շָ<D5B7><D6B8><EFBFBD>*/
|
||||
|
||||
#define HMI_PROTO_ASCII_TX_DELINITER (0xFF)/*<2A><><EFBFBD>ͷָ<CDB7><D6B8><EFBFBD>*/
|
||||
@@ -125,7 +135,7 @@ static void gui_tjc_hmi_read_password_from_w25q(void)
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>뱣<EFBFBD>浽W25Q32*/
|
||||
static void gui_tjc_hmi_save_password_to_w25q(void)
|
||||
{
|
||||
uint32_t erase_addr = W25Q32_PASSWORD_ADDR & ~(W25Q32_SECTOR_SIZE - 1);
|
||||
u32 erase_addr = W25Q32_PASSWORD_ADDR & ~(W25Q32_SECTOR_SIZE - 1);
|
||||
w25q32_sector_erase(erase_addr);
|
||||
/*<2A><>4<EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>W25Q32*/
|
||||
w25q32.write(W25Q32_PASSWORD_ADDR, p_tjc_hmi->password, 4);
|
||||
@@ -144,7 +154,7 @@ static void gui_tjc_hmi_save_device_info_to_w25q(void)
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>Flash<73><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4> */
|
||||
uint32_t erase_addr = W25Q32_DEVICE_INFO_ADDR;
|
||||
u32 erase_addr = W25Q32_DEVICE_INFO_ADDR;
|
||||
|
||||
/* ȷ<><C8B7><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>4K<34><4B><EFBFBD>루W25Q32_SECTOR_SIZE = 4096<39><36> */
|
||||
erase_addr &= ~(W25Q32_SECTOR_SIZE - 1);
|
||||
@@ -158,6 +168,24 @@ static void gui_tjc_hmi_save_device_info_to_w25q(void)
|
||||
DEVICE_INFO_STORAGE_SIZE);
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>ǰW5500<30><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><C3B1>浽W25Q32 */
|
||||
static void gui_tjc_hmi_save_network_config_to_w25q(void)
|
||||
{
|
||||
network_config_t config;
|
||||
memcpy(config.ip, W5500.IP_Addr, 4);
|
||||
memcpy(config.mask, W5500.Sub_Mask, 4);
|
||||
memcpy(config.gateway, W5500.Gateway_IP, 4);
|
||||
config.port = (W5500.W5500_Class[0].ConfigData.Port[0] << 8) |
|
||||
W5500.W5500_Class[0].ConfigData.Port[1];
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4K<34><4B><EFBFBD>룩 */
|
||||
u32 erase_addr = W25Q32_NETWORK_CONFIG_ADDR & ~(W25Q32_SECTOR_SIZE - 1);
|
||||
w25q32_sector_erase(erase_addr);
|
||||
|
||||
/* д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
w25q32.write(W25Q32_NETWORK_CONFIG_ADDR, (uint8_t*)&config, sizeof(config));
|
||||
}
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>纯<EFBFBD><E7BAAF>*/
|
||||
static void parse_ip_string(u8 *str, u8 len, u8 *ip)
|
||||
{
|
||||
@@ -182,7 +210,7 @@ buffer
|
||||
format<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
...<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
static u16 gui_tjc_hmi_tx_text_display(u16 x,u16 y,char *buffer,const char *format,...)
|
||||
static u16 gui_tjc_hmi_tx_text_display(u16 z,u16 x,u16 y,char *buffer,const char *format,...)
|
||||
{
|
||||
u16 i,len;
|
||||
s16 state;
|
||||
@@ -202,7 +230,7 @@ static u16 gui_tjc_hmi_tx_text_display(u16 x,u16 y,char *buffer,const char *form
|
||||
}
|
||||
|
||||
/*ƴ<><C6B4><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>*/
|
||||
sprintf(buffer,"t%d_%d.txt=\"%s\"",x,y,gui_tjc_hmi_text_buffer);
|
||||
sprintf(buffer,"t%d_%d_%d.txt=\"%s\"",z,x,y,gui_tjc_hmi_text_buffer);
|
||||
len = strlen(buffer);
|
||||
for(i=0;i<HMI_PROTO_ASCII_TX_DELINITER_NUM;i++)
|
||||
{
|
||||
@@ -240,10 +268,10 @@ static void gui_tjc_hmi_main_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
DS1302.Time.Hour,
|
||||
DS1302.Time.Minute,
|
||||
DS1302.Time.Second);
|
||||
len += gui_tjc_hmi_tx_text_display(0,0,(char *)&hmi_tx_buffer[len],"%s",time);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,0,0,(char *)&hmi_tx_buffer[len],"%s",time);
|
||||
|
||||
/*IP<49><50>ַ*/
|
||||
len += gui_tjc_hmi_tx_text_display(0,1,(char *)&hmi_tx_buffer[len],
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,0,1,(char *)&hmi_tx_buffer[len],
|
||||
"%d.%d.%d.%d",
|
||||
W5500.IP_Addr[0],
|
||||
W5500.IP_Addr[1],
|
||||
@@ -272,7 +300,7 @@ static void gui_tjc_hmi_main_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
{
|
||||
for (y = 0; y < 5; y++)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(j+1, y+1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,j+1, y+1, (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -286,36 +314,36 @@ static void gui_tjc_hmi_main_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
x = j;
|
||||
/*<2A><><EFBFBD><EFBFBD>*/
|
||||
y = 0;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.region_data[index].name);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.region_data[index].name);
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
y = 1;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].sub_device_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].sub_device_num);
|
||||
/*©Һ<C2A9><D2BA><EFBFBD><EFBFBD>*/
|
||||
y = 2;
|
||||
if(leakage.region_data[index].leakage_num == 0)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].leakage_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].leakage_num);
|
||||
}
|
||||
/*<2A>ϴ<EFBFBD>*/
|
||||
y = 3;
|
||||
if(leakage.region_data[index].open_num == 0)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].open_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].open_num);
|
||||
}
|
||||
/*ͨѶ*/
|
||||
y = 4;
|
||||
if(leakage.region_data[index].time_out_num == 0)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].time_out_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].time_out_num);
|
||||
}
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -323,7 +351,7 @@ static void gui_tjc_hmi_main_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
{
|
||||
for(y = 0; y < 5; y++) // <20><><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(j+1, y+1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,j+1, y+1, (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -335,36 +363,36 @@ static void gui_tjc_hmi_main_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
x = j;
|
||||
/*<2A><><EFBFBD><EFBFBD>*/
|
||||
y = 0;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.region_data[index].name);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.region_data[index].name);
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
y = 1;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].sub_device_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].sub_device_num);
|
||||
/*©Һ<C2A9><D2BA><EFBFBD><EFBFBD>*/
|
||||
y = 2;
|
||||
if(leakage.region_data[index].leakage_num == 0)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].leakage_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].leakage_num);
|
||||
}
|
||||
/*<2A>ϴ<EFBFBD>*/
|
||||
y = 3;
|
||||
if(leakage.region_data[index].open_num == 0)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].open_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].open_num);
|
||||
}
|
||||
/*ͨѶ*/
|
||||
y = 4;
|
||||
if(leakage.region_data[index].time_out_num == 0)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s","Normal");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].time_out_num);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_MAIN,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.region_data[index].time_out_num);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,7 +473,7 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
continue ;
|
||||
}
|
||||
|
||||
if(UNBLOCKED != leakage.sub_device_data[i].flash_data.shield)
|
||||
if(UNBLOCKED != leakage.sub_device_data[i].shield)
|
||||
{
|
||||
continue ;
|
||||
}
|
||||
@@ -492,15 +520,15 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
y = 0;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.region_name);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.region_name);
|
||||
|
||||
/*<2A>豸ID*/
|
||||
y = 1;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.sub_device_data[device_index].flash_data.modbus_id);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.sub_device_data[device_index].flash_data.modbus_id);
|
||||
|
||||
/*<2A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>*/
|
||||
y = 2;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.device_name);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.device_name);
|
||||
|
||||
/*ͨѶ״̬*/
|
||||
y =3;
|
||||
@@ -515,10 +543,10 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
}
|
||||
if(comm_state & APP_LEAKAGE_SUB_DEVICE_STATE_TIME_OUT)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>쳣");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>쳣");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/*ͨ<><CDA8>״̬*/
|
||||
@@ -530,28 +558,28 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
y = 4 + (ch * 3);
|
||||
if(ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"©Һ");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"©Һ");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
y =5 + (ch * 3);
|
||||
if(ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_OPEN)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>ϴ<EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>ϴ<EFBFBD>");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
y = 6 + (ch * 3);
|
||||
if(ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",ch_distance);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",ch_distance);
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"0");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -567,15 +595,15 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
y = 0;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.region_name);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.region_name);
|
||||
|
||||
/*<2A>豸ID*/
|
||||
y = 1;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.sub_device_data[device_index].flash_data.modbus_id);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",leakage.sub_device_data[device_index].flash_data.modbus_id);
|
||||
|
||||
/*<2A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>*/
|
||||
y = 2;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.device_name);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%s",leakage.sub_device_data[device_index].flash_data.device_name);
|
||||
|
||||
/*ͨѶ״̬*/
|
||||
y =3;
|
||||
@@ -590,10 +618,10 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
}
|
||||
if(comm_state & APP_LEAKAGE_SUB_DEVICE_STATE_TIME_OUT)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>쳣");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>쳣");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
/*ͨ<><CDA8>״̬*/
|
||||
@@ -605,28 +633,28 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
y = 4 + (ch * 3);
|
||||
if(ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"©Һ");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"©Һ");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
y =5 + (ch * 3);
|
||||
if(ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_OPEN)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>ϴ<EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD>ϴ<EFBFBD>");
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
|
||||
y = 6 + (ch * 3);
|
||||
if(ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",ch_distance);
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"%d",ch_distance);
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1,y+1,(char *)&hmi_tx_buffer[len],"0");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x+1,y+1,(char *)&hmi_tx_buffer[len],"0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -634,15 +662,15 @@ static void gui_tjc_hmi_curr_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
for (; j < REAL_ALARM_PAGE_NUM; j++)
|
||||
{
|
||||
x = j;
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 1, (char *)&hmi_tx_buffer[len], ""); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 2, (char *)&hmi_tx_buffer[len], ""); // <20>豸ID
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 3, (char *)&hmi_tx_buffer[len], ""); // <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 4, (char *)&hmi_tx_buffer[len], ""); // ͨѶ״̬
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 1, (char *)&hmi_tx_buffer[len], ""); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 2, (char *)&hmi_tx_buffer[len], ""); // <20>豸ID
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 3, (char *)&hmi_tx_buffer[len], ""); // <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 4, (char *)&hmi_tx_buffer[len], ""); // ͨѶ״̬
|
||||
for (ch = 0; ch < APP_LEAKAGE_SUB_DEVICE_CH_NUM; ch++)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 5 + (ch * 3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 6 + (ch * 3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(x + 1, 7 + (ch * 3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 5 + (ch * 3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 6 + (ch * 3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_CURR_ALARM,x + 1, 7 + (ch * 3), (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
}
|
||||
}break;
|
||||
@@ -757,14 +785,14 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
|
||||
/* <20>豸ID: t(x+1)_1 */
|
||||
y = 0;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%d",
|
||||
leakage.sub_device_data[sub_device_index].flash_data.modbus_id);
|
||||
|
||||
/* <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>: t(x+1)_2 */
|
||||
y = 1;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
leakage.sub_device_data[sub_device_index].flash_data.device_name);
|
||||
@@ -781,23 +809,23 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(leakage.sub_device_data[sub_device_index].flash_data.shield == UNBLOCKED)
|
||||
if(leakage.sub_device_data[sub_device_index].shield == UNBLOCKED)
|
||||
{
|
||||
if (comm_state)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD>ʱ");
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
@@ -811,23 +839,23 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
|
||||
/* ©Һ״̬ */
|
||||
y = 3 + (ch * 3);
|
||||
if(leakage.sub_device_data[sub_device_index].flash_data.shield == UNBLOCKED)
|
||||
if(leakage.sub_device_data[sub_device_index].shield == UNBLOCKED)
|
||||
{
|
||||
if (ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"©Һ");
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
@@ -835,23 +863,23 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
|
||||
/* <20>ϴ<EFBFBD>״̬ */
|
||||
y = 4 + (ch * 3);
|
||||
if(leakage.sub_device_data[sub_device_index].flash_data.shield == UNBLOCKED)
|
||||
if(leakage.sub_device_data[sub_device_index].shield == UNBLOCKED)
|
||||
{
|
||||
if (ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_OPEN)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD>ϴ<EFBFBD>");
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
@@ -859,24 +887,24 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
|
||||
/* ©Һλ<D2BA><CEBB> */
|
||||
y = 5 + (ch * 3);
|
||||
if(leakage.sub_device_data[sub_device_index].flash_data.shield == UNBLOCKED)
|
||||
if(leakage.sub_device_data[sub_device_index].shield == UNBLOCKED)
|
||||
{
|
||||
if (ch_state & APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%d",
|
||||
ch_distance);
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"0");
|
||||
}
|
||||
}else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"0");
|
||||
}
|
||||
@@ -884,13 +912,13 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
}
|
||||
/* <20><><EFBFBD><EFBFBD>״̬<D7B4><CCAC>ʾ: t(x+1)_16 */
|
||||
y = 15; // <20><>16<31>ж<EFBFBD>Ӧy=15
|
||||
if (leakage.sub_device_data[sub_device_index].flash_data.shield == BLOCKED)
|
||||
if (leakage.sub_device_data[sub_device_index].shield == BLOCKED)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1, (char *)&hmi_tx_buffer[len], "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1, (char *)&hmi_tx_buffer[len], "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, y+1, (char *)&hmi_tx_buffer[len], "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, y+1, (char *)&hmi_tx_buffer[len], "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,16 +926,16 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
for (; i < DETAIL_MAIN_NUM; i++)
|
||||
{
|
||||
x = i;
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
for (ch = 0; ch < APP_LEAKAGE_SUB_DEVICE_CH_NUM; ch++)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 4 + (ch*3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 5 + (ch*3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 6 + (ch*3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 4 + (ch*3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 5 + (ch*3), (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 6 + (ch*3), (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
len += gui_tjc_hmi_tx_text_display(x+1, 16, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DETALL_MAIN,x+1, 16, (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1005,9 +1033,9 @@ static void gui_tjc_hmi_detail_main_send(u8 cmd, u8 opa, u8 *p_data)
|
||||
if (leakage.sub_device_data[i].flash_data.state == ENABLE &&
|
||||
leakage.sub_device_data[i].flash_data.modbus_id == device_id) {
|
||||
if (operation == 0x01) {
|
||||
leakage.sub_device_data[i].flash_data.shield = BLOCKED; /* <20><><EFBFBD><EFBFBD> */
|
||||
leakage.sub_device_data[i].shield = BLOCKED; /* <20><><EFBFBD><EFBFBD> */
|
||||
} else if (operation == 0x02) {
|
||||
leakage.sub_device_data[i].flash_data.shield = UNBLOCKED; /* <20>ָ<EFBFBD> */
|
||||
leakage.sub_device_data[i].shield = UNBLOCKED; /* <20>ָ<EFBFBD> */
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@@ -1043,7 +1071,7 @@ static void gui_tjc_hmi_login_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
gui_tjc_hmi_read_password_from_w25q();
|
||||
memset(hmi_tx_buffer, 0, sizeof(hmi_tx_buffer));
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>͵<EFBFBD><CDB5>ؼ<EFBFBD> t22_1 */
|
||||
len = gui_tjc_hmi_tx_text_display(22, 1, (char *)hmi_tx_buffer,
|
||||
len = gui_tjc_hmi_tx_text_display(GUI_LOGIN,22, 1, (char *)hmi_tx_buffer,
|
||||
"%d%d%d%d",
|
||||
p_tjc_hmi->password[0],
|
||||
p_tjc_hmi->password[1],
|
||||
@@ -1114,6 +1142,8 @@ static void gui_tjc_hmi_history_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
page_num++;
|
||||
}
|
||||
|
||||
memset(hmi_tx_buffer, 0, sizeof(hmi_tx_buffer));
|
||||
|
||||
if(HMI_PROTO_CMD_GET == cmd) /* <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD> */
|
||||
{
|
||||
switch(opa)
|
||||
@@ -1153,22 +1183,22 @@ static void gui_tjc_hmi_history_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
if(history.read_history(record_index, &history_record))
|
||||
{
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: t(i+1)_1 */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
history_record.region_name);
|
||||
|
||||
/* <20>豸ID: t(i+1)_2 */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 2,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%d",
|
||||
history_record.device_id);
|
||||
|
||||
/*ͨ<><CDA8><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>t(i+1)_3*/
|
||||
len += gui_tjc_hmi_tx_text_display(i+1,3,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1,3,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%d",
|
||||
history_record.channel);
|
||||
history_record.channel+1);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: t(i+1)_4 */
|
||||
alarm_type_str[0] = '\0';
|
||||
@@ -1179,13 +1209,13 @@ static void gui_tjc_hmi_history_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
else if(history_record.alarm_type == APP_LEAKAGE_SUB_DEVICE_STATE_TIME_OUT)
|
||||
strcat(alarm_type_str, "ͨѶ<EFBFBD><EFBFBD>ʱ");
|
||||
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 4,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 4,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
alarm_type_str);
|
||||
|
||||
/* <20>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>: t(i+1)_5 */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 5,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 5,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
history_record.device_name);
|
||||
@@ -1193,14 +1223,14 @@ static void gui_tjc_hmi_history_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
/* ©Һ<C2A9><D2BA><EFBFBD><EFBFBD>: t(i+1)_6 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>©Һ<C2A9><D2BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ) */
|
||||
if(history_record.alarm_type == APP_LEAKAGE_SUB_DEVICE_STATE_LEAKAGE)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 6,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 6,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%d",
|
||||
history_record.leak_distance);
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 6,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 6,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"0");
|
||||
}
|
||||
@@ -1214,7 +1244,7 @@ static void gui_tjc_hmi_history_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
history_record.start_time[4],
|
||||
history_record.start_time[5],
|
||||
history_record.start_time[6]);
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 7,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 7,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
time_str);
|
||||
@@ -1222,24 +1252,26 @@ static void gui_tjc_hmi_history_alarm_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
else
|
||||
{
|
||||
/* <20><>ȡʧ<C8A1>ܣ<EFBFBD><DCA3><EFBFBD>ʾ<EFBFBD><CABE> */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 4, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 5, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 6, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 4, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 5, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 6, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 7, (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>15<31><35><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD> */
|
||||
for(; i < HISTORY_ALARM_PER_PAGE; i++)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 4, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 5, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 6, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 4, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 5, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 6, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_HISTORY_ALARM,i+1, 7, (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
|
||||
len = strlen((char *)hmi_tx_buffer);
|
||||
@@ -1330,33 +1362,39 @@ static void gui_tjc_hmi_tcp_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
{
|
||||
if(p_data[0] == 0x01)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(1,1,(char *)&hmi_tx_buffer[len],
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,1,(char *)&hmi_tx_buffer[len],
|
||||
"%d.%d.%d.%d",
|
||||
W5500.IP_Addr[0],
|
||||
W5500.IP_Addr[1],
|
||||
W5500.IP_Addr[2],
|
||||
W5500.IP_Addr[3]);
|
||||
|
||||
len += gui_tjc_hmi_tx_text_display(1,2,(char *)&hmi_tx_buffer[len],
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,2,(char *)&hmi_tx_buffer[len],
|
||||
"%d.%d.%d.%d",
|
||||
W5500.Sub_Mask[0],
|
||||
W5500.Sub_Mask[1],
|
||||
W5500.Sub_Mask[2],
|
||||
W5500.Sub_Mask[3]);
|
||||
|
||||
len += gui_tjc_hmi_tx_text_display(1,3,(char *)&hmi_tx_buffer[len],
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,3,(char *)&hmi_tx_buffer[len],
|
||||
"%d.%d.%d.%d",
|
||||
W5500.Gateway_IP[0],
|
||||
W5500.Gateway_IP[1],
|
||||
W5500.Gateway_IP[2],
|
||||
W5500.Gateway_IP[3]);
|
||||
len += gui_tjc_hmi_tx_text_display(1,4,(char *)&hmi_tx_buffer[len],"%s","5000");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,4,(char *)&hmi_tx_buffer[len],"%d",(W5500.W5500_Class[0].ConfigData.Port[0] << 8) | W5500.W5500_Class[0].ConfigData.Port[1]);
|
||||
}else if(p_data[0] == 0x00)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(1,1,(char *)&hmi_tx_buffer[len],"%s","192.168.100.100");
|
||||
len += gui_tjc_hmi_tx_text_display(1,2,(char *)&hmi_tx_buffer[len],"%s","255.255.255.0");
|
||||
len += gui_tjc_hmi_tx_text_display(1,3,(char *)&hmi_tx_buffer[len],"%s","192.168.50.1");
|
||||
len += gui_tjc_hmi_tx_text_display(1,4,(char *)&hmi_tx_buffer[len],"%s","5000");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,1,(char *)&hmi_tx_buffer[len],"%s","192.168.100.100");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,2,(char *)&hmi_tx_buffer[len],"%s","255.255.255.0");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,3,(char *)&hmi_tx_buffer[len],"%s","192.168.50.1");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_TCP_CONFIG,1,4,(char *)&hmi_tx_buffer[len],"%s","5000");
|
||||
sscanf("192.168.100.100","%hhu.%hhu.%hhu.%hhu",&W5500.IP_Addr[0],&W5500.IP_Addr[1],&W5500.IP_Addr[2],&W5500.IP_Addr[3]);
|
||||
sscanf("255.255.255.0","%hhu.%hhu.%hhu.%hhu",&W5500.Sub_Mask[0],&W5500.Sub_Mask[1],&W5500.Sub_Mask[2],&W5500.Sub_Mask[3]);
|
||||
sscanf("192.168.50.1","%hhu.%hhu.%hhu.%hhu",&W5500.Gateway_IP[0],&W5500.Gateway_IP[1],&W5500.Gateway_IP[2],&W5500.Gateway_IP[3]);
|
||||
W5500.W5500_Class[0].ConfigData.Port[0] = (5000 >> 8) & 0xFF;
|
||||
W5500.W5500_Class[0].ConfigData.Port[1] = 5000 & 0xFF;
|
||||
W5500.Init();
|
||||
}
|
||||
}break;
|
||||
case 0x02:/*<2A><>*/
|
||||
@@ -1376,8 +1414,9 @@ static void gui_tjc_hmi_tcp_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
{
|
||||
u8 field_count = 0;
|
||||
u8 *current_pos = p_data;
|
||||
u8 ip_str[16], mask_str[16], gw_str[16], dns_str[16];
|
||||
u8 ip_len, mask_len, gw_len, dns_len;
|
||||
u8 ip_str[16], mask_str[16], gw_str[16], port_str[16];
|
||||
u8 ip_len, mask_len, gw_len, port_len;
|
||||
u16 port_val;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>IP<49><50>ַ */
|
||||
for (i = 0; i < 16; i++) {
|
||||
@@ -1415,12 +1454,12 @@ static void gui_tjc_hmi_tcp_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>DNS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
for (i = 0; i < 16; i++) {
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>˿ں<EFBFBD> */
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (current_pos[i] == HMI_PROTO_ASCII_RX_DELINITER) {
|
||||
dns_len = i;
|
||||
memcpy(dns_str, current_pos, dns_len);
|
||||
dns_str[dns_len] = '\0';
|
||||
port_len = i;
|
||||
memcpy(port_str, current_pos, port_len);
|
||||
port_str[port_len] = '\0';
|
||||
current_pos += (i + 1);
|
||||
field_count++;
|
||||
break;
|
||||
@@ -1431,6 +1470,16 @@ static void gui_tjc_hmi_tcp_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
parse_ip_string(ip_str, ip_len, W5500.IP_Addr);
|
||||
parse_ip_string(mask_str, mask_len, W5500.Sub_Mask);
|
||||
parse_ip_string(gw_str, gw_len, W5500.Gateway_IP);
|
||||
/* <20>˿ں<CBBF>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD> */
|
||||
port_val = atoi((char*)port_str);
|
||||
W5500.W5500_Class[0].ConfigData.Port[0] = (port_val >> 8) & 0xFF;
|
||||
W5500.W5500_Class[0].ConfigData.Port[1] = port_val & 0xFF;
|
||||
|
||||
/* <20><><EFBFBD>浽Flash */
|
||||
gui_tjc_hmi_save_network_config_to_w25q();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>W5500ʹ<30><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч */
|
||||
W5500.Init();
|
||||
}
|
||||
|
||||
}break;
|
||||
@@ -1473,7 +1522,7 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
enabled_device_count = 0;
|
||||
for(i = 0; i < APP_LEAKAGE_SUB_DEVICE_NUM; i++)
|
||||
{
|
||||
if(leakage.sub_device_data[i].flash_data.state == ENABLE)
|
||||
if(leakage.sub_device_data[i].flash_data.state == ENABLE && leakage.sub_device_data[i].flash_data.modbus_id > 0)
|
||||
{
|
||||
enabled_device_count++;
|
||||
}
|
||||
@@ -1497,10 +1546,10 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
{
|
||||
for(i = 0; i < DEVICES_PER_PAGE; i++)
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 4, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 1, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 2, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 3, (char *)&hmi_tx_buffer[len], "");
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 4, (char *)&hmi_tx_buffer[len], "");
|
||||
}
|
||||
len = strlen((char *)hmi_tx_buffer);
|
||||
gui_tjc_hmi_data_send(hmi_tx_buffer, len);
|
||||
@@ -1538,7 +1587,7 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
device_index = page_device_indices[i];
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: t(i+1)_1 */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
leakage.sub_device_data[device_index].flash_data.region_name);
|
||||
@@ -1547,26 +1596,26 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
u8 com_port = leakage.sub_device_data[device_index].flash_data.com;
|
||||
if(com_port < 4) /*ȷ<><C8B7><EFBFBD>˿ں<CBBF><DABA><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>Χ<EFBFBD><CEA7>*/
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 2,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
hmi_proto_string_com[com_port]);
|
||||
}
|
||||
else
|
||||
{
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 2,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"δ֪");
|
||||
}
|
||||
|
||||
/*<2A>豸ID: t(i+1)_3 */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 3,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 3,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%d",
|
||||
leakage.sub_device_data[device_index].flash_data.modbus_id);
|
||||
|
||||
/*<2A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>: t(i+1)_4 */
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 4,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 4,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"%s",
|
||||
leakage.sub_device_data[device_index].flash_data.device_name);
|
||||
@@ -1578,22 +1627,22 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
for(i = page_device_count; i < DEVICES_PER_PAGE; i++)
|
||||
{
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 1,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 1,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"");
|
||||
|
||||
/*<2A><><EFBFBD>ն˿ں<CBBF>*/
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 2,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 2,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"");
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>豸ID*/
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 3,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 3,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"");
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>*/
|
||||
len += gui_tjc_hmi_tx_text_display(i+1, 4,
|
||||
len += gui_tjc_hmi_tx_text_display(GUI_DEVICE_CONFIG,i+1, 4,
|
||||
(char *)&hmi_tx_buffer[len],
|
||||
"");
|
||||
}
|
||||
@@ -1814,6 +1863,11 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
id_str[i] = '\0';
|
||||
new_device.modbus_id = atoi(id_str);
|
||||
|
||||
if(new_device.modbus_id < 1 && new_device.modbus_id > 255)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
current_pos += (i + 1);
|
||||
field_count++;
|
||||
break;
|
||||
@@ -1841,7 +1895,7 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
{
|
||||
new_device.state = ENABLE;
|
||||
new_device.baudrate = app_com.com[new_device.com].flash_data.baudrate;
|
||||
new_device.shield = UNBLOCKED;
|
||||
leakage.sub_device_data[x].shield = UNBLOCKED;
|
||||
leakage.sub_device_data[x].flash_data = new_device;
|
||||
gui_tjc_hmi_save_device_info_to_w25q();
|
||||
gui_tjc_hmi_class_update();
|
||||
@@ -1859,7 +1913,7 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
new_device.baudrate = app_com.com[new_device.com].flash_data.baudrate;
|
||||
|
||||
new_device.shield = UNBLOCKED;
|
||||
leakage.sub_device_data[empty_slot_index].shield = UNBLOCKED;
|
||||
|
||||
/*<2A><><EFBFBD>ӵ<EFBFBD>app_leakage<67><65><EFBFBD>豸<EFBFBD>б<EFBFBD><D0B1><EFBFBD>*/
|
||||
leakage.sub_device_data[empty_slot_index].flash_data = new_device;
|
||||
@@ -1892,7 +1946,7 @@ static void gui_tjc_hmi_device_config_send(u8 cmd,u8 opa,u8 *p_data)
|
||||
case 0x02:/*ɾ<><C9BE><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2>w25q<35><71>ɾ<EFBFBD><C9BE>*/
|
||||
{
|
||||
|
||||
u8 page_device_indices[8] = {0}; /*<2A>洢<EFBFBD><E6B4A2>ǰҳ8<D2B3><38><EFBFBD>豸<EFBFBD><E8B1B8>app_leakage<67>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
u8 page_device_indices[8] = {0}; /*<2A>洢<EFBFBD><E6B4A2>ǰҳ8<D2B3><38><EFBFBD>豸<EFBFBD><E8B1B8>app_leakage<67>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
u8 page_device_count = 0; /*<2A><>ǰҳʵ<D2B3><CAB5><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>*/
|
||||
u8 current_enabled_index = 0; /*<2A><>ǰ<EFBFBD>ǵڼ<C7B5><DABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5>豸*/
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ static u16 proto_modbus_data_read(u16 addr)
|
||||
// data = (leakage.sub_device_data[sensor_index].flash_data.com + 1)<< 8 | leakage.sub_device_data[sensor_index].flash_data.modbus_id;
|
||||
u16 value = (leakage.sub_device_data[sensor_index].flash_data.com + 1) << 8;
|
||||
value |= leakage.sub_device_data[sensor_index].flash_data.modbus_id;
|
||||
if (leakage.sub_device_data[sensor_index].flash_data.shield == BLOCKED) {
|
||||
if (leakage.sub_device_data[sensor_index].shield == BLOCKED) {
|
||||
value |= 0x8000; /*<2A><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>*/
|
||||
}
|
||||
if (leakage.sub_device_data[sensor_index].flash_data.state == ENABLE) {
|
||||
|
||||
Reference in New Issue
Block a user