Compare commits

..

No commits in common. "fdf5790249d66f86ded8693f0e51233b6fad3370" and "a76fc54bb5e1689ad2c2523f8c91d12d4b078a3e" have entirely different histories.

126 changed files with 5820 additions and 7084 deletions

View File

@ -1,42 +1,19 @@
#MicroXplorer Configuration settings - do not modify #MicroXplorer Configuration settings - do not modify
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_0
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,master,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag
ADC1.NbrOfConversionFlag=1
ADC1.Rank-0\#ChannelRegularConversion=1
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
ADC1.master=1
ADC3.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_4 ADC3.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_4
ADC3.Channel-10\#ChannelRegularConversion=ADC_CHANNEL_14 ADC3.Channel-1\#ChannelInjectedConversion=ADC_CHANNEL_4
ADC3.Channel-9\#ChannelRegularConversion=ADC_CHANNEL_9 ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag,InjectedRank-1\#ChannelInjectedConversion,Channel-1\#ChannelInjectedConversion,SamplingTime-1\#ChannelInjectedConversion,InjectedOffset-1\#ChannelInjectedConversion,InjNumberOfConversion
ADC3.ContinuousConvMode=ENABLE ADC3.InjNumberOfConversion=1
ADC3.DMAContinuousRequests=ENABLE ADC3.InjectedOffset-1\#ChannelInjectedConversion=0
ADC3.DiscontinuousConvMode=DISABLE ADC3.InjectedRank-1\#ChannelInjectedConversion=1
ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag,InjNumberOfConversion,NbrOfConversion,ContinuousConvMode,DiscontinuousConvMode,DMAContinuousRequests,Rank-9\#ChannelRegularConversion,Channel-9\#ChannelRegularConversion,SamplingTime-9\#ChannelRegularConversion,Rank-10\#ChannelRegularConversion,Channel-10\#ChannelRegularConversion,SamplingTime-10\#ChannelRegularConversion
ADC3.InjNumberOfConversion=0
ADC3.NbrOfConversion=3
ADC3.NbrOfConversionFlag=1 ADC3.NbrOfConversionFlag=1
ADC3.Rank-0\#ChannelRegularConversion=1 ADC3.Rank-0\#ChannelRegularConversion=1
ADC3.Rank-10\#ChannelRegularConversion=3 ADC3.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_144CYCLES
ADC3.Rank-9\#ChannelRegularConversion=2 ADC3.SamplingTime-1\#ChannelInjectedConversion=ADC_SAMPLETIME_3CYCLES
ADC3.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_480CYCLES
ADC3.SamplingTime-10\#ChannelRegularConversion=ADC_SAMPLETIME_480CYCLES
ADC3.SamplingTime-9\#ChannelRegularConversion=ADC_SAMPLETIME_480CYCLES
CAD.formats= CAD.formats=
CAD.pinconfig= CAD.pinconfig=
CAD.provider= CAD.provider=
Dma.ADC3.1.Direction=DMA_PERIPH_TO_MEMORY
Dma.ADC3.1.FIFOMode=DMA_FIFOMODE_DISABLE
Dma.ADC3.1.Instance=DMA2_Stream0
Dma.ADC3.1.MemDataAlignment=DMA_MDATAALIGN_HALFWORD
Dma.ADC3.1.MemInc=DMA_MINC_ENABLE
Dma.ADC3.1.Mode=DMA_CIRCULAR
Dma.ADC3.1.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD
Dma.ADC3.1.PeriphInc=DMA_PINC_DISABLE
Dma.ADC3.1.Priority=DMA_PRIORITY_LOW
Dma.ADC3.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
Dma.Request0=UART4_RX Dma.Request0=UART4_RX
Dma.Request1=ADC3 Dma.RequestsNb=1
Dma.RequestsNb=2
Dma.UART4_RX.0.Direction=DMA_PERIPH_TO_MEMORY Dma.UART4_RX.0.Direction=DMA_PERIPH_TO_MEMORY
Dma.UART4_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE Dma.UART4_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE
Dma.UART4_RX.0.Instance=DMA1_Stream2 Dma.UART4_RX.0.Instance=DMA1_Stream2
@ -52,21 +29,20 @@ GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false KeepUserPlacement=false
Mcu.CPN=STM32F407ZGT6 Mcu.CPN=STM32F407ZGT6
Mcu.Family=STM32F4 Mcu.Family=STM32F4
Mcu.IP0=ADC1 Mcu.IP0=ADC3
Mcu.IP1=ADC3 Mcu.IP1=DMA
Mcu.IP10=TIM7 Mcu.IP10=UART4
Mcu.IP11=UART4 Mcu.IP11=USART1
Mcu.IP12=USART1 Mcu.IP12=USART2
Mcu.IP13=USART2 Mcu.IP2=I2C2
Mcu.IP2=DMA Mcu.IP3=NVIC
Mcu.IP3=I2C2 Mcu.IP4=RCC
Mcu.IP4=NVIC Mcu.IP5=SYS
Mcu.IP5=RCC Mcu.IP6=TIM2
Mcu.IP6=SYS Mcu.IP7=TIM3
Mcu.IP7=TIM2 Mcu.IP8=TIM6
Mcu.IP8=TIM3 Mcu.IP9=TIM7
Mcu.IP9=TIM6 Mcu.IPNb=13
Mcu.IPNb=14
Mcu.Name=STM32F407Z(E-G)Tx Mcu.Name=STM32F407Z(E-G)Tx
Mcu.Package=LQFP144 Mcu.Package=LQFP144
Mcu.Pin0=PE2 Mcu.Pin0=PE2
@ -87,25 +63,24 @@ Mcu.Pin21=PA9
Mcu.Pin22=PA10 Mcu.Pin22=PA10
Mcu.Pin23=PA13 Mcu.Pin23=PA13
Mcu.Pin24=PA14 Mcu.Pin24=PA14
Mcu.Pin25=PC10 Mcu.Pin25=PD5
Mcu.Pin26=PD5 Mcu.Pin26=PD6
Mcu.Pin27=PD6 Mcu.Pin27=PG9
Mcu.Pin28=PG9 Mcu.Pin28=PG11
Mcu.Pin29=PG11 Mcu.Pin29=PG13
Mcu.Pin3=PC15-OSC32_OUT Mcu.Pin3=PC15-OSC32_OUT
Mcu.Pin30=PG13 Mcu.Pin30=VP_SYS_VS_Systick
Mcu.Pin31=VP_SYS_VS_Systick Mcu.Pin31=VP_TIM2_VS_ClockSourceINT
Mcu.Pin32=VP_TIM2_VS_ClockSourceINT Mcu.Pin32=VP_TIM3_VS_ClockSourceINT
Mcu.Pin33=VP_TIM3_VS_ClockSourceINT Mcu.Pin33=VP_TIM6_VS_ClockSourceINT
Mcu.Pin34=VP_TIM6_VS_ClockSourceINT Mcu.Pin34=VP_TIM7_VS_ClockSourceINT
Mcu.Pin35=VP_TIM7_VS_ClockSourceINT
Mcu.Pin4=PF0 Mcu.Pin4=PF0
Mcu.Pin5=PF1 Mcu.Pin5=PF1
Mcu.Pin6=PF2 Mcu.Pin6=PF2
Mcu.Pin7=PF3 Mcu.Pin7=PF3
Mcu.Pin8=PF4 Mcu.Pin8=PF4
Mcu.Pin9=PF6 Mcu.Pin9=PF6
Mcu.PinsNb=36 Mcu.PinsNb=35
Mcu.ThirdPartyNb=0 Mcu.ThirdPartyNb=0
Mcu.UserConstants= Mcu.UserConstants=
Mcu.UserName=STM32F407ZGTx Mcu.UserName=STM32F407ZGTx
@ -114,7 +89,7 @@ MxDb.Version=DB.6.0.130
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.DMA1_Stream2_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true NVIC.DMA1_Stream2_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.ForceEnableDMAVector=false NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
@ -129,7 +104,8 @@ NVIC.TIM7_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.UART4_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true NVIC.UART4_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.USART2_IRQn=true\:2\:0\:true\:false\:true\:true\:true\:true NVIC.USART2_IRQn=true\:2\:0\:true\:false\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA0-WKUP.Signal=ADCx_IN0 PA0-WKUP.Mode=Asynchronous
PA0-WKUP.Signal=UART4_TX
PA1.Mode=Asynchronous PA1.Mode=Asynchronous
PA1.Signal=UART4_RX PA1.Signal=UART4_RX
PA10.Mode=Asynchronous PA10.Mode=Asynchronous
@ -140,8 +116,6 @@ PA14.Mode=Serial_Wire
PA14.Signal=SYS_JTCK-SWCLK PA14.Signal=SYS_JTCK-SWCLK
PA9.Mode=Asynchronous PA9.Mode=Asynchronous
PA9.Signal=USART1_TX PA9.Signal=USART1_TX
PC10.Mode=Asynchronous
PC10.Signal=UART4_TX
PC14-OSC32_IN.Mode=LSE-External-Oscillator PC14-OSC32_IN.Mode=LSE-External-Oscillator
PC14-OSC32_IN.Signal=RCC_OSC32_IN PC14-OSC32_IN.Signal=RCC_OSC32_IN
PC15-OSC32_OUT.Mode=LSE-External-Oscillator PC15-OSC32_OUT.Mode=LSE-External-Oscillator
@ -175,6 +149,7 @@ PF4.Signal=ADC3_IN14
PF6.Mode=IN4 PF6.Mode=IN4
PF6.Signal=ADC3_IN4 PF6.Signal=ADC3_IN4
PF8.Locked=true PF8.Locked=true
PF8.Mode=IN6
PF8.Signal=ADC3_IN6 PF8.Signal=ADC3_IN6
PG1.Locked=true PG1.Locked=true
PG1.Signal=GPIO_Output PG1.Signal=GPIO_Output
@ -232,7 +207,7 @@ ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath= ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath= ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=false 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_USART1_UART_Init-USART1-false-HAL-true,5-MX_USART2_UART_Init-USART2-false-HAL-true,6-MX_TIM6_Init-TIM6-false-HAL-true,7-MX_TIM2_Init-TIM2-false-HAL-true,8-MX_TIM7_Init-TIM7-false-HAL-true,9-MX_ADC3_Init-ADC3-false-HAL-true,10-MX_UART4_Init-UART4-false-HAL-true,11-MX_I2C2_Init-I2C2-false-HAL-true,12-MX_TIM3_Init-TIM3-false-HAL-true,13-MX_ADC1_Init-ADC1-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_USART1_UART_Init-USART1-false-HAL-true,5-MX_USART2_UART_Init-USART2-false-HAL-true,6-MX_TIM6_Init-TIM6-false-HAL-true,7-MX_TIM2_Init-TIM2-false-HAL-true,8-MX_TIM7_Init-TIM7-false-HAL-true,9-MX_ADC3_Init-ADC3-false-HAL-true,10-MX_UART4_Init-UART4-false-HAL-true,11-MX_I2C2_Init-I2C2-false-HAL-true,12-MX_TIM3_Init-TIM3-false-HAL-true
RCC.48MHZClocksFreq_Value=36000000 RCC.48MHZClocksFreq_Value=36000000
RCC.AHBFreq_Value=72000000 RCC.AHBFreq_Value=72000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2 RCC.APB1CLKDivider=RCC_HCLK_DIV2
@ -264,8 +239,6 @@ RCC.VCOI2SOutputFreq_Value=192000000
RCC.VCOInputFreq_Value=1000000 RCC.VCOInputFreq_Value=1000000
RCC.VCOOutputFreq_Value=144000000 RCC.VCOOutputFreq_Value=144000000
RCC.VcooutputI2S=96000000 RCC.VcooutputI2S=96000000
SH.ADCx_IN0.0=ADC1_IN0,IN0
SH.ADCx_IN0.ConfNb=1
TIM2.IPParameters=Prescaler,Period TIM2.IPParameters=Prescaler,Period
TIM2.Period=600000-1 TIM2.Period=600000-1
TIM2.Prescaler=7200-1 TIM2.Prescaler=7200-1

View File

@ -30,76 +30,5 @@ void Inf_AT24C02_ReadBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len)
} }
// 清空整个AT24C02 EEPROM (写入0xFF)
void Clear_EEPROM_All(void)
{
uint16_t addr; // 使用 uint16_t 以防地址超过 255 (虽然AT24C02不会)
uint8_t clear_data = 0xFF; // 定义要写入的值,通常用 0xFF
// printf("开始清空整个 EEPROM...\r\n");
// AT24C02 有 256 个字节地址 (0 到 255)
for(addr = 0; addr < 256; addr++)
{
// 调用你驱动中的单字节写入函数
Inf_AT24C02_WriteByte((uint8_t)addr, clear_data);
// 你驱动中的 Inf_AT24C02_WriteByte 已经包含了 HAL_Delay(5)
// 所以这里不需要额外加延时,除非你需要更长的延时。
// 可以选择性地加一个进度打印,但会拖慢速度
// if ((addr + 1) % 32 == 0) { // 每写入32个字节打印一次
// printf("已清空 %d / 256 字节...\r\n", addr + 1);
// }
}
// printf("EEPROM 清空完成。\r\n");
}
void Save_Float_To_EEPROM(uint8_t addr, float data)
{
uint8_t bytes[4]; // 用于存储浮点数的字节数组
memcpy(bytes,&data,sizeof(float));
Inf_AT24C02_WriteBytes(addr,bytes,4);
}
float Read_Float_From_EEPROM(uint8_t addr)
{
uint8_t bytes[4];
float data;
Inf_AT24C02_ReadBytes(addr,bytes,4);
memcpy(&data,bytes,sizeof(float));
return data;
}
void Save_Energy_To_EEPROM(float energy)
{
// 保存能量值
Save_Float_To_EEPROM(EEPROM_ENERGY_ADDR, energy); // 保存能量值到 EEPROM
// 保存标志位
Inf_AT24C02_WriteByte(EEPROM_ENERGY_FLAG, EEPROM_ENERGY_FLAG_VAL);
}
float Load_Energy_From_EEPROM(void)
{
float energy = 0.0f; // 默认值
uint8_t flag;
flag = Inf_AT24C02_ReadByte(EEPROM_ENERGY_FLAG); // 读取标志位
if(flag == EEPROM_ENERGY_FLAG_VAL)
{
energy=Read_Float_From_EEPROM(EEPROM_ENERGY_ADDR); // 读取能量值
}
else
{
energy=0.0f; // 未找到有效数据,返回默认值
Save_Energy_To_EEPROM(energy); // 保存默认值到 EEPROM
}
return energy;
}

View File

@ -2,25 +2,13 @@
#define EEPROM_H #define EEPROM_H
#include "main.h" #include "main.h"
#include "i2c.h" #include "i2c.h"
#include <String.h>
#define ADDR 0xA0 #define ADDR 0xA0
#define EEPROM_ENERGY_ADDR 0x60 // EEPROM 存储电量存储地址
#define EEPROM_ENERGY_FLAG 0x64 //检验标志地址
#define EEPROM_ENERGY_FLAG_VAL 0xA5 //检验标志值
void Inf_AT24C02_Init(void); void Inf_AT24C02_Init(void);
void Inf_AT24C02_WriteByte(uint8_t innerAddr, uint8_t byte); void Inf_AT24C02_WriteByte(uint8_t innerAddr, uint8_t byte);
uint8_t Inf_AT24C02_ReadByte(uint8_t innerAddr); uint8_t Inf_AT24C02_ReadByte(uint8_t innerAddr);
void Inf_AT24C02_WriteBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len); void Inf_AT24C02_WriteBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len);
void Inf_AT24C02_ReadBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len); void Inf_AT24C02_ReadBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len);
void Clear_EEPROM_All(void);
void Save_Float_To_EEPROM(uint8_t addr, float data);
float Read_Float_From_EEPROM(uint8_t addr);
void Save_Energy_To_EEPROM(float energy);
float Load_Energy_From_EEPROM(void);
#endif #endif

View File

@ -24,18 +24,15 @@ void Apphl8032_Init(void)
// 使用HAL库的单字节接收中断 // 使用HAL库的单字节接收中断
HAL_UART_Receive_IT(&huart4, &aRxBuffer, 1); HAL_UART_Receive_IT(&huart4, &aRxBuffer, 1);
//从EEPROM读取累计电量
base_energy = Load_Energy_From_EEPROM(); // 初始化变量
analog_status[1] = base_energy; // 初始化为0 base_energy = 0.0;
last_minute_energy=0.0f; analog_status[1] = 0.0;
current_minute_energy=0.0f;
} }
void Data_Processing(void) void Data_Processing(void)
{ {
static uint32_t lastProcessTime = 0; static uint32_t lastProcessTime = 0;
static uint32_t lastSaveTime = 0;
static uint32_t last_saved_energy =0.0f;
uint32_t currentTime = HAL_GetTick(); uint32_t currentTime = HAL_GetTick();
// 至少1秒处理一次 // 至少1秒处理一次
@ -145,11 +142,7 @@ void Data_Processing(void)
{ {
base_energy += minute_increase; base_energy += minute_increase;
analog_status[1] = base_energy; analog_status[1] = base_energy;
if((base_energy - last_saved_energy >= 0.1f)|| (currentTime-lastSaveTime>300000)) // printf("Energy Update: %.6f KWH\r\n", base_energy);
{
Save_Energy_To_EEPROM(base_energy);
last_saved_energy=base_energy;
}
} }
else else
{ {

View File

@ -1,41 +1,41 @@
#include "Irrigation.h" #include "Irrigation.h"
// 直排模式时间参数 // 直排模式时间参数
uint32_t DIRECT_HIGH_PUMP_ON_TIME = 1; // 1分钟 uint32_t DIRECT_HIGH_PUMP_ON_TIME = 3; // 1分钟
uint32_t DIRECT_HIGH_PUMP_OFF_TIME = 150; // 150分钟 uint32_t DIRECT_HIGH_PUMP_OFF_TIME = 1; // 150分钟
uint32_t DIRECT_HIGH_FAN_ON_TIME = 40; // 40分钟 uint32_t DIRECT_HIGH_FAN_ON_TIME = 2; // 40分钟
uint32_t DIRECT_HIGH_FAN_OFF_TIME = 2 ; // 2分钟 uint32_t DIRECT_HIGH_FAN_OFF_TIME = 3 ; // 2分钟
uint32_t DIRECT_LOW_FAN_ON_TIME = 10; // 10分钟 uint32_t DIRECT_LOW_FAN_ON_TIME = 3; // 10分钟
uint32_t DIRECT_LOW_FAN_OFF_TIME = 20; // 20分钟 uint32_t DIRECT_LOW_FAN_OFF_TIME = 2; // 20分钟
uint32_t DIRECT_FIRST_LOW_FAN_ON = 40; // 40分钟 uint32_t DIRECT_FIRST_LOW_FAN_ON = 2; // 40分钟
uint32_t DIRECT_FIRST_LOW_FAN_OFF = 2; // 2分钟 uint32_t DIRECT_FIRST_LOW_FAN_OFF = 2; // 2分钟
// 冲厕模式时间参数 // 冲厕模式时间参数
uint32_t FLUSH_HIGH_PUMP_ON_TIME = 1; // 1分钟 uint32_t FLUSH_HIGH_PUMP_ON_TIME = 2; // 1分钟
uint32_t FLUSH_HIGH_PUMP_OFF_TIME = 150; // 150分钟 uint32_t FLUSH_HIGH_PUMP_OFF_TIME = 3; // 150分钟
uint32_t FLUSH_HIGH_FAN_ON_TIME = 40; // 40分钟 uint32_t FLUSH_HIGH_FAN_ON_TIME = 1; // 40分钟
uint32_t FLUSH_HIGH_FAN_OFF_TIME = 2; // 2分钟 uint32_t FLUSH_HIGH_FAN_OFF_TIME = 4; // 2分钟
uint32_t FLUSH_LOW_FAN_ON_TIME = 5; // 5分钟 uint32_t FLUSH_LOW_FAN_ON_TIME = 3; // 5分钟
uint32_t FLUSH_LOW_FAN_OFF_TIME = 25; // 25分钟 uint32_t FLUSH_LOW_FAN_OFF_TIME = 2; // 25分钟
uint32_t FLUSH_FIRST_LOW_FAN_ON = 40; // 40分钟 uint32_t FLUSH_FIRST_LOW_FAN_ON = 1; // 40分钟
uint32_t FLUSH_FIRST_LOW_FAN_OFF = 2; // 2分钟 uint32_t FLUSH_FIRST_LOW_FAN_OFF = 3; // 2分钟
//灌溉模式时间参数 //灌溉模式时间参数
uint32_t HIGH_LEVEL_PUMP_ON_TIME = 1; // 1分钟 uint32_t HIGH_LEVEL_PUMP_ON_TIME = 3; // 1分钟
uint32_t HIGH_LEVEL_PUMP_OFF_TIME = 120; // 120分钟 uint32_t HIGH_LEVEL_PUMP_OFF_TIME = 1; // 120分钟
uint32_t HIGH_LEVEL_FAN_ON_TIME = 20; // 20分钟 uint32_t HIGH_LEVEL_FAN_ON_TIME = 2; // 20分钟
uint32_t HIGH_LEVEL_FAN_OFF_TIME = 5; // 5分钟 uint32_t HIGH_LEVEL_FAN_OFF_TIME = 3; // 5分钟
uint32_t FIRST_LOW_FAN_ON_TIME = 10; // 10分钟 uint32_t FIRST_LOW_FAN_ON_TIME = 1; // 10分钟
uint32_t FIRST_LOW_FAN_OFF_TIME = 10; // 10分钟 uint32_t FIRST_LOW_FAN_OFF_TIME = 2; // 10分钟
uint32_t LOW_LEVEL_FAN_ON_TIME = 5; // 5分钟 uint32_t LOW_LEVEL_FAN_ON_TIME = 3; // 5分钟
uint32_t LOW_LEVEL_FAN_OFF_TIME = 40; // 40分钟 uint32_t LOW_LEVEL_FAN_OFF_TIME = 1; // 40分钟
// 特殊模式变量 // 特殊模式变量
uint32_t SPECIAL_INITIAL_STOP_TIME = 1440; // 24小时 = 1440分钟 前5分钟 uint32_t SPECIAL_INITIAL_STOP_TIME = 2; // 24小时 = 1440分钟 前5分钟
uint32_t SPECIAL_FIRST_PHASE_TIME = 2880; // 48小时 = 2880分钟 后六分钟 uint32_t SPECIAL_FIRST_PHASE_TIME = 9; // 48小时 = 2880分钟 后六分钟
uint32_t SPECIAL_PUMP_RUN_TIME = 1; // 前1分钟运行 uint32_t SPECIAL_PUMP_RUN_TIME = 2; // 前1分钟运行
uint32_t SPECIAL_FIRST_STOP_TIME = 360; // 前359分钟停止 uint32_t SPECIAL_FIRST_STOP_TIME = 1; // 前359分钟停止
uint32_t SPECIAL_SECOND_PHASE_TIME =1; // 48小时 = 2880分钟 uint32_t SPECIAL_SECOND_PHASE_TIME =9; // 48小时 = 2880分钟
uint32_t SPECIAL_SECOND_STOP_TIME = 240; // 239分钟停止 uint32_t SPECIAL_SECOND_STOP_TIME = 2; // 239分钟停止

View File

@ -10,7 +10,6 @@
#include "tim.h" // 添加定时器头文件 #include "tim.h" // 添加定时器头文件
#include "Save_Time.h" #include "Save_Time.h"
#include "EEPROM.h" #include "EEPROM.h"
#include "Inf_4G.h"
/* 类型定义 -----------------------------------------------------------------*/ /* 类型定义 -----------------------------------------------------------------*/
// 工作模式枚举 // 工作模式枚举

View File

@ -6,33 +6,8 @@ uint32_t ozone_timer = 0; //
uint32_t OZONE_ON_TIME = 1; // 运行1分钟 uint32_t OZONE_ON_TIME = 1; // 运行1分钟
uint32_t OZONE_OFF_TIME = 1; // 停止1分钟 uint32_t OZONE_OFF_TIME = 1; // 停止1分钟
void Save_Ozone_Time_To_EEPROM(uint32_t on_time, uint32_t off_time) // 保存
{
Save_Float_To_EEPROM(OZONE_ON_TIME_ADDR, (float)on_time); // 保存运行时间
Save_Float_To_EEPROM(OZONE_OFF_TIME_ADDR, (float)off_time); // 保存停止时间
Inf_AT24C02_WriteByte(OZONE_FLAG_ADDR, OZONE_FLAG_VAL); // 保存标志
}
// 从EEPROM读取臭氧时间参数OZENE_FLAG_ADDR
void Load_Ozone_Time_From_EEPROM(void)
{
uint8_t flag = Inf_AT24C02_ReadByte(OZONE_FLAG_ADDR);
if(flag == OZONE_FLAG_VAL)
{
// 读取时间参数
OZONE_ON_TIME = (uint32_t)Read_Float_From_EEPROM(OZONE_ON_TIME_ADDR);
OZONE_OFF_TIME = (uint32_t)Read_Float_From_EEPROM(OZONE_OFF_TIME_ADDR);
}
else
{
// 如果EEPROM中没有有效数据使用默认值并保存
Save_Ozone_Time_To_EEPROM(OZONE_ON_TIME, OZONE_OFF_TIME);
}
}
void Ozone_Init(void) void Ozone_Init(void)
{ {
Load_Ozone_Time_From_EEPROM();
ozone_running = 1; // 上电直接启动 ozone_running = 1; // 上电直接启动
ozone_timer = 0; // 初始化计时器 ozone_timer = 0; // 初始化计时器
Ozone_Control(1); // 初始状态直接开启 Ozone_Control(1); // 初始状态直接开启

View File

@ -3,21 +3,13 @@
#include "main.h" #include "main.h"
#include "Driver.h" #include "Driver.h"
#include "EEPROM.h"
#define OZONE_ON_TIME_ADDR 0x80 // 臭氧运行时间存储地址
#define OZONE_OFF_TIME_ADDR 0x84 // 臭氧停止时间存储地址
#define OZONE_FLAG_ADDR 0x88 // 臭氧标志地址
#define OZONE_FLAG_VAL 0xA7 //臭氧参数标志位值
// 臭氧控制参数 // 臭氧控制参数
extern uint8_t ozone_running; // 默认不运行 extern uint8_t ozone_running; // 默认不运行
extern uint32_t ozone_timer; // 臭氧计时器 extern uint32_t ozone_timer; // 臭氧计时器
extern uint32_t OZONE_ON_TIME; // 运行5分钟 extern uint32_t OZONE_ON_TIME; // 运行5分钟
extern uint32_t OZONE_OFF_TIME; // 停止25分钟 extern uint32_t OZONE_OFF_TIME; // 停止25分钟
void Ozone_Init(void);
void Ozone_Control_Update(void);
void Ozone_Init(void); // 初始化
void Ozone_Conteol(uint8_t state); // 控制
void Ozone_Control_Update(void); // 更新
void Save_Ozone_Time_To_EEPROM(uint32_t on_time, uint32_t off_time); // 保存
void Load_Ozone_Time_From_EEPROM(void); // 加载
#endif #endif

View File

@ -1,5 +1,6 @@
#include "Save_Time.h" #include "Save_Time.h"
#include "Save_Time.h"
void Time_Save(void) void Time_Save(void)
{ {
@ -65,52 +66,5 @@ void Time_Load(void)
Inf_AT24C02_ReadBytes(TIME_ADDR_IRRIG_LOW_FAN_OFF, (uint8_t*)&LOW_LEVEL_FAN_OFF_TIME, sizeof(uint32_t)); Inf_AT24C02_ReadBytes(TIME_ADDR_IRRIG_LOW_FAN_OFF, (uint8_t*)&LOW_LEVEL_FAN_OFF_TIME, sizeof(uint32_t));
Inf_AT24C02_ReadBytes(TIME_ADDR_IRRIG_FIRST_LOW_ON, (uint8_t*)&FIRST_LOW_FAN_ON_TIME, sizeof(uint32_t)); Inf_AT24C02_ReadBytes(TIME_ADDR_IRRIG_FIRST_LOW_ON, (uint8_t*)&FIRST_LOW_FAN_ON_TIME, sizeof(uint32_t));
Inf_AT24C02_ReadBytes(TIME_ADDR_IRRIG_FIRST_LOW_OFF, (uint8_t*)&FIRST_LOW_FAN_OFF_TIME, sizeof(uint32_t)); Inf_AT24C02_ReadBytes(TIME_ADDR_IRRIG_FIRST_LOW_OFF, (uint8_t*)&FIRST_LOW_FAN_OFF_TIME, sizeof(uint32_t));
// 检查值是否有效,如果无效则设置默认值
if(DIRECT_HIGH_PUMP_ON_TIME == 0xFFFFFFFF || DIRECT_HIGH_PUMP_ON_TIME == 0)
{
// 直排模式默认值
DIRECT_HIGH_PUMP_ON_TIME = 1; // 1分钟
DIRECT_HIGH_PUMP_OFF_TIME = 150; // 150分钟
DIRECT_HIGH_FAN_ON_TIME = 40; // 40分钟
DIRECT_HIGH_FAN_OFF_TIME = 2; // 2分钟
DIRECT_LOW_FAN_ON_TIME = 10; // 10分钟
DIRECT_LOW_FAN_OFF_TIME = 20; // 20分钟
DIRECT_FIRST_LOW_FAN_ON = 40; // 40分钟
DIRECT_FIRST_LOW_FAN_OFF = 2; // 2分钟
// 冲厕模式默认值
FLUSH_HIGH_PUMP_ON_TIME = 1; // 1分钟
FLUSH_HIGH_PUMP_OFF_TIME = 150; // 150分钟
FLUSH_HIGH_FAN_ON_TIME = 40; // 40分钟
FLUSH_HIGH_FAN_OFF_TIME = 2; // 2分钟
FLUSH_LOW_FAN_ON_TIME = 5; // 5分钟
FLUSH_LOW_FAN_OFF_TIME = 25; // 25分钟
FLUSH_FIRST_LOW_FAN_ON = 40; // 40分钟
FLUSH_FIRST_LOW_FAN_OFF = 2; // 2分钟
// 灌溉模式默认值
HIGH_LEVEL_PUMP_ON_TIME = 1; // 1分钟
HIGH_LEVEL_PUMP_OFF_TIME = 120; // 120分钟
HIGH_LEVEL_FAN_ON_TIME = 20; // 20分钟
HIGH_LEVEL_FAN_OFF_TIME = 5; // 5分钟
FIRST_LOW_FAN_ON_TIME = 10; // 10分钟
FIRST_LOW_FAN_OFF_TIME = 10; // 10分钟
LOW_LEVEL_FAN_ON_TIME = 5; // 5分钟
LOW_LEVEL_FAN_OFF_TIME = 40; // 40分钟
// 特殊模式默认值
SPECIAL_INITIAL_STOP_TIME = 1440; // 24小时 = 1440分钟
SPECIAL_FIRST_PHASE_TIME = 2880; // 48小时 = 2880分钟
SPECIAL_PUMP_RUN_TIME = 1; // 1分钟
SPECIAL_FIRST_STOP_TIME = 360; // 360分钟
SPECIAL_SECOND_PHASE_TIME = 1; // 1分钟如需48小时请改为2880
SPECIAL_SECOND_STOP_TIME = 240; // 240分钟
// 保存默认值到EEPROM
Time_Save();
}
} }

View File

@ -1,15 +1,11 @@
#include "electrode.h" #include "electrode.h"
// 除磷控制变量 // 除磷控制相关变量
uint32_t phosphorus_timer = 0; // 除磷计时器 uint8_t phosphorus_running = 0; // 除磷运行状态
uint32_t PHOSPHORUS_RUN_TIME = 20; // 运行20分钟
uint32_t PHOSPHORUS_STOP_TIME = 40; // 停止40分钟
uint8_t polarity_state = 0; // 极性状态0-正常1-反转 uint8_t polarity_state = 0; // 极性状态0-正常1-反转
uint8_t Dephosphorization_state = 0; // 0表示禁用1表示启用 uint32_t phosphorus_timer = 0; // 运行时间计数器(分钟)
uint32_t PHOSPHORUS_RUN_TIME = 20; // 默认运行时间20分钟
uint32_t PHOSPHORUS_STOP_TIME = 40; // 默认停止时间40分钟
// 除磷极性控制函数
// 除磷极性控制函数 // 除磷极性控制函数
void Control_Phosphorus_Polarity(void) void Control_Phosphorus_Polarity(void)
@ -27,26 +23,69 @@ void Control_Phosphorus_Polarity(void)
Control_Plate2(1); // 极板2为正极 Control_Plate2(1); // 极板2为正极
} }
} }
// 除磷控制更新函数
void Phosphorus_Control_Update(void) // 除磷时间更新函数
void Phosphorus_Timer_Update(void)
{ {
// 按20分钟开40分钟关的逻辑运行 uint8_t pump_status = Read_WaterPump_Status();
if(phosphorus_timer <= PHOSPHORUS_RUN_TIME)
// 水泵启动时,启动除磷
if(pump_status && !phosphorus_running)
{ {
Control_Phosphorus(1); // 开启除磷 phosphorus_running = 1;
Dephosphorization_state = 1; phosphorus_timer = 0;
// 切换极性并启动
polarity_state = !polarity_state;
Control_Phosphorus_Polarity();
} }
else if(phosphorus_timer <= (PHOSPHORUS_RUN_TIME + PHOSPHORUS_STOP_TIME))
// 除磷运行计时
if(phosphorus_running)
{ {
Control_Phosphorus(0); // 关闭除磷 phosphorus_timer++;
Dephosphorization_state = 0; // 判断是否达到运行时间
} if(phosphorus_timer >= PHOSPHORUS_RUN_TIME)
else {
{ Control_Phosphorus(0); // 停止除磷
phosphorus_timer = 0; // 重置计时器 phosphorus_running = 0;
polarity_state = !polarity_state; // 切换极性 phosphorus_timer = 0;
Control_Phosphorus_Polarity(); // 更新极性 }
Control_Phosphorus(1); // 开始新循环 }
}
// 设置运行时间
void Set_Phosphorus_Runtime(uint32_t minutes)
{
PHOSPHORUS_RUN_TIME = minutes;
// printf("设置除磷运行时间:%d分钟\n", PHOSPHORUS_RUN_TIME);
}
// 设置停止时间
void Set_Phosphorus_StopTime(uint32_t minutes)
{
PHOSPHORUS_STOP_TIME = minutes;
// printf("设置除磷停止时间:%d分钟\n", PHOSPHORUS_STOP_TIME);
}
// 定义状态常量,使代码更易读
#define DEPHOSPHO_ENABLED 1
#define DEPHOSPHO_DISABLED 0
uint8_t Dephosphorization_state = DEPHOSPHO_DISABLED; // 初始化为禁用状态
uint8_t electrode_Init(uint8_t state)
{
if (state)
{
Phosphorus_Timer_Update();
Dephosphorization_state = DEPHOSPHO_ENABLED;
return DEPHOSPHO_ENABLED;
}
else
{
Control_Phosphorus(0);
Dephosphorization_state = DEPHOSPHO_DISABLED;
return DEPHOSPHO_DISABLED;
} }
} }

View File

@ -9,14 +9,10 @@ extern uint32_t phosphorus_timer; // 运行时间计数器(分钟)
extern uint32_t PHOSPHORUS_RUN_TIME; // 运行时间设置 extern uint32_t PHOSPHORUS_RUN_TIME; // 运行时间设置
extern uint32_t PHOSPHORUS_STOP_TIME; // 停止时间设置 extern uint32_t PHOSPHORUS_STOP_TIME; // 停止时间设置
extern uint8_t Dephosphorization_state; extern uint8_t Dephosphorization_state;
extern uint32_t PHOSPHORUS_RUN_TIME;
extern uint32_t PHOSPHORUS_STOP_TIME;
void Control_Phosphorus_Polarity(void); void Control_Phosphorus_Polarity(void);
void Phosphorus_Timer_Update(void);
void Phosphorus_Control_Update(void); void Set_Phosphorus_Runtime(uint32_t minutes);
void Set_Phosphorus_StopTime(uint32_t minutes);
uint8_t electrode_Init(uint8_t state);
#endif #endif

View File

@ -1,22 +1,15 @@
// 定义供电类型
#include "guangshi.h" #include "guangshi.h"
#define POWER_NONE 0 // 无供电 uint8_t bizohi=0;
#define POWER_AC 1 // 市电供电
#define POWER_SOLAR 2 // 太阳能供电
// 市电检测相关变量
uint8_t bizohi = 0;
#define AC_SAMPLE_TIME 100 // 采样时间窗口 #define AC_SAMPLE_TIME 100 // 采样时间窗口
#define AC_CHANGE_THRESHOLD 5 // 最小变化次数阈值 #define AC_CHANGE_THRESHOLD 5 // 最小变化次数阈值
static uint8_t last_ac_status = 0; static uint8_t last_ac_status = 0;
static uint8_t change_count = 0; static uint8_t change_count = 0;
static uint32_t sample_timer = 0; static uint32_t sample_timer = 0;
// 市电检测函数
void Check_Power_Source(void) void Check_Power_Source(void)
{ {
uint8_t current_ac = Read_MainPower(); // 读取市电检测端口 uint8_t current_ac = Read_MainPower();
// 检测电平变化 // 检测电平变化
if(current_ac != last_ac_status) if(current_ac != last_ac_status)
@ -46,37 +39,4 @@ void Check_Power_Source(void)
} }
} }
// 太阳能检测函数
uint8_t Check_Solar_Power(void)
{
// 通过ADC值判断太阳能状态
// data1[1]是太阳能电压ADC值data1[2]是市电电压ADC值
if(data1[1] > data1[2])
{
return 1; // 太阳能电压足够
}
return 0; // 太阳能电压不足
}
// 获取当前供电类型
uint8_t Get_Power_Type(void)
{
// 先检查市电状态
if(bizohi == 1) // 市电正常
{
printf("当前使用市电供电\r\n");
return POWER_AC;
}
// 检查太阳能状态
else if(Check_Solar_Power())
{
printf("当前使用太阳能供电\r\n");
return POWER_SOLAR;
}
else
{
printf("当前无供电\r\n");
return POWER_NONE;
}
}

View File

@ -4,7 +4,7 @@
#include "Driver.h" #include "Driver.h"
extern uint8_t bizohi; extern uint8_t bizohi;
void Check_Power_Source(void); void Check_Power_Source(void);
uint8_t Get_Power_Type(void);
#endif #endif

View File

@ -11,7 +11,7 @@ void Dredge_Control(void)
if(dredge_flag && timer_1min_cnt >= 5) // 排泥5分钟 if(dredge_flag && timer_1min_cnt >= 5) // 排泥5分钟
{ {
Control_Dredge(0); // 关闭排泥 HAL_GPIO_WritePin(GPIOG, GPIO_PIN_4, GPIO_PIN_RESET); // 关闭排泥
dredge_flag = 0; dredge_flag = 0;
timer_1min_cnt = 0; timer_1min_cnt = 0;
} }
@ -19,7 +19,7 @@ void Dredge_Control(void)
if(timer_1hour_cnt >= 72) // 72小时到 if(timer_1hour_cnt >= 72) // 72小时到
{ {
timer_1hour_cnt = 0; timer_1hour_cnt = 0;
Control_Dredge(1); // 关闭排泥 // 开启排泥 HAL_GPIO_WritePin(GPIOG, GPIO_PIN_4, GPIO_PIN_SET); // 开启排泥
dredge_flag = 1; dredge_flag = 1;
} }
} }

View File

@ -2,7 +2,7 @@
#define _PAINI_H #define _PAINI_H
#include "main.h" #include "main.h"
#include "Driver.h"
// 全局变量 // 全局变量
extern uint32_t timer_1s_cnt; // 1秒计数器 extern uint32_t timer_1s_cnt; // 1秒计数器
extern uint32_t timer_1min_cnt; // 1分钟计数器 extern uint32_t timer_1min_cnt; // 1分钟计数器

View File

@ -1,2 +0,0 @@
#include "solar_energy.h"

View File

@ -1,12 +0,0 @@
#ifndef __PAINI_H
#define __PAINI_H
#include "adc.h"
#include "stdio.h"
#include "math.h"
#include "Inf_4G.h"
#endif

View File

@ -1,76 +1,58 @@
#include "wendu.h" #include"wendu.h"
// 添加温度阈值变量(默认值) // 添加温度阈值变量(默认值)
float temp_lower_limit = 15.0f; // 默认下限温度15℃ float temp_lower_limit = 15.0f; // 默认下限温度15℃
float temp_upper_limit = 20.0f; // 默认上限温度20℃ float temp_upper_limit = 20.0f; // 默认上限温度20℃
// 定义常量 uint16_t adc_value = 0;
float voltage = 0.0f, temperature = 0.0f;
// 读取和打印温度的函数
#define BALANCE_R 10000.0f // 10K分压电阻 #define BALANCE_R 10000.0f // 10K分压电阻
#define NTC_R25 10000.0f // NTC在25℃时的电阻值假设是10K NTC #define NTC_R25 10000.0f // NTC在25℃时的电阻值假设是10K NTC
#define BETA 3950.0f // B值需要根据您的NTC型号修改 #define BETA 3950.0f // B值需要根据您的NTC型号修改
#define KELVIN_OFFSET 273.15f #define KELVIN_OFFSET 273.15f
float voltage = 0.0f, temperature = 0.0f; void Print_Temperature(void)
void Save_Temp_Limits_To_EEPROM(float lower, float upper)
{
// 保存温度阈值
Save_Float_To_EEPROM(TEMP_LOWER_LIMIT_ADDR,lower);
Save_Float_To_EEPROM(TEMP_UPPER_LIMIT_ADDR,upper);
Inf_AT24C02_WriteByte(TEMP_FLAG_ADDR,TEMP_FLAG_VAL);
}
// 从EEPROM加载温度阈值
void Load_Temp_Limits_From_EEPROM(void)
{
uint8_t flag = Inf_AT24C02_ReadByte(TEMP_FLAG_ADDR);
if(flag==TEMP_FLAG_VAL)
{
temp_lower_limit = Read_Float_From_EEPROM(TEMP_LOWER_LIMIT_ADDR);
temp_upper_limit = Read_Float_From_EEPROM(TEMP_UPPER_LIMIT_ADDR);
}
else
{
Save_Temp_Limits_To_EEPROM(temp_lower_limit,temp_upper_limit);
}
}
//实现更新函数
void Update_Temp_Limits(float lower, float upper)
{
temp_lower_limit = lower; // 更新下限
temp_upper_limit = upper; // 更新上限
Save_Temp_Limits_To_EEPROM(lower, upper); // 保存到EEPROM
}
void Print_Temperature(uint16_t *data)
{ {
const float CALIBRATION_FACTOR = 0.6f; const float CALIBRATION_FACTOR = 0.6f;
// 直接使用data[1]作为ADC值ADC_IN4通道 HAL_ADC_Start(&hadc3);
uint16_t adc_value = data[0];
// 转换为电压值,并应用校准系数 if(HAL_ADC_PollForConversion(&hadc3, 100) == HAL_OK)
voltage = (float)adc_value * (3.3f / 4096.0f) * CALIBRATION_FACTOR; {
// 读取ADC值
// 计算NTC电阻值 adc_value = HAL_ADC_GetValue(&hadc3);
// 如果NTC接VCC上拉用这个
float ntc_r = BALANCE_R * voltage / (3.3f - voltage); // 转换为电压值,并应用校准系数
voltage = (float)adc_value * (3.3f / 4096.0f) * CALIBRATION_FACTOR;
// 如果NTC接地下拉用这个
// float ntc_r = BALANCE_R * (3.3f - voltage) / voltage; // 计算NTC电阻值
// 如果NTC接VCC上拉用这个
// 计算温度 float ntc_r = BALANCE_R * voltage / (3.3f - voltage);
temperature = 1.0f / (log(ntc_r/NTC_R25)/BETA + 1.0f/(25.0f + KELVIN_OFFSET)) - KELVIN_OFFSET;
// printf("T: %.2f°C\r\n", temperature); // 如果NTC接地下拉用这个
// float ntc_r = BALANCE_R * (3.3f - voltage) / voltage;
// 计算温度
temperature = 1.0f / (log(ntc_r/NTC_R25)/BETA + 1.0f/(25.0f + KELVIN_OFFSET)) - KELVIN_OFFSET;
// 控制加热膜逻辑
// 使用可调节的温度阈值进行控制
if (temperature < temp_lower_limit) {
// 温度低于下限,开启加热
Control_Heater(1);
//printf("温度%.2f低于%.2f℃,开启加热\n", temperature, temp_lower_limit);
}
else if (temperature > temp_upper_limit) {
// 温度高于上限,关闭加热
Control_Heater(0);
// printf("温度%.2f高于%.2f℃,关闭加热\n", temperature, temp_upper_limit);
}
// 控制加热膜逻辑
// 使用可调节的温度阈值进行控制
if (temperature < temp_lower_limit) {
// 温度低于下限,开启加热
Control_Heater(1);
//printf("温度%.2f低于%.2f℃,开启加热\n", temperature, temp_lower_limit);
}
else if (temperature > temp_upper_limit) {
// 温度高于上限,关闭加热
Control_Heater(0);
//printf("温度%.2f高于%.2f℃,关闭加热\n", temperature, temp_upper_limit);
} }
HAL_ADC_Stop(&hadc3);
} }

View File

@ -6,21 +6,12 @@
#include "math.h" #include "math.h"
#include "Inf_4G.h" #include "Inf_4G.h"
#include "Driver.h" #include "Driver.h"
#include "EEPROM.h"
#define TEMP_LOWER_LIMIT_ADDR 0x70 // 温度下限存储地址
#define TEMP_UPPER_LIMIT_ADDR 0x74 // 温度上限存储地址
#define TEMP_FLAG_ADDR 0x78 // 温度标志地址
#define TEMP_FLAG_VAL 0xA6 // 温度标志值
extern uint16_t adc_value; extern uint16_t adc_value;
extern float voltage, temperature; extern float voltage, temperature;
extern volatile float analog_status[3]; // 添加这行! extern volatile float analog_status[3]; // 添加这行!
extern float temp_lower_limit; // 默认下限温度15℃ extern float temp_lower_limit; // 默认下限温度15℃
extern float temp_upper_limit; // 默认上限温度20℃ extern float temp_upper_limit; // 默认上限温度20℃
void Print_Temperature(uint16_t *data); void Print_Temperature(void);
void Load_Temp_Limits_From_EEPROM(void);
#endif #endif

View File

@ -32,15 +32,12 @@ extern "C" {
/* USER CODE END Includes */ /* USER CODE END Includes */
extern ADC_HandleTypeDef hadc1;
extern ADC_HandleTypeDef hadc3; extern ADC_HandleTypeDef hadc3;
/* USER CODE BEGIN Private defines */ /* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */ /* USER CODE END Private defines */
void MX_ADC1_Init(void);
void MX_ADC3_Init(void); void MX_ADC3_Init(void);
/* USER CODE BEGIN Prototypes */ /* USER CODE BEGIN Prototypes */

View File

@ -57,7 +57,6 @@ extern uint8_t aRxBuffer;
extern uint8_t received_control; // 添加一个标志来表示是否收到控制命令 extern uint8_t received_control; // 添加一个标志来表示是否收到控制命令
extern uint16_t second_counter; extern uint16_t second_counter;
#define SECONDS_PER_MINUTE 60 // 60秒 = 1分钟 #define SECONDS_PER_MINUTE 60 // 60秒 = 1分钟
extern uint16_t data1[3];
/* USER CODE END EFP */ /* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/ /* Private defines -----------------------------------------------------------*/

View File

@ -24,57 +24,8 @@
/* USER CODE END 0 */ /* USER CODE END 0 */
ADC_HandleTypeDef hadc1;
ADC_HandleTypeDef hadc3; ADC_HandleTypeDef hadc3;
DMA_HandleTypeDef hdma_adc3;
/* ADC1 init function */
void MX_ADC1_Init(void)
{
/* USER CODE BEGIN ADC1_Init 0 */
/* USER CODE END ADC1_Init 0 */
ADC_ChannelConfTypeDef sConfig = {0};
/* USER CODE BEGIN ADC1_Init 1 */
/* USER CODE END ADC1_Init 1 */
/** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)
*/
hadc1.Instance = ADC1;
hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2;
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
hadc1.Init.ScanConvMode = DISABLE;
hadc1.Init.ContinuousConvMode = DISABLE;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.NbrOfConversion = 1;
hadc1.Init.DMAContinuousRequests = DISABLE;
hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
if (HAL_ADC_Init(&hadc1) != HAL_OK)
{
Error_Handler();
}
/** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
*/
sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLETIME_3CYCLES;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN ADC1_Init 2 */
/* USER CODE END ADC1_Init 2 */
}
/* ADC3 init function */ /* ADC3 init function */
void MX_ADC3_Init(void) void MX_ADC3_Init(void)
{ {
@ -84,6 +35,7 @@ void MX_ADC3_Init(void)
/* USER CODE END ADC3_Init 0 */ /* USER CODE END ADC3_Init 0 */
ADC_ChannelConfTypeDef sConfig = {0}; ADC_ChannelConfTypeDef sConfig = {0};
ADC_InjectionConfTypeDef sConfigInjected = {0};
/* USER CODE BEGIN ADC3_Init 1 */ /* USER CODE BEGIN ADC3_Init 1 */
@ -94,14 +46,14 @@ void MX_ADC3_Init(void)
hadc3.Instance = ADC3; hadc3.Instance = ADC3;
hadc3.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc3.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2;
hadc3.Init.Resolution = ADC_RESOLUTION_12B; hadc3.Init.Resolution = ADC_RESOLUTION_12B;
hadc3.Init.ScanConvMode = ENABLE; hadc3.Init.ScanConvMode = DISABLE;
hadc3.Init.ContinuousConvMode = ENABLE; hadc3.Init.ContinuousConvMode = DISABLE;
hadc3.Init.DiscontinuousConvMode = DISABLE; hadc3.Init.DiscontinuousConvMode = DISABLE;
hadc3.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc3.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc3.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc3.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc3.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc3.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc3.Init.NbrOfConversion = 3; hadc3.Init.NbrOfConversion = 1;
hadc3.Init.DMAContinuousRequests = ENABLE; hadc3.Init.DMAContinuousRequests = DISABLE;
hadc3.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc3.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
if (HAL_ADC_Init(&hadc3) != HAL_OK) if (HAL_ADC_Init(&hadc3) != HAL_OK)
{ {
@ -112,26 +64,24 @@ void MX_ADC3_Init(void)
*/ */
sConfig.Channel = ADC_CHANNEL_4; sConfig.Channel = ADC_CHANNEL_4;
sConfig.Rank = 1; sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; sConfig.SamplingTime = ADC_SAMPLETIME_144CYCLES;
if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK) if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
/** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. /** Configures for the selected ADC injected channel its corresponding rank in the sequencer and its sample time
*/ */
sConfig.Channel = ADC_CHANNEL_9; sConfigInjected.InjectedChannel = ADC_CHANNEL_4;
sConfig.Rank = 2; sConfigInjected.InjectedRank = 1;
if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK) sConfigInjected.InjectedNbrOfConversion = 1;
{ sConfigInjected.InjectedSamplingTime = ADC_SAMPLETIME_3CYCLES;
Error_Handler(); sConfigInjected.ExternalTrigInjecConvEdge = ADC_EXTERNALTRIGINJECCONVEDGE_NONE;
} sConfigInjected.ExternalTrigInjecConv = ADC_INJECTED_SOFTWARE_START;
sConfigInjected.AutoInjectedConv = DISABLE;
/** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. sConfigInjected.InjectedDiscontinuousConvMode = DISABLE;
*/ sConfigInjected.InjectedOffset = 0;
sConfig.Channel = ADC_CHANNEL_14; if (HAL_ADCEx_InjectedConfigChannel(&hadc3, &sConfigInjected) != HAL_OK)
sConfig.Rank = 3;
if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
@ -145,28 +95,7 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
{ {
GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitTypeDef GPIO_InitStruct = {0};
if(adcHandle->Instance==ADC1) if(adcHandle->Instance==ADC3)
{
/* USER CODE BEGIN ADC1_MspInit 0 */
/* USER CODE END ADC1_MspInit 0 */
/* ADC1 clock enable */
__HAL_RCC_ADC1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
/**ADC1 GPIO Configuration
PA0-WKUP ------> ADC1_IN0
*/
GPIO_InitStruct.Pin = GPIO_PIN_0;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN ADC1_MspInit 1 */
/* USER CODE END ADC1_MspInit 1 */
}
else if(adcHandle->Instance==ADC3)
{ {
/* USER CODE BEGIN ADC3_MspInit 0 */ /* USER CODE BEGIN ADC3_MspInit 0 */
@ -186,25 +115,6 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
/* ADC3 DMA Init */
/* ADC3 Init */
hdma_adc3.Instance = DMA2_Stream0;
hdma_adc3.Init.Channel = DMA_CHANNEL_2;
hdma_adc3.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_adc3.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_adc3.Init.MemInc = DMA_MINC_ENABLE;
hdma_adc3.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
hdma_adc3.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
hdma_adc3.Init.Mode = DMA_CIRCULAR;
hdma_adc3.Init.Priority = DMA_PRIORITY_LOW;
hdma_adc3.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
if (HAL_DMA_Init(&hdma_adc3) != HAL_OK)
{
Error_Handler();
}
__HAL_LINKDMA(adcHandle,DMA_Handle,hdma_adc3);
/* USER CODE BEGIN ADC3_MspInit 1 */ /* USER CODE BEGIN ADC3_MspInit 1 */
/* USER CODE END ADC3_MspInit 1 */ /* USER CODE END ADC3_MspInit 1 */
@ -214,24 +124,7 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
{ {
if(adcHandle->Instance==ADC1) if(adcHandle->Instance==ADC3)
{
/* USER CODE BEGIN ADC1_MspDeInit 0 */
/* USER CODE END ADC1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_ADC1_CLK_DISABLE();
/**ADC1 GPIO Configuration
PA0-WKUP ------> ADC1_IN0
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0);
/* USER CODE BEGIN ADC1_MspDeInit 1 */
/* USER CODE END ADC1_MspDeInit 1 */
}
else if(adcHandle->Instance==ADC3)
{ {
/* USER CODE BEGIN ADC3_MspDeInit 0 */ /* USER CODE BEGIN ADC3_MspDeInit 0 */
@ -247,8 +140,6 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
*/ */
HAL_GPIO_DeInit(GPIOF, GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_8); HAL_GPIO_DeInit(GPIOF, GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_8);
/* ADC3 DMA DeInit */
HAL_DMA_DeInit(adcHandle->DMA_Handle);
/* USER CODE BEGIN ADC3_MspDeInit 1 */ /* USER CODE BEGIN ADC3_MspDeInit 1 */
/* USER CODE END ADC3_MspDeInit 1 */ /* USER CODE END ADC3_MspDeInit 1 */

View File

@ -41,7 +41,6 @@ void MX_DMA_Init(void)
/* DMA controller clock enable */ /* DMA controller clock enable */
__HAL_RCC_DMA1_CLK_ENABLE(); __HAL_RCC_DMA1_CLK_ENABLE();
__HAL_RCC_DMA2_CLK_ENABLE();
/* DMA interrupt init */ /* DMA interrupt init */
/* DMA1_Stream2_IRQn interrupt configuration */ /* DMA1_Stream2_IRQn interrupt configuration */

View File

@ -58,18 +58,16 @@
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */ /* USER CODE BEGIN PV */
// 闂傚倸鍊搁崐鎼佸磹妞嬪海鐭嗗〒姘e亾妤犵偛顦甸弫宥夊礋椤掍焦顔囨繝寰锋澘鈧洟宕姘辨殾闁哄被鍎查悡鏇犫偓鍏夊亾闁逞屽墴瀹曟洟骞嬮悩鐢殿槸闂佸搫绋侀崢浠嬫偂濞嗘挻鐓熸俊銈傚亾闁绘锕﹀▎銏ゆ嚑椤掑倻锛滈梺閫炲苯澧柣锝嗙箞瀹曠喖顢楅崒姘闂佽楠哥粻宥夊磿鏉堚晜宕查柟鐑橆殕閸嬧晝鈧娲栧ú銊у婵傚憡鐓冪憸婊堝礈閻旂厧鏋侀柟鍓х帛閺呮悂鏌ㄩ悤鍌涘0 // 鍒濆鍖栦负0
uint8_t aRxBuffer; uint8_t aRxBuffer;
uint8_t received_control = 0; // 婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柟闂寸绾惧潡鏌熺€电ǹ啸缂佲偓婵犲洦鐓冪憸婊堝礈濮樿泛桅闁告洦鍨伴崡鎶芥煕閳╁喚娈旀い蹇d邯閺屾稑鈻庤箛鏇狀啋闂佸搫鐭夌紞渚€鐛崶顒夋晢濠㈣泛锕ラ宥夋⒒娴e摜锛嶇紒顕呭灠铻為柛鎰靛枛閽冪喓鈧箍鍎遍悧婊冾瀶閵娾晜鈷戦柛娑橈攻鐏忕増鎱ㄥΟ绋垮闁告帗甯掗埢搴ㄥ箛椤掑倻鐛梻浣筋潐濠㈡﹢鎮樺璺虹柧婵犲﹤鐗婇埛鎴︽煕濞戞﹫姊楃紒鍫曚憾閺屾盯濡搁妶鍛ギ闂佽鍠楅敃銏ゅ蓟閸℃鍚嬮柛鈾€鏅滈ˉ濠冧繆閻愵亜鈧牠宕濋幋锕€鍨傞柣鎴灻欢鐐烘煕閺囥劌鍘靛ù婊勭矒閺屾洘绻涢崹顔煎濡炪們鍎茬划宥夊Φ閸曨垼鏁囬柣鎰綑閺嬬娀姊虹拠鈥虫灆缂侇喗鐟ラ悾鐤亹閹烘繃鏅濆銈庡亽閸橀箖鏌﹂悽鍛娾拻闁稿本鐟х粣鏃€绻涙担鍐叉濞咃絽鈹戦悙鑸靛涧缂傚秳绶氳棢闁圭偓鐣禒姘舵煙閹澘袚闁抽攱甯掗湁闁挎繂鎳忛崯鐐烘煙椤栨氨澧﹂柟顔筋殔椤繈宕¢悙鎻掔闁诲氦顫夊ú婵嬶綖婢跺备鍋撻棃娑栧仮鐎殿喖鐖奸獮瀣偐閸偅鐦炲┑鐘垫暩閸嬬偤骞愭繝姘槬闁告劦鍠栫壕濠氭煙閹呬邯闁稿鎸搁埢鎾诲垂椤旂晫浜栭梻浣告啞閺屻劑鏌婇敐澶屽祦闁硅揪绠戠粈瀣亜閺嶃劎鐓紒鍗炵埣濮婃椽宕ㄦ繝鍐槱闂佸憡枪閸嬫劙寮鈧獮妯肩磼濡攱瀚藉┑鐐舵彧缁茶偐鎷冮敃鍌氱哗濞寸厧鐡ㄩ悡鐔搞亜閹捐泛浠﹂柛鐘愁焽閳ь剝顫夊ú姗€鏁冮姀鈥茬箚婵繂鐭堝Σ璇参旈悩闈涗汗闁稿鎹囧濠氬磼濮橆兘鍋撴搴g焼濞撴埃鍋撴鐐差樀閺佸秹宕熼鐘靛幆闂備礁婀遍崕銈夈€冮崨鏉戝瀭闁稿本绋撶弧鈧梻鍌氱墛娓氭宕曡箛鏇犵<闁绘瑢鍋撻柛锝忕秮瀵濡搁埡鍌氫簽闂佺ǹ鏈粙鎴︻敂閿燂拷 uint8_t received_control = 0; // 娣诲姞涓€涓爣蹇楁潵琛ㄧず鏄惁鏀跺埌鎺у埗鍛戒护
volatile uint8_t mode_control_flag = 0; volatile uint8_t mode_control_flag = 0;
#define READ_CONTROL_INTERVAL 100 // 闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑﹦绋忔繝銏硾椤戝洭銆呴幓鎹楀綊鎮╁顔煎壈缂佺偓鍎冲锟犲蓟閿涘嫪娌悹鍥ㄥ絻婵酣姊洪崫鍕靛剮闁煎啿鐖奸獮澶愬箹娴懓浜遍梺鍓插亝缁诲嫰鎮烽妸褏纾藉ù锝呮惈瀛濈紒鍓ц檸閸欏啴鐛径宀€鐭欐繛鍡樺劤閹垶绻濋姀锝嗙【闁挎洏鍎卞嵄妞ゆ巻鍋撻柍瑙勫灦楠炲﹪鏌涙繝鍐╃妤犵偛锕ラ幆鏃堝煡閸℃娅婃繝鐢靛█濞佳囶敄閸℃稒鍋傛繛鍡樻尰閸婂灚绻涢幋鐑嗕痪妞ゅ繐妫涚粻鏃€鎱ㄥ鍡楀幋闁衡偓閼恒儯浜滈柡鍌涘閹牓鏌箛鏃傚弨闁哄备鈧磭鏆嗛悗锝庡墰琚﹀┑鐘殿暯閸撴繈骞冮崒娑楃箚闁绘垼妫勫敮濡炪倖妫佸畷鐢靛閹€鏀介柣妯活問閺嗩垱淇婇幓鎺撳殗鐎规洘鍨垮畷鐔碱敃椤愩倕濮洪梻浣芥硶閸犳挻鎱ㄩ幘顔煎嚑濞撴埃鍋撻柡宀€鍠栧畷婊嗩槾閻㈩垱鐩弻锟犲川椤旇棄鈧劙鏌仦璇插闁诡喓鍊濆畷鎺戔槈濮楀棔绱<E6A394>?(ms) #define READ_CONTROL_INTERVAL 100 // 鎺ユ敹鎺у埗鍛戒护鐨勯棿锟<E6A3BF>?(ms)
#define DATA_UPLOAD_INTERVAL 10000 // 闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊瑜滃ù鏍煏婵炵偓娅嗛柛銈呭閺屻倗绮欑捄銊ょ驳濠电偛鎳愭慨鍨┍婵犲洤围闁稿本鐭竟鏇㈡⒒娴i涓茬紒韫矙閹ê顫濈捄铏诡唵闂佸憡绋掑娆撳箲閼哥偣浜滈柟鎯ь嚟閳洟鏌h箛鎾虫殭闁宠鍨块幃鈺呭垂椤愶絾鐦庡┑鐘愁問閸犳绻涙繝鍥х疇婵°倕鎳庨柋鍥煛閸モ晛鏋庨柍褜鍓欓崲鏌ュ煘閹达附鍋愰柛娆忣槸椤︹晠姊虹紒妯诲暗闁哥姵鐗犲濠氬即閻旇櫣顔曢梺鍓茬厛閸犳牗鎱ㄦ惔鈽嗘富闁靛牆鎳忕粋瀣煕濡灝袚缂佸矁椴哥换婵嬪炊閼稿灚娅囬梻渚€娼х换鍡涘焵椤掆偓閸樻牕菐椤曗偓濮婄粯鎷呴懞銉b偓鍐煟閹虹偟鐣垫鐐村灴瀹曞爼顢楅埀顒勫几娓氣偓閺岀喖宕滆鐢盯鏌¢崨顔藉€愰柡灞诲姂閹倝宕掑☉姗嗕紦?(ms) #define DATA_UPLOAD_INTERVAL 10000 // 鏁版嵁涓婁紶鐨勯棿锟<E6A3BF>?(ms)
#define CONTROL_PRIORITY_DELAY 500 // 闂傚倸鍊搁崐鎼佸磹閻戣姤鍤勯柛顐f磸閳ь兛鐒︾换婵嬪炊閵娿儱澹掗梻浣规偠閸庢椽宕滃▎鎴犵焼闁告劦鍠楅悡蹇撯攽閻愭垵鍟弳娆戠磼閻樺啿鐏存慨濠傤煼瀹曟帒鈻庨幋顓熜滈梻浣侯攰椤曟粎妲愰弴鐘插灊婵炲棙鎸哥粻铏繆閵堝倸浜鹃梺鎼炲妼閸婂湱鎹㈠┑瀣棃婵炴垵宕崜鎵磽娴e搫顎岄柛锝忕秮瀵寮撮姀鐘诲敹濠电娀娼уù鍌毼涢悙鐢电=濞达絿枪椤f娊鏌涚€c劌鈧繂顕g拠娴嬫闁靛繒濮村畵鍡涙⒑闂堟胆褰掑磿鏉堚晝涓嶆繛宸簼閳锋垹绱掔€n亜鐨¢柛鏃傚枛閺屾稓鈧絻鍔岄埀顒佺箓椤曪絿鎷犲ù瀣潔濠殿喗顨呭Λ娆撳磽闂堟侗娓婚柕鍫濇缁楁帡鎮楀鍗炲幋闁糕斁鍋撳銈嗗笂缁垛€斥枔閺囩姷纾肩紓浣诡焽濞插鈧娲熸禍鍫曠嵁閸ヮ剦鏁嗛柛灞剧懅濡垰鈹戦悩鍨毄闁稿鍠栧畷銏n樄闁炽儻绠撻幃婊堟寠婢跺瞼鏆梻渚€娼х换鍫ュ磹閺囩姷鐭嗛柛顐g贩瑜版帗鏅查柛銉戝啫顬嗛梻浣告憸閸犳劕顭垮鈧崺鐐哄箣閿旇棄鈧攱绻涢崼鐔奉嚋妞ゃ儲鎹囧铏圭矙濞嗘儳鍓遍梺鍛婃⒐閻楃娀鐛崼銉ノ╅柕澹嫭鐤傞梻渚€鈧稓绁锋繛鍛礋閹ɑ绗熼埀顒€顫忛搹瑙勫厹闁告侗鍠栧☉褏绱撴担鍝勑i柛銊ョ秺閹噣骞嗚閸氬顭跨捄渚剳闁告ê宕—鍐Χ閸℃衼缂備焦褰冩晶鐣屽垝閸儱绀冩い鏃傛櫕閸欏棗鈹戦悙鏉戠伇婵炲懏娲滈埀顒佺啲閹凤拷(ms) #define CONTROL_PRIORITY_DELAY 500 // 鎺у埗鍛戒护澶勭悊鍚庡欢杩熶笂浼犵殑鏃堕棿(ms)
uint16_t data1[3]={0};
#define SECONDS_PER_MINUTE 60 // 60闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊瑜夐弸鏍煛閸ャ儱鐏╅梻鍌ゅ灦閺屻劑寮撮悙娴嬪亾閸濄儳涓嶆い鏍仦閻撱儵鏌弴鐐测偓鍦偓姘炬嫹? = 1闂傚倸鍊搁崐鎼佸磹妞嬪海鐭嗗〒姘亾妤犵偛顦甸弫宥夊礋椤掍焦顔囬梻浣告贡閸庛倝宕甸敃鈧埥澶娢熼柨瀣澑闂佽鍑界紞鍡樼閻愪警鏁婇柛銉墯閳锋垿鎮归幁鎺戝婵炲懏鍔欓弻鐔煎礄閵堝棗顏<E6A397>
static uint8_t second_count = 0; #define SECONDS_PER_MINUTE 60 // 60锟<30>? = 1鍒嗛挓
/* USER CODE END PV */ /* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
@ -80,11 +78,7 @@ void SystemClock_Config(void);
/* Private user code ---------------------------------------------------------*/ /* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */ /* USER CODE BEGIN 0 */
// void App_Init(void)
// {
// // 初始化I2C
// // Inf_AT24C02_Init();
// }
/* USER CODE END 0 */ /* USER CODE END 0 */
/** /**
@ -126,7 +120,6 @@ int main(void)
MX_UART4_Init(); MX_UART4_Init();
MX_I2C2_Init(); MX_I2C2_Init();
MX_TIM3_Init(); MX_TIM3_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
timer_1s_cnt = 0; timer_1s_cnt = 0;
@ -138,9 +131,7 @@ int main(void)
Apphl8032_Init(); Apphl8032_Init();
HAL_ADC_Start_DMA(&hadc3, (uint32_t*)data1, 3);
/* USER CODE END 2 */ /* USER CODE END 2 */
/* Infinite loop */ /* Infinite loop */
@ -153,11 +144,11 @@ int main(void)
Device_Init(); Device_Init();
// Clear_EEPROM_All();
Ozone_Init(); Ozone_Init();
printf("Initializing ozone control...\n"); printf("Initializing ozone control...\n");
Ozone_Init();
//Inf_AT24C02_Init(); //Inf_AT24C02_Init();
ozone_running = 0; ozone_running = 0;
ozone_timer = 0; ozone_timer = 0;
@ -170,23 +161,18 @@ int main(void)
HAL_TIM_Base_Start_IT(&htim7); HAL_TIM_Base_Start_IT(&htim7);
HAL_TIM_Base_Start_IT(&htim2); HAL_TIM_Base_Start_IT(&htim2);
HAL_TIM_Base_Start_IT(&htim3); HAL_TIM_Base_Start_IT(&htim3);
Load_Temp_Limits_From_EEPROM();
while (1) while (1)
{ {
// printf("ADC: %d, %d, %d\r\n", data1[0], data1[1], data1[2]);
// Control_Fan2(1);
// Print_Temperature(data1); // 闂備礁鎲¢崹鍏兼叏閵堝姹查柣鏃傚帶缁€鍐煕濞戞瑦缍戦柛鏂诲劚闇夐柛蹇氬亹閻擃垰鈹戦悙鍙夊枠闁诡喕绮欓崺鈥斥炕濠曟房data[1]
Inf_EC800_ReadData(); Inf_EC800_ReadData();
// Direct_Mode_Control();
Check_4G_Connection(); Check_4G_Connection();
if (need_upload)
{
Upload_Device_Data();
need_upload = 0; // 婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柟闂寸绾惧鏌i幇顒佹儓缂佺姳鍗抽弻鐔兼⒒鐎靛壊妲紓浣哄Х婵灚绌辨繝鍥舵晬婵犻潧瀚ч崑鎾诲焵椤掑嫭鐓涢悗锝庝簽鏁堝Δ鐘靛仦閻楁洝褰佸銈嗗坊閸嬫捇鏌h箛锝呮珝闁哄苯绉剁槐鎺懳熼懡銈呭汲闂備礁鐤囬~澶愬垂閸ф绠栭柍鍝勫€圭紞鍥ㄣ亜閹扳晛鐏╅悽顖e灦濮婄粯鎷呴搹鐟扮闂佸憡姊瑰ú鐔煎极閸愵噮鏁傞柛顐g箚閹芥洟姊洪悙钘夊姕闁告挻宀稿畷銉р偓锝庡枟閻撴洘绻涢幋婵嗚埞闁哄鍠栭弻鐔碱敊閻e本鍣紓浣介哺閹稿骞忛崨顕呮Ч閹煎瓨绻嗛々顐︽⒒娴g儤鍤€闁搞倖鐗犻獮蹇涙晸閿燂拷
}
switch(current_mode) { switch(current_mode) {
case MODE_DIRECT: case MODE_DIRECT:
Direct_Mode_Control(); Direct_Mode_Control();
@ -201,17 +187,22 @@ int main(void)
Special_Mode_Control(); Special_Mode_Control();
break; break;
default: default:
// // ???????????????
current_mode = MODE_DIRECT; current_mode = MODE_DIRECT;
break; break;
} }
// printf("ADC闂備胶枪楗敻骞忛敓锟<E69593>: %d, %d, %d\r\n", data[0], data[1], data[2]);
if (need_upload)
if(UART4_RX_STA & 0x8000)
{ {
Data_Processing(); Upload_Device_Data();
} need_upload = 0; // 娓呴櫎涓婁紶鏍囧織
}
// if(UART4_RX_STA & 0x8000)
// {
// Data_Processing();
// }
@ -285,61 +276,65 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
static uint16_t upload_counter = 0; static uint16_t upload_counter = 0;
upload_counter++; upload_counter++;
if (upload_counter >= 5000) // 5缂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕闁芥ɑ绻堥弻鐔封枔閸喗鐏嶉梺鍝勬缁捇寮婚悢鍏煎€绘慨妤€妫欓悾鍫曟⒑閸濆嫬顏ラ柛搴㈠▕閸┾偓妞ゆ巻鍋撻柛妯荤矒瀹曟垿骞樼紒妯煎幈闂佸搫娲㈤崝灞炬櫠椤栨稓绠鹃柛娑卞亜閻忓弶鎱ㄦ繝鍛仩闁圭懓瀚版俊鎼佸Ψ閿旀儳缍掗梻鍌欒兌閹虫捇宕甸弽顓炵闁跨噦鎷<EFBFBD>?(1ms * 2000 = 2s) if (upload_counter >= 5000) // 5绉掑埌锟<EFBFBD>?(1ms * 2000 = 2s)
{ {
upload_counter = 0; // 婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柟闂寸绾惧鏌i幇顒佹儓缂佺姳鍗抽弻鐔兼⒒鐎靛壊妲紓浣哄Х婵灚绌辨繝鍥舵晬婵ǜ鍎辨禒娲偡濠婂懎顣奸悽顖涘笧婢规洟宕楅懖鈺冪槇婵犵數濮撮崐鎼侇敂閳哄倶浜滈幖娣灮濞插瓨鎱ㄦ繝鍐┿仢鐎殿噮鍓熸俊鐑芥晜閻e苯绲介梻鍌欑閹芥粓宕抽妷鈺佸瀭濞村吋娼欓悡婵嬫煙閹规劦鍤欓梺鍗炴喘閺岋繝宕堕埡浣圭亖闂佸憡鐟ュΛ婵嗩潖閾忓湱纾兼俊顖濆吹椤︺儵姊虹粙鍖″伐婵犫偓闁秴鐒垫い鎺嶈兌閸熸煡鏌熼崙銈嗗? upload_counter = 0; // 娓呴浂璁℃暟锟<EFBFBD>?
need_upload = 1; // 闂傚倸鍊搁崐宄懊归崶褏鏆﹂柛顭戝亝閸欏繒鈧娲栧ú銊╂儗閸℃褰掓晲閸偅缍堝┑鐐叉噽婵挳婀侀梺缁樏Ο濠囧磿閹扮増鐓曢悗锝呭悁闁垶鏌$仦鍓ф创闁糕晛瀚板畷姗€宕滆婵椽姊绘担鍝ワ紞缂侇噮鍨跺濠氬Ω閳轰胶鍘撮梺纭呮彧闂勫嫰宕戦幇鏉跨骇闁割偒鍋勬禍婊堟煕濮楀牏绡€婵﹨娅g槐鎺懳熼崫鍕垫綋闂備焦瀵уú锔界椤忓嫷鍤曞┑鐘宠壘閻忔娊鏌熸0浣侯槮闁诡喗鍨垮娲川婵犱胶绻侀梺鍝ュУ椤ㄥ﹪鐛崘銊㈡瀻闁瑰濮烽敍婵囩箾鏉堝墽绉い銉︽尰缁嬪寮婚妷锔惧幍闂佸憡鍨崐鏍偓姘炬嫹 need_upload = 1; // 璁剧疆涓婁紶鏍囧織
} }
// Check_Flow(); // Check_Flow();
} }
else if (htim->Instance == TIM2) else if (htim->Instance == TIM2)
{ {
pump_timer++;
fan_timer++;
if (current_mode == MODE_SPECIAL)
{
special_phase_timer++;
special_cycle_timer++;
} // pump_timer++;
// ??????? // fan_timer++;
//static uint32_t interrupt_count = 0;
// if (current_mode == MODE_SPECIAL)
//?????????????????
// if(time_just_modified)
// { // {
// interrupt_count++;
// if(interrupt_count >= 60) { // ???????? // special_phase_timer++;
// pump_timer = 0; // special_cycle_timer++;
// time_just_modified = 0;
// interrupt_count = 0;
// // printf("??????????????\n");
// }
// return; // ????????????
// } // }
// ???????
static uint32_t interrupt_count = 0;
// ?????????????????
if(time_just_modified)
{
interrupt_count++;
if(interrupt_count >= 60) { // ????????
pump_timer = 0;
time_just_modified = 0;
interrupt_count = 0;
printf("??????????????\n");
}
return; // ????????????
}
// ????????? // ?????????
// if(!timer_pause) if(!timer_pause)
// { // ?????????? { // ??????????
// pump_timer++; pump_timer++;
// fan_timer++; fan_timer++;
// if (current_mode == MODE_SPECIAL) if (current_mode == MODE_SPECIAL)
// { {
// special_phase_timer++; special_phase_timer++;
// special_cycle_timer++; special_cycle_timer++;
// } }
// } }
Ozone_Control_Update();
} }
else if (htim->Instance == TIM7) else if (htim->Instance == TIM7)
{ {
// 闂傚倸鍊搁崐鎼佸磹閻戣姤鍊块柨鏇楀亾妞ゎ亜鍟村畷绋课旈埀顒勬儗濡ゅ懎绠规繛锝庡墮婵″ジ鏌涚仦璇插闁哄矉绠戣灒濞撴凹鍨卞瓭闂備礁鎼鍡椢涢崘顔藉亗妞ゆ劧绠戦悙濠囨煏婵犲繘妾柛搴¢叄濮婃椽骞栭悙娴嬪亾閺囥垺鍋嬮柟鎹愵嚙閽冪喖鏌曢崼婵囧窛闁活厽鐟╅幃褰掑箒閹烘垵顬嗙紓渚囧櫍濞佳団€旈崘顔嘉︽い鏍ㄧ懅椤︼箓鏌熼搹顐㈠閾荤偞銇勯弽銊р棨濞存粍绮撻弻鐔兼倷椤掑鐣堕梺鍝ュ櫏閸ㄥ爼骞冨鈧畷鍗炩枎閹寸媴绱冲┑鐐舵彧缂嶁偓婵炲拑绲块弫顔尖槈閵忥紕鍘鹃悷婊呭鐢偤鎮鹃崫鍕ㄦ斀闁斥晛鍟亸锔筋殽閻愭潙绗掗摶鏍煃瑜滈崜鐔煎箖閳ユ枼妲堟俊顖氱箰缂嶅﹪寮幇鏉垮窛妞ゆ挆鍕垫闂傚倷绀侀幗婊堝磻閻愬樊娓婚柦妯侯樈濞兼牗绻涘顔荤盎濞磋偐濞€閺屾盯寮撮妸銉ヮ潽闂佽鍠楅悷鈺侇潖閾忓厜鍋撻惂鎼佹婵犮垺蓱閹便劑宕掑┃鎯т壕婵炲牆鐏濋弸銈囩磼椤曞懎鐏i柟骞垮灩閳规垹鈧綆浜為ˇ浼存⒑闂堟胆褰掑磿閻楀牏鐝堕柡鍥ュ灪閳锋垿鏌ゆ慨鎰偓鏇㈠几閺傛鐔嗙憸搴ㄣ€冮崨瀛樻櫇闁靛繆鈧剚鍤ら柣搴㈢⊕椤洭宕㈤崡鐑嗘富闁靛牆楠搁獮妤呮偨椤栨侗娈橀柍褜鍓氶悢顒勫箯閿燂拷 // 鐭殏寤舵椂纭繚娓╁害鏇存柊瀹屾垚
// Inf_EC800_PublishDeviceStatus(); // 闂傚倸鍊搁崐鎼佸磹妞嬪海鐭嗗〒姘e亾妤犵偛顦甸弫鎾绘偐閼碱剦妲烽梻浣告惈濞层劍鎱ㄩ悜鑺ュ剹闁规儳澧庡Λ顖炴煙椤栧棗鑻崜顓熺箾鐎涙鐭婄紓宥咃躬瀵鈽夊Ο鍏兼畷闂侀€炲苯澧寸€规洘鍨块幃娆撴倻濡 鍋撻崸妤佸仯闁搞儺浜跺璺ㄦ喐閻楀牆绗氶柡鍛叀閺屾稑鈽夐崡鐐寸亶闂佺ǹ瀛╅幐鍓ф閹烘嚦鏃€鎷呴崫銉ょ礉婵犳鍠栭敃銊モ枍閿濆绠查柛鏇ㄥ灠鎯熼梺闈涱檧婵″洩銇愬鑸碘拻濞达絿鍎ら崵鈧梺鎼炲€栭悧鐘荤嵁韫囨稒鏅搁柨鐕傛嫹? // Inf_EC800_PublishDeviceStatus(); // 鍐嶅彂閫佺姸锟<EFBFBD>?
if (++timer_1s_cnt >= 60) if (++timer_1s_cnt >= 60)
{ {
timer_1s_cnt = 0; timer_1s_cnt = 0;
@ -347,26 +342,13 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{ {
timer_1min_cnt = 0; timer_1min_cnt = 0;
timer_1hour_cnt++; timer_1hour_cnt++;
} }
Dredge_Control(); Dredge_Control();
} }
} }
else if (htim->Instance == TIM3) else if (htim->Instance == TIM3)
{ {
second_count++;
if(second_count >= 60) // 缂備線纭搁崹鐢割敇閹间礁绀嗛柨鐕傛嫹60缂備礁顧€閹凤拷
{
// 闁哄鏅滈悷鈺呭闯閻戣棄缁╅柟顖嗗啯鏋鹃梺鍝勵槶閸庢煡鎯侀敍鍕煋闁圭儤鎸搁埛鏃堟偠濞戞鐏辨繛鍫熷灦缁傛帡鏁愰崶鈺佺仯
// ... 闂佸憡顭囬崰鎰耿娴e湱顩烽柨婵嗘川閸拷 ...
Ozone_Control_Update();
phosphorus_timer++; // 闂勩倗锛楃拋鈩冩閸劌濮<E58A8C>1
Phosphorus_Control_Update(); // 閺囧瓨鏌婇梽銈囷紬閹貉冨煑閻樿埖鈧拷
// 闂備焦褰冪粔鍫曟偪閸℃瑦濯奸柍鈺佸暞濞堝爼鏌涢敐蹇斿
second_count = 0;
}
} }
} }

View File

@ -129,25 +129,17 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
__HAL_RCC_UART4_CLK_ENABLE(); __HAL_RCC_UART4_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
/**UART4 GPIO Configuration /**UART4 GPIO Configuration
PA0-WKUP ------> UART4_TX
PA1 ------> UART4_RX PA1 ------> UART4_RX
PC10 ------> UART4_TX
*/ */
GPIO_InitStruct.Pin = GPIO_PIN_1; GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF8_UART4; GPIO_InitStruct.Alternate = GPIO_AF8_UART4;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF8_UART4;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/* UART4 DMA Init */ /* UART4 DMA Init */
/* UART4_RX Init */ /* UART4_RX Init */
hdma_uart4_rx.Instance = DMA1_Stream2; hdma_uart4_rx.Instance = DMA1_Stream2;
@ -239,12 +231,10 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
__HAL_RCC_UART4_CLK_DISABLE(); __HAL_RCC_UART4_CLK_DISABLE();
/**UART4 GPIO Configuration /**UART4 GPIO Configuration
PA0-WKUP ------> UART4_TX
PA1 ------> UART4_RX PA1 ------> UART4_RX
PC10 ------> UART4_TX
*/ */
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_1);
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10);
/* UART4 DMA DeInit */ /* UART4 DMA DeInit */
HAL_DMA_DeInit(uartHandle->hdmarx); HAL_DMA_DeInit(uartHandle->hdmarx);

View File

@ -1,5 +1,5 @@
#include "Driver.h" #include "Driver.h"
uint8_t device_status[13] = {0}; // 初始化所有状态为0 uint8_t device_status[13] = {0}; // 初始化所有状态为0
static uint8_t led1_status = 0; // LED1 状态标志位0 表示灭1 表示亮 static uint8_t led1_status = 0; // LED1 状态标志位0 表示灭1 表示亮
uint8_t biaozhi=0; uint8_t biaozhi=0;
@ -10,7 +10,7 @@ uint8_t pump_running = 0; // ˮ
uint32_t last_upload_time = 0; // 上次上传时间 uint32_t last_upload_time = 0; // 上次上传时间
uint32_t flow_to_upload = 0; // 需要上传的流量值 uint32_t flow_to_upload = 0; // 需要上传的流量值
uint8_t flow_need_upload = 0; // 新增:流量上传标志位 uint8_t flow_need_upload = 0; // 新增:流量上传标志位
uint8_t biaozhi111 =0;
//状态上传 //状态上传
Device_Fault_t device_fault = {0}; // 初始化故障状态 Device_Fault_t device_fault = {0}; // 初始化故障状态
void LED1_Control(uint8_t state) void LED1_Control(uint8_t state)
@ -116,39 +116,19 @@ void Control_Phosphorus(uint8_t state)
{ {
if(state) if(state)
{ {
// 只开启一个极板 // 同时开启两个极板
if(polarity_state) Control_Plate1(1);
{ Control_Plate2(1);
Control_Plate1(1); // 极板1通电
Control_Plate2(0); // 极板2断电
}
else
{
Control_Plate1(0); // 极板1断电
Control_Plate2(1); // 极板2通电
}
} }
else else
{ {
// 关闭所有极板 // 同时关闭两个极板
Control_Plate1(0); Control_Plate1(0);
Control_Plate2(0); Control_Plate2(0);
} }
}
void Control_Dredge(uint8_t state)
{
if(state) // 排泥启动
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_4, GPIO_PIN_SET);
// printf("排泥启动 - GPIOG_PIN2设置为高电平\r\n");
}
else // 排泥停止
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_4, GPIO_PIN_RESET); // 关闭排泥
// printf("排泥停止 - GPIOG_PIN2设置为低电平\r\n");
}
} }
// 读取除磷状态任一极板运行即返回1 // 读取除磷状态任一极板运行即返回1
uint8_t Read_Phosphorus_Status(void) uint8_t Read_Phosphorus_Status(void)
@ -213,14 +193,13 @@ void Control_All_Devices(CmdState_t cmd)
// 清除强制关闭标志,允许设备运行 // 清除强制关闭标志,允许设备运行
force_pump_off = 0; force_pump_off = 0;
force_fan_off = 0; force_fan_off = 0;
biaozhi111=1;
// 不强制切换模式,保持当前模式 // 不强制切换模式,保持当前模式
// 如果需要切换模式,应该通过其他命令来实现 // 如果需要切换模式,应该通过其他命令来实现
} }
else if (cmd == CMD_OFF) // 关机 else if (cmd == CMD_OFF) // 关机
{ {
// 保存当前模式 // 保存当前模式
biaozhi111=0;
WorkMode current_mode_backup = current_mode; WorkMode current_mode_backup = current_mode;
// 关闭所有外设 // 关闭所有外设
@ -250,7 +229,7 @@ void Update_All_Status(void)
device_status[8] = Read_MainPower(); // 市电状态 device_status[8] = Read_MainPower(); // 市电状态
device_status[9] = Read_Phosphorus_Status(); //除磷状态 device_status[9] = Read_Phosphorus_Status(); //除磷状态
device_status[10] =Read_Dredge_Status(); //除磷状态 device_status[10] =Read_Dredge_Status(); //除磷状态
device_status[11] = biaozhi111; //上传状态 // device_status[11] = flow_to_upload;
} }
// 水泵故障检测函数 // 水泵故障检测函数
@ -332,5 +311,3 @@ void Check_Fan2_Fault(void)
} }

View File

@ -44,8 +44,6 @@ uint8_t Read_MainPower(void);
void Check_Fan1_Fault(void); void Check_Fan1_Fault(void);
void Check_Fan2_Fault(void); void Check_Fan2_Fault(void);
void Control_Dredge(uint8_t state);
void Control_All_Devices(uint8_t cmd); void Control_All_Devices(uint8_t cmd);
#endif #endif

View File

@ -14,23 +14,19 @@ typedef enum
uint8_t force_fan_off = 0; // 风机强制关闭标志 uint8_t force_fan_off = 0; // 风机强制关闭标志
AT_State_t at_state = AT_IDLE; AT_State_t at_state = AT_IDLE;
uint32_t at_start_time = 0; uint32_t at_start_time = 0;
char sim_iccid[ICCID_LENGTH] = {0}; // 初始化ICCID变量
// 缓冲区定义 // 缓冲区定义
uint8_t rxBuff[RX_BUFFER_SIZE]; /* 缓冲一次中断接收的数据 */ uint8_t rxBuff[RX_BUFFER_SIZE]; /* 缓冲一次中断接收的数据 */
uint16_t rxDataSize; /* 一次中断接收数据量 */ uint16_t rxDataSize; /* 一次中断接收数据量 */
uint8_t responseBuff[RESPONSE_BUFFER_SIZE]; /* 缓冲一次中断接收的数据 */ uint8_t responseBuff[RESPONSE_BUFFER_SIZE]; /* 缓冲一次中断接收的数据 */
uint16_t responseDataSize; /* 一次中断接收数据量 */ uint16_t responseDataSize; /* 一次中断接收数据量 */
void Publish_Power_Data(void); void Publish_Power_Data(void);
volatile uint8_t need_upload = 0; volatile uint8_t need_upload = 0;
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size) void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size)
{ {
if (huart->Instance == USART2) if (huart->Instance == USART2)
{ {
rxDataSize = size; rxDataSize = size;
HAL_UARTEx_ReceiveToIdle_IT(&huart2, rxBuff, 1024); HAL_UARTEx_ReceiveToIdle_IT(&huart2, rxBuff, 128);
} }
} }
@ -43,9 +39,6 @@ void Inf_4G_Init(void)
Inf_4G_SendAtCmd("AT+CFUN=1\r\n"); Inf_4G_SendAtCmd("AT+CFUN=1\r\n");
HAL_Delay(2000); HAL_Delay(2000);
Inf_4G_SendAtCmd("AT\r\n"); Inf_4G_SendAtCmd("AT\r\n");
// 获取ICCID
Get_ICCID();
// 获取初始信号强度 // 获取初始信号强度
Get_Signal_Strength(); Get_Signal_Strength();
} }
@ -161,11 +154,11 @@ void Inf_EC800_ReadData(void)
switch (current_mode) switch (current_mode)
{ {
case MODE_IRRIGATION: case MODE_IRRIGATION:
HIGH_LEVEL_PUMP_ON_TIME = (uint32_t)value; HIGH_LEVEL_PUMP_ON_TIME = value;
break; break;
case MODE_FLUSH: case MODE_FLUSH:
FLUSH_HIGH_PUMP_ON_TIME = (uint32_t)value; FLUSH_HIGH_PUMP_ON_TIME = value;
break; break;
case MODE_DIRECT: case MODE_DIRECT:
@ -182,7 +175,7 @@ void Inf_EC800_ReadData(void)
// 4. 完全重置所有计时变量 // 4. 完全重置所有计时变量
pump_timer = 0; pump_timer = 0;
fan_timer = 0; fan_timer = 0;
// timer_count = 0; // 如果有总的计时器计数也要清零 // timer_count = 0; // 如果有总的计时器计数也要清零
// 5. 清除定时器计数器值 // 5. 清除定时器计数器值
__HAL_TIM_SET_COUNTER(&htim2, 0); __HAL_TIM_SET_COUNTER(&htim2, 0);
@ -195,8 +188,6 @@ void Inf_EC800_ReadData(void)
// 修改水泵停止时间 // 修改水泵停止时间
else if (sscanf(jsonStr, "{\"X25\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X25\":%d}", &value) == 1)
{ {
// 1. 先停止定时器中断
HAL_TIM_Base_Stop_IT(&htim2); // 假设使用的是TIM2根据实际情况修改
switch (current_mode) switch (current_mode)
{ {
case MODE_IRRIGATION: case MODE_IRRIGATION:
@ -235,8 +226,6 @@ void Inf_EC800_ReadData(void)
} }
else if (sscanf(jsonStr, "{\"X54\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X54\":%d}", &value) == 1)
{ {
// 1. 先停止定时器中断
HAL_TIM_Base_Stop_IT(&htim2); // 假设使用的是TIM2根据实际情况修改
switch (current_mode) switch (current_mode)
{ {
case MODE_IRRIGATION: case MODE_IRRIGATION:
@ -295,7 +284,7 @@ void Inf_EC800_ReadData(void)
// 4. 完全重置所有计时变量 // 4. 完全重置所有计时变量
pump_timer = 0; pump_timer = 0;
fan_timer = 0; fan_timer = 0;
// timer_count = 0; // 如果有总的计时器计数也要清零 // timer_count = 0; // 如果有总的计时器计数也要清零
// 5. 清除定时器计数器值 // 5. 清除定时器计数器值
__HAL_TIM_SET_COUNTER(&htim2, 0); __HAL_TIM_SET_COUNTER(&htim2, 0);
@ -308,8 +297,6 @@ void Inf_EC800_ReadData(void)
// 修改低液位风机运行时间 // 修改低液位风机运行时间
else if (sscanf(jsonStr, "{\"X56\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X56\":%d}", &value) == 1)
{ {
// 1. 先停止定时器中断
HAL_TIM_Base_Stop_IT(&htim2); // 假设使用的是TIM2根据实际情况修改
switch (current_mode) switch (current_mode)
{ {
case MODE_IRRIGATION: case MODE_IRRIGATION:
@ -326,13 +313,13 @@ void Inf_EC800_ReadData(void)
} }
Time_Save(); // 保存修改后的时间 Time_Save(); // 保存修改后的时间
// 3. 关闭所有设备 // 3. 关闭所有设备
Control_WaterPump(0); Control_WaterPump(0);
Control_Fan1(0); Control_Fan1(0);
Control_Fan2(0); Control_Fan2(0);
// 4. 完全重置所有计时变量 // 4. 完全重置所有计时变量
pump_timer = 0; pump_timer = 0;
fan_timer = 0; fan_timer = 0;
// timer_count = 0; // 如果有总的计时器计数也要清零 // timer_count = 0; // 如果有总的计时器计数也要清零
// 5. 清除定时器计数器值 // 5. 清除定时器计数器值
@ -345,8 +332,6 @@ void Inf_EC800_ReadData(void)
// 修改低液位风机停止时间 // 修改低液位风机停止时间
else if (sscanf(jsonStr, "{\"X57\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X57\":%d}", &value) == 1)
{ {
// 1. 先停止定时器中断
HAL_TIM_Base_Stop_IT(&htim2); // 假设使用的是TIM2根据实际情况修改
switch (current_mode) switch (current_mode)
{ {
case MODE_IRRIGATION: case MODE_IRRIGATION:
@ -401,7 +386,6 @@ void Inf_EC800_ReadData(void)
{ {
OZONE_ON_TIME = value; OZONE_ON_TIME = value;
ozone_timer = 0; // 重置计时器 ozone_timer = 0; // 重置计时器
Save_Ozone_Time_To_EEPROM(OZONE_ON_TIME, OZONE_OFF_TIME);
// printf("设置臭氧开启时间: %d分钟\n", value); // printf("设置臭氧开启时间: %d分钟\n", value);
} }
// 臭氧关闭时间设置 // 臭氧关闭时间设置
@ -409,7 +393,6 @@ void Inf_EC800_ReadData(void)
{ {
OZONE_OFF_TIME = value; OZONE_OFF_TIME = value;
ozone_timer = 0; // 重置计时器 ozone_timer = 0; // 重置计时器
Save_Ozone_Time_To_EEPROM(OZONE_ON_TIME, OZONE_OFF_TIME); // 保存到EEPROM
// printf("设置臭氧关闭时间: %d分钟\n", value); // printf("设置臭氧关闭时间: %d分钟\n", value);
} }
@ -506,42 +489,29 @@ void Inf_EC800_ReadData(void)
if (value == 1) if (value == 1)
{ {
// 启动除磷 // 启动除磷
phosphorus_running = 1;
phosphorus_timer = 0; phosphorus_timer = 0;
polarity_state = !polarity_state; polarity_state = !polarity_state;
Control_Phosphorus_Polarity(); // 设置初始极性 electrode_Init(value); // 调用函数启用除磷
Phosphorus_Control_Update();
} }
else else
{ {
Control_Phosphorus(0); // 关闭除磷 // 停止除磷
electrode_Init(value); // 调用函数禁用除磷
phosphorus_running = 0;
} }
} }
else if (sscanf(jsonStr, "{\"X51\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X51\":%d}", &value) == 1)
{ {
PHOSPHORUS_RUN_TIME=value; Set_Phosphorus_Runtime(value); // 设置运行时间
// printf("设置除磷运行时间为:%d分钟\n", value); // printf("设置除磷运行时间为:%d分钟\n", value);
} }
// 设置除磷停止时间X34 // 设置除磷停止时间X34
else if (sscanf(jsonStr, "{\"X52\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X52\":%d}", &value) == 1)
{ {
PHOSPHORUS_STOP_TIME=value; Set_Phosphorus_StopTime(value); // 设置停止时间
// printf("设置除磷停止时间为:%d分钟\n", value); // printf("设置除磷停止时间为:%d分钟\n", value);
} }
// 添加排泥远程控制处理
if (sscanf(jsonStr, "{\"X53\":%d}", &value) == 1)
{
if (value == 1) // 开启排泥
{
Control_Dredge(1);
}
else if (value == 0) // 关闭排泥
{
Control_Dredge(0);
}
}
// 添加培菌模式专用控制按钮 // 添加培菌模式专用控制按钮
else if (sscanf(jsonStr, "{\"X58\":%d}", &value) == 1) else if (sscanf(jsonStr, "{\"X58\":%d}", &value) == 1)
{ {
@ -637,8 +607,7 @@ void Upload_Device_Data(void)
Update_All_Status(); // 更新状态并打印 Update_All_Status(); // 更新状态并打印
Check_Power_Source(); Check_Power_Source();
uint8_t power_type = Get_Power_Type(); Print_Temperature();
Print_Temperature(data1);
Get_Signal_Strength(); Get_Signal_Strength();
// 处理电量数据 // 处理电量数据
@ -760,9 +729,8 @@ void Upload_Device_Data(void)
"\"X56\":%d," // 低液位风机开启时间 "\"X56\":%d," // 低液位风机开启时间
"\"X57\":%d," // 低液位风机关闭时间 "\"X57\":%d," // 低液位风机关闭时间
"\"X58\":%d," // 低液位风机关闭时间 "\"X58\":%d," // 低液位风机关闭时间
"\"X59\":%d," // 系统状态 // "\"X59\":%d," // 系统状态
"\"X300\":%.6f," // 添加电量字段 X300 "\"X300\":%.6f" // 添加电量字段 X300
"\"X001\":\"%s\"" // 添加ICCID字段
"}", "}",
// device_status[11], // 水量 X1 // device_status[11], // 水量 X1
gsm_signal_strength, // 信号强度 X4 gsm_signal_strength, // 信号强度 X4
@ -784,7 +752,7 @@ void Upload_Device_Data(void)
device_fault.fan2_fault, //风机2的故障 X38 device_fault.fan2_fault, //风机2的故障 X38
device_status[5], // 低液位水泵状态 X44 device_status[5], // 低液位水泵状态 X44
device_status[8], // 市电检测 X46 device_status[8], // 市电检测 X46
power_type, // 光伏市电检测状态 X47 bizohi, // 光伏市电检测状态 X47
Dephosphorization_state, // 除磷控制状态 X49 Dephosphorization_state, // 除磷控制状态 X49
device_status[9], // 除磷状态 X50 device_status[9], // 除磷状态 X50
PHOSPHORUS_RUN_TIME, // 当前设置的运行时间 PHOSPHORUS_RUN_TIME, // 当前设置的运行时间
@ -795,9 +763,8 @@ void Upload_Device_Data(void)
current_low_fan_on, // X56 current_low_fan_on, // X56
current_low_fan_off, // X57 current_low_fan_off, // X57
(current_mode == MODE_SPECIAL) ? 1 : 0, // 培菌模式阶段(新增) x58 (current_mode == MODE_SPECIAL) ? 1 : 0, // 培菌模式阶段(新增) x58
device_status[11], // 系统状态 X59 // Get_System_State(), // 排泥状态 X59
base_energy, // 将电量值添加到JSON中 X300 base_energy // 将电量值添加到JSON中 X300
sim_iccid // ICCID值
); );
// 发送数据 // 发送数据
@ -889,27 +856,3 @@ void Check_4G_Connection(void)
} }
} }
// 添加获取ICCID的函数
void Get_ICCID(void)
{
memset(rxBuff, 0, sizeof(rxBuff));
rxDataSize = 0;
Inf_4G_SendAtCmd("AT+QCCID\r\n");
HAL_Delay(100);
// 解析ICCID
char *ptr = strstr((char *)rxBuff, "+QCCID:");
if (ptr)
{
// 跳过"+QCCID: "直接获取ICCID
ptr += 8; // 跳过"+QCCID: "
// 去除可能的空格和换行符
while (*ptr == ' ') ptr++;
// 复制ICCID到sim_iccid变量
strncpy(sim_iccid, ptr, ICCID_LENGTH - 1);
sim_iccid[ICCID_LENGTH - 1] = '\0'; // 确保字符串结束
}
}

View File

@ -19,7 +19,7 @@
#define STATUS_REPORT_INTERVAL 1000 // 状态上报间隔(ms) #define STATUS_REPORT_INTERVAL 1000 // 状态上报间隔(ms)
#define MQTT_SERVER_IP "101.46.52.67" // 替换为你的MQTT服务器IP地址 #define MQTT_SERVER_IP "101.133.141.167" // 替换为你的MQTT服务器IP地址
#define MQTT_SERVER_PORT "1883" // 替换为你的MQTT服务器端口 #define MQTT_SERVER_PORT "1883" // 替换为你的MQTT服务器端口
#define MQTT_CLIENT_ID "LDMCU20250120A0001" // 替换为你的MQTT客户端ID #define MQTT_CLIENT_ID "LDMCU20250120A0001" // 替换为你的MQTT客户端ID
#define MQTT_USERNAME "ldhb" // 替换为你的MQTT用户名 #define MQTT_USERNAME "ldhb" // 替换为你的MQTT用户名
@ -27,8 +27,6 @@
#define MQTT_TOPIC "/server/coo/LDMCU20250120A0001" // 替换为你的MQTT订阅主题 #define MQTT_TOPIC "/server/coo/LDMCU20250120A0001" // 替换为你的MQTT订阅主题
#define MQTT_PUB_TOPIC "/dev/coo/LDMCU20250120A0001" // 替换为你的MQTT订阅主题 #define MQTT_PUB_TOPIC "/dev/coo/LDMCU20250120A0001" // 替换为你的MQTT订阅主题
#define ICCID_LENGTH 20
extern uint16_t rxDataSize; extern uint16_t rxDataSize;
extern volatile uint8_t need_upload ; extern volatile uint8_t need_upload ;
@ -39,7 +37,6 @@ extern volatile uint8_t new_mode; // 新模式值
extern uint8_t force_pump_off; // 水泵强制关闭标志 extern uint8_t force_pump_off; // 水泵强制关闭标志
extern uint8_t force_fan_off; // 风机强制关闭标志 extern uint8_t force_fan_off; // 风机强制关闭标志
extern char sim_iccid[ICCID_LENGTH]; // 存储ICCID的变量
typedef enum { typedef enum {
CMD_OFF = 0, CMD_OFF = 0,
CMD_ON = 1 CMD_ON = 1
@ -64,6 +61,4 @@ void Upload_Device_Data(void);
extern int8_t gsm_signal_strength; // 信号强度变量 extern int8_t gsm_signal_strength; // 信号强度变量
void Get_Signal_Strength(void); // 获取信号强度函数 void Get_Signal_Strength(void); // 获取信号强度函数
void Check_4G_Connection(void); void Check_4G_Connection(void);
void Get_ICCID(void);
#endif #endif

View File

@ -21,7 +21,6 @@
"c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\paini", "c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\paini",
"c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\shuiliang", "c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\shuiliang",
"c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\SaveTime", "c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\SaveTime",
"c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\App\\solar_energy",
"E:\\MDK536\\ARM\\ARMCC\\include", "E:\\MDK536\\ARM\\ARMCC\\include",
"E:\\MDK536\\ARM\\ARMCC\\include\\rw", "E:\\MDK536\\ARM\\ARMCC\\include\\rw",
"c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\MDK-ARM", "c:\\Users\\kevin\\Desktop\\test\\HLW8032_test\\4G_test\\MDK-ARM",

View File

@ -228,63 +228,3 @@
[info] Log at : 2025/4/15|15:07:28|GMT+0800 [info] Log at : 2025/4/15|15:07:28|GMT+0800
[info] Log at : 2025/4/16|10:10:07|GMT+0800
[info] Log at : 2025/4/17|08:51:54|GMT+0800
[info] Log at : 2025/4/17|13:19:28|GMT+0800
[info] Log at : 2025/4/17|13:43:54|GMT+0800
[info] Log at : 2025/4/17|13:45:34|GMT+0800
[info] Log at : 2025/4/17|15:03:04|GMT+0800
[info] Log at : 2025/4/18|08:39:50|GMT+0800
[info] Log at : 2025/4/18|09:15:14|GMT+0800
[info] Log at : 2025/4/21|08:43:23|GMT+0800
[info] Log at : 2025/4/24|14:27:54|GMT+0800
[info] Log at : 2025/4/25|08:38:37|GMT+0800
[info] Log at : 2025/4/25|09:36:33|GMT+0800
[info] Log at : 2025/4/29|13:07:18|GMT+0800
[info] Log at : 2025/4/29|13:42:54|GMT+0800
[info] Log at : 2025/5/8|09:16:43|GMT+0800
[info] Log at : 2025/5/8|09:26:59|GMT+0800
[info] Log at : 2025/5/8|16:38:41|GMT+0800
[info] Log at : 2025/5/8|17:02:21|GMT+0800
[info] Log at : 2025/5/9|08:22:26|GMT+0800
[info] Log at : 2025/5/12|14:38:43|GMT+0800
[info] Log at : 2025/5/13|08:53:11|GMT+0800
[info] Log at : 2025/5/13|17:01:15|GMT+0800
[info] Log at : 2025/5/14|17:02:02|GMT+0800
[info] Log at : 2025/5/15|16:16:51|GMT+0800
[info] Log at : 2025/5/19|13:38:17|GMT+0800
[info] Log at : 2025/5/20|08:38:03|GMT+0800
[info] Log at : 2025/5/20|08:53:43|GMT+0800
[info] Log at : 2025/5/20|09:06:52|GMT+0800
[info] Log at : 2025/5/20|09:27:41|GMT+0800
[info] Log at : 2025/5/20|09:28:00|GMT+0800

View File

@ -25,7 +25,6 @@
"guangshi.h": "c", "guangshi.h": "c",
"paini.h": "c", "paini.h": "c",
"shuiliang.h": "c", "shuiliang.h": "c",
"save_time.h": "c", "save_time.h": "c"
"solar_energy.h": "c"
} }
} }

View File

@ -1,8 +1,3 @@
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'E:\MDK536\ARM\ARMCC\Bin' Load "4G_test\\4G_test.axf"
Build target '4G_test' Erase Done.Programming Done.Verify OK.Application running ...
compiling Inf_4G.c... Flash Load finished at 16:33:49
linking...
Program Size: Code=34956 RO-data=900 RW-data=572 ZI-data=4092
FromELF: creating hex file...
"4G_test\4G_test.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:00:05

View File

@ -1 +1 @@
2025/5/19 16:37:32 2025/4/15 16:33:50

File diff suppressed because one or more lines are too long

View File

@ -203,7 +203,7 @@
<Group> <Group>
<GroupName>Application/MDK-ARM</GroupName> <GroupName>Application/MDK-ARM</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
@ -223,7 +223,7 @@
<Group> <Group>
<GroupName>Application/User/Core</GroupName> <GroupName>Application/User/Core</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
@ -231,7 +231,7 @@
<GroupNumber>2</GroupNumber> <GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber> <FileNumber>2</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>../Core/Src/main.c</PathWithFileName> <PathWithFileName>../Core/Src/main.c</PathWithFileName>
@ -807,18 +807,6 @@
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>47</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\App\solar_energy\solar_energy.c</PathWithFileName>
<FilenameWithoutPath>solar_energy.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group> </Group>
<Group> <Group>

View File

@ -339,7 +339,7 @@
<MiscControls></MiscControls> <MiscControls></MiscControls>
<Define>USE_HAL_DRIVER,STM32F407xx</Define> <Define>USE_HAL_DRIVER,STM32F407xx</Define>
<Undefine></Undefine> <Undefine></Undefine>
<IncludePath>../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../Inf;../Driver;../App/Irrigation;../App/Ozone;../App/wendu;../App/HLW8032;../App/EEPROM;../App/energy_manager;../App/electrode;../App/gungshi;../App/paini;../App/shuiliang;../App/SaveTime;../App/solar_energy</IncludePath> <IncludePath>../Core/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Drivers/CMSIS/Include;../Inf;../Driver;../App/Irrigation;../App/Ozone;../App/wendu;../App/HLW8032;../App/EEPROM;../App/energy_manager;../App/electrode;../App/gungshi;../App/paini;../App/shuiliang;..\App\SaveTime</IncludePath>
</VariousControls> </VariousControls>
</Cads> </Cads>
<Aads> <Aads>
@ -1204,11 +1204,6 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\App\SaveTime\Save_Time.c</FilePath> <FilePath>..\App\SaveTime\Save_Time.c</FilePath>
</File> </File>
<File>
<FileName>solar_energy.c</FileName>
<FileType>1</FileType>
<FilePath>..\App\solar_energy\solar_energy.c</FilePath>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>

Binary file not shown.

View File

@ -22,14 +22,15 @@ Dialog DLL: TCM.DLL V1.53.0.0
<h2>Project:</h2> <h2>Project:</h2>
c:\Users\kevin\Desktop\test\HLW8032_test\4G_test\MDK-ARM\4G_test.uvprojx c:\Users\kevin\Desktop\test\HLW8032_test\4G_test\MDK-ARM\4G_test.uvprojx
Project File Date: 04/22/2025 Project File Date: 04/15/2025
<h2>Output:</h2> <h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'E:\MDK536\ARM\ARMCC\Bin' *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'E:\MDK536\ARM\ARMCC\Bin'
Build target '4G_test' Build target '4G_test'
compiling Save_Time.c...
compiling Inf_4G.c... compiling Inf_4G.c...
linking... linking...
Program Size: Code=34956 RO-data=900 RW-data=572 ZI-data=4092 Program Size: Code=32588 RO-data=876 RW-data=540 ZI-data=3908
FromELF: creating hex file... FromELF: creating hex file...
"4G_test\4G_test.axf" - 0 Error(s), 0 Warning(s). "4G_test\4G_test.axf" - 0 Error(s), 0 Warning(s).
@ -55,7 +56,7 @@ Package Vendor: Keil
* Component: ARM::CMSIS:CORE:5.5.0 * Component: ARM::CMSIS:CORE:5.5.0
Include file: CMSIS\Core\Include\tz_context.h Include file: CMSIS\Core\Include\tz_context.h
Build Time Elapsed: 00:00:05 Build Time Elapsed: 00:00:06
</pre> </pre>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,6 @@
"4g_test\paini.o" "4g_test\paini.o"
"4g_test\shuiliang.o" "4g_test\shuiliang.o"
"4g_test\save_time.o" "4g_test\save_time.o"
"4g_test\solar_energy.o"
--library_type=microlib --strict --scatter "4G_test\4G_test.sct" --library_type=microlib --strict --scatter "4G_test\4G_test.sct"
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers --info sizes --info totals --info unused --info veneers

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -45,14 +45,14 @@
4g_test\driver.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h 4g_test\driver.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\driver.o: ../Driver/Driver.h 4g_test\driver.o: ../Driver/Driver.h
4g_test\driver.o: ../App/Irrigation/Irrigation.h 4g_test\driver.o: ../App/Irrigation/Irrigation.h
4g_test\driver.o: ../App/SaveTime/Save_Time.h 4g_test\driver.o: ..\App\SaveTime\Save_Time.h
4g_test\driver.o: ../App/EEPROM/EEPROM.h 4g_test\driver.o: ../App/EEPROM/EEPROM.h
4g_test\driver.o: ../Core/Inc/i2c.h 4g_test\driver.o: ../Core/Inc/i2c.h
4g_test\driver.o: ../App/Irrigation/Irrigation.h 4g_test\driver.o: ../App/Irrigation/Irrigation.h
4g_test\driver.o: ../Inf/Inf_4G.h
4g_test\driver.o: ../App/wendu/wendu.h 4g_test\driver.o: ../App/wendu/wendu.h
4g_test\driver.o: ../Core/Inc/adc.h 4g_test\driver.o: ../Core/Inc/adc.h
4g_test\driver.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h 4g_test\driver.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\driver.o: ../Inf/Inf_4G.h
4g_test\driver.o: ../App/HLW8032/HLW8032.h 4g_test\driver.o: ../App/HLW8032/HLW8032.h
4g_test\driver.o: ../App/Ozone/Ozone.h 4g_test\driver.o: ../App/Ozone/Ozone.h
4g_test\driver.o: ../App/electrode/electrode.h 4g_test\driver.o: ../App/electrode/electrode.h

Binary file not shown.

Binary file not shown.

View File

@ -38,5 +38,4 @@
4g_test\eeprom.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h 4g_test\eeprom.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h
4g_test\eeprom.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h 4g_test\eeprom.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h
4g_test\eeprom.o: ../Core/Inc/i2c.h 4g_test\eeprom.o: ../Core/Inc/i2c.h
4g_test\eeprom.o: E:\MDK536\ARM\ARMCC\Bin\..\include\String.h
4g_test\eeprom.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h 4g_test\eeprom.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h

Binary file not shown.

Binary file not shown.

View File

@ -46,14 +46,14 @@
4g_test\electrode.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h 4g_test\electrode.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\electrode.o: ../Driver/Driver.h 4g_test\electrode.o: ../Driver/Driver.h
4g_test\electrode.o: ../App/Irrigation/Irrigation.h 4g_test\electrode.o: ../App/Irrigation/Irrigation.h
4g_test\electrode.o: ../App/SaveTime/Save_Time.h 4g_test\electrode.o: ..\App\SaveTime\Save_Time.h
4g_test\electrode.o: ../App/EEPROM/EEPROM.h 4g_test\electrode.o: ../App/EEPROM/EEPROM.h
4g_test\electrode.o: ../Core/Inc/i2c.h 4g_test\electrode.o: ../Core/Inc/i2c.h
4g_test\electrode.o: ../App/Irrigation/Irrigation.h 4g_test\electrode.o: ../App/Irrigation/Irrigation.h
4g_test\electrode.o: ../Inf/Inf_4G.h
4g_test\electrode.o: ../App/wendu/wendu.h 4g_test\electrode.o: ../App/wendu/wendu.h
4g_test\electrode.o: ../Core/Inc/adc.h 4g_test\electrode.o: ../Core/Inc/adc.h
4g_test\electrode.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h 4g_test\electrode.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\electrode.o: ../Inf/Inf_4G.h
4g_test\electrode.o: ../App/HLW8032/HLW8032.h 4g_test\electrode.o: ../App/HLW8032/HLW8032.h
4g_test\electrode.o: ../App/Ozone/Ozone.h 4g_test\electrode.o: ../App/Ozone/Ozone.h
4g_test\electrode.o: ../App/electrode/electrode.h 4g_test\electrode.o: ../App/electrode/electrode.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -46,14 +46,14 @@
4g_test\guangshi.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h 4g_test\guangshi.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\guangshi.o: ../Driver/Driver.h 4g_test\guangshi.o: ../Driver/Driver.h
4g_test\guangshi.o: ../App/Irrigation/Irrigation.h 4g_test\guangshi.o: ../App/Irrigation/Irrigation.h
4g_test\guangshi.o: ../App/SaveTime/Save_Time.h 4g_test\guangshi.o: ..\App\SaveTime\Save_Time.h
4g_test\guangshi.o: ../App/EEPROM/EEPROM.h 4g_test\guangshi.o: ../App/EEPROM/EEPROM.h
4g_test\guangshi.o: ../Core/Inc/i2c.h 4g_test\guangshi.o: ../Core/Inc/i2c.h
4g_test\guangshi.o: ../App/Irrigation/Irrigation.h 4g_test\guangshi.o: ../App/Irrigation/Irrigation.h
4g_test\guangshi.o: ../Inf/Inf_4G.h
4g_test\guangshi.o: ../App/wendu/wendu.h 4g_test\guangshi.o: ../App/wendu/wendu.h
4g_test\guangshi.o: ../Core/Inc/adc.h 4g_test\guangshi.o: ../Core/Inc/adc.h
4g_test\guangshi.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h 4g_test\guangshi.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\guangshi.o: ../Inf/Inf_4G.h
4g_test\guangshi.o: ../App/HLW8032/HLW8032.h 4g_test\guangshi.o: ../App/HLW8032/HLW8032.h
4g_test\guangshi.o: ../App/Ozone/Ozone.h 4g_test\guangshi.o: ../App/Ozone/Ozone.h
4g_test\guangshi.o: ../App/electrode/electrode.h 4g_test\guangshi.o: ../App/electrode/electrode.h

Binary file not shown.

Binary file not shown.

View File

@ -47,7 +47,7 @@
4g_test\hlw8032.o: ../Driver/Driver.h 4g_test\hlw8032.o: ../Driver/Driver.h
4g_test\hlw8032.o: ../Inf/Inf_4G.h 4g_test\hlw8032.o: ../Inf/Inf_4G.h
4g_test\hlw8032.o: ../App/Irrigation/Irrigation.h 4g_test\hlw8032.o: ../App/Irrigation/Irrigation.h
4g_test\hlw8032.o: ../App/SaveTime/Save_Time.h 4g_test\hlw8032.o: ..\App\SaveTime\Save_Time.h
4g_test\hlw8032.o: ../App/EEPROM/EEPROM.h 4g_test\hlw8032.o: ../App/EEPROM/EEPROM.h
4g_test\hlw8032.o: ../App/Irrigation/Irrigation.h 4g_test\hlw8032.o: ../App/Irrigation/Irrigation.h
4g_test\hlw8032.o: ../App/wendu/wendu.h 4g_test\hlw8032.o: ../App/wendu/wendu.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -45,7 +45,7 @@
4g_test\inf_4g.o: ../Driver/Driver.h 4g_test\inf_4g.o: ../Driver/Driver.h
4g_test\inf_4g.o: ../Inf/Inf_4G.h 4g_test\inf_4g.o: ../Inf/Inf_4G.h
4g_test\inf_4g.o: ../App/Irrigation/Irrigation.h 4g_test\inf_4g.o: ../App/Irrigation/Irrigation.h
4g_test\inf_4g.o: ../App/SaveTime/Save_Time.h 4g_test\inf_4g.o: ..\App\SaveTime\Save_Time.h
4g_test\inf_4g.o: ../App/EEPROM/EEPROM.h 4g_test\inf_4g.o: ../App/EEPROM/EEPROM.h
4g_test\inf_4g.o: ../Core/Inc/i2c.h 4g_test\inf_4g.o: ../Core/Inc/i2c.h
4g_test\inf_4g.o: ../App/Irrigation/Irrigation.h 4g_test\inf_4g.o: ../App/Irrigation/Irrigation.h

Binary file not shown.

Binary file not shown.

View File

@ -39,20 +39,7 @@
4g_test\irrigation.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h 4g_test\irrigation.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h
4g_test\irrigation.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h 4g_test\irrigation.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h
4g_test\irrigation.o: ../Core/Inc/tim.h 4g_test\irrigation.o: ../Core/Inc/tim.h
4g_test\irrigation.o: ../App/SaveTime/Save_Time.h 4g_test\irrigation.o: ..\App\SaveTime\Save_Time.h
4g_test\irrigation.o: ../App/EEPROM/EEPROM.h 4g_test\irrigation.o: ../App/EEPROM/EEPROM.h
4g_test\irrigation.o: ../Core/Inc/i2c.h 4g_test\irrigation.o: ../Core/Inc/i2c.h
4g_test\irrigation.o: E:\MDK536\ARM\ARMCC\Bin\..\include\String.h
4g_test\irrigation.o: ../App/Irrigation/Irrigation.h 4g_test\irrigation.o: ../App/Irrigation/Irrigation.h
4g_test\irrigation.o: ../Inf/Inf_4G.h
4g_test\irrigation.o: ../Core/Inc/usart.h
4g_test\irrigation.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\irrigation.o: ../Driver/Driver.h
4g_test\irrigation.o: ../Inf/Inf_4G.h
4g_test\irrigation.o: ../App/wendu/wendu.h
4g_test\irrigation.o: ../Core/Inc/adc.h
4g_test\irrigation.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\irrigation.o: ../App/HLW8032/HLW8032.h
4g_test\irrigation.o: ../App/Ozone/Ozone.h
4g_test\irrigation.o: ../App/electrode/electrode.h
4g_test\irrigation.o: ../App/gungshi/guangshi.h

Binary file not shown.

Binary file not shown.

View File

@ -49,7 +49,7 @@
4g_test\main.o: ../Driver/Driver.h 4g_test\main.o: ../Driver/Driver.h
4g_test\main.o: ../Inf/Inf_4G.h 4g_test\main.o: ../Inf/Inf_4G.h
4g_test\main.o: ../App/Irrigation/Irrigation.h 4g_test\main.o: ../App/Irrigation/Irrigation.h
4g_test\main.o: ../App/SaveTime/Save_Time.h 4g_test\main.o: ..\App\SaveTime\Save_Time.h
4g_test\main.o: ../App/EEPROM/EEPROM.h 4g_test\main.o: ../App/EEPROM/EEPROM.h
4g_test\main.o: ../App/Irrigation/Irrigation.h 4g_test\main.o: ../App/Irrigation/Irrigation.h
4g_test\main.o: ../App/wendu/wendu.h 4g_test\main.o: ../App/wendu/wendu.h

Binary file not shown.

Binary file not shown.

View File

@ -46,14 +46,14 @@
4g_test\ozone.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h 4g_test\ozone.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\ozone.o: ../Driver/Driver.h 4g_test\ozone.o: ../Driver/Driver.h
4g_test\ozone.o: ../App/Irrigation/Irrigation.h 4g_test\ozone.o: ../App/Irrigation/Irrigation.h
4g_test\ozone.o: ../App/SaveTime/Save_Time.h 4g_test\ozone.o: ..\App\SaveTime\Save_Time.h
4g_test\ozone.o: ../App/EEPROM/EEPROM.h 4g_test\ozone.o: ../App/EEPROM/EEPROM.h
4g_test\ozone.o: ../Core/Inc/i2c.h 4g_test\ozone.o: ../Core/Inc/i2c.h
4g_test\ozone.o: ../App/Irrigation/Irrigation.h 4g_test\ozone.o: ../App/Irrigation/Irrigation.h
4g_test\ozone.o: ../Inf/Inf_4G.h
4g_test\ozone.o: ../App/wendu/wendu.h 4g_test\ozone.o: ../App/wendu/wendu.h
4g_test\ozone.o: ../Core/Inc/adc.h 4g_test\ozone.o: ../Core/Inc/adc.h
4g_test\ozone.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h 4g_test\ozone.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\ozone.o: ../Inf/Inf_4G.h
4g_test\ozone.o: ../App/HLW8032/HLW8032.h 4g_test\ozone.o: ../App/HLW8032/HLW8032.h
4g_test\ozone.o: ../App/Ozone/Ozone.h 4g_test\ozone.o: ../App/Ozone/Ozone.h
4g_test\ozone.o: ../App/electrode/electrode.h 4g_test\ozone.o: ../App/electrode/electrode.h

Binary file not shown.

Binary file not shown.

View File

@ -37,24 +37,3 @@
4g_test\paini.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h 4g_test\paini.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h
4g_test\paini.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h 4g_test\paini.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h
4g_test\paini.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h 4g_test\paini.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h
4g_test\paini.o: ../Driver/Driver.h
4g_test\paini.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h
4g_test\paini.o: ../Inf/Inf_4G.h
4g_test\paini.o: ../Core/Inc/usart.h
4g_test\paini.o: E:\MDK536\ARM\ARMCC\Bin\..\include\string.h
4g_test\paini.o: ../Core/Inc/tim.h
4g_test\paini.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\paini.o: ../Driver/Driver.h
4g_test\paini.o: ../App/Irrigation/Irrigation.h
4g_test\paini.o: ../App/SaveTime/Save_Time.h
4g_test\paini.o: ../App/EEPROM/EEPROM.h
4g_test\paini.o: ../Core/Inc/i2c.h
4g_test\paini.o: ../App/Irrigation/Irrigation.h
4g_test\paini.o: ../Inf/Inf_4G.h
4g_test\paini.o: ../App/wendu/wendu.h
4g_test\paini.o: ../Core/Inc/adc.h
4g_test\paini.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\paini.o: ../App/HLW8032/HLW8032.h
4g_test\paini.o: ../App/Ozone/Ozone.h
4g_test\paini.o: ../App/electrode/electrode.h
4g_test\paini.o: ../App/gungshi/guangshi.h

Binary file not shown.

Binary file not shown.

View File

@ -39,21 +39,7 @@
4g_test\save_time.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h 4g_test\save_time.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h
4g_test\save_time.o: ../App/EEPROM/EEPROM.h 4g_test\save_time.o: ../App/EEPROM/EEPROM.h
4g_test\save_time.o: ../Core/Inc/i2c.h 4g_test\save_time.o: ../Core/Inc/i2c.h
4g_test\save_time.o: E:\MDK536\ARM\ARMCC\Bin\..\include\String.h
4g_test\save_time.o: ../App/Irrigation/Irrigation.h 4g_test\save_time.o: ../App/Irrigation/Irrigation.h
4g_test\save_time.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h 4g_test\save_time.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h
4g_test\save_time.o: ../Core/Inc/tim.h 4g_test\save_time.o: ../Core/Inc/tim.h
4g_test\save_time.o: ../App/SaveTime/Save_Time.h 4g_test\save_time.o: ..\App\SaveTime\Save_Time.h
4g_test\save_time.o: ../Inf/Inf_4G.h
4g_test\save_time.o: ../Core/Inc/usart.h
4g_test\save_time.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\save_time.o: ../Driver/Driver.h
4g_test\save_time.o: ../Inf/Inf_4G.h
4g_test\save_time.o: ../App/Irrigation/Irrigation.h
4g_test\save_time.o: ../App/wendu/wendu.h
4g_test\save_time.o: ../Core/Inc/adc.h
4g_test\save_time.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\save_time.o: ../App/HLW8032/HLW8032.h
4g_test\save_time.o: ../App/Ozone/Ozone.h
4g_test\save_time.o: ../App/electrode/electrode.h
4g_test\save_time.o: ../App/gungshi/guangshi.h

Binary file not shown.

Binary file not shown.

View File

@ -45,14 +45,14 @@
4g_test\shuiliang.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h 4g_test\shuiliang.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\shuiliang.o: ../Driver/Driver.h 4g_test\shuiliang.o: ../Driver/Driver.h
4g_test\shuiliang.o: ../App/Irrigation/Irrigation.h 4g_test\shuiliang.o: ../App/Irrigation/Irrigation.h
4g_test\shuiliang.o: ../App/SaveTime/Save_Time.h 4g_test\shuiliang.o: ..\App\SaveTime\Save_Time.h
4g_test\shuiliang.o: ../App/EEPROM/EEPROM.h 4g_test\shuiliang.o: ../App/EEPROM/EEPROM.h
4g_test\shuiliang.o: ../Core/Inc/i2c.h 4g_test\shuiliang.o: ../Core/Inc/i2c.h
4g_test\shuiliang.o: ../App/Irrigation/Irrigation.h 4g_test\shuiliang.o: ../App/Irrigation/Irrigation.h
4g_test\shuiliang.o: ../Inf/Inf_4G.h
4g_test\shuiliang.o: ../App/wendu/wendu.h 4g_test\shuiliang.o: ../App/wendu/wendu.h
4g_test\shuiliang.o: ../Core/Inc/adc.h 4g_test\shuiliang.o: ../Core/Inc/adc.h
4g_test\shuiliang.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h 4g_test\shuiliang.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\shuiliang.o: ../Inf/Inf_4G.h
4g_test\shuiliang.o: ../App/HLW8032/HLW8032.h 4g_test\shuiliang.o: ../App/HLW8032/HLW8032.h
4g_test\shuiliang.o: ../App/Ozone/Ozone.h 4g_test\shuiliang.o: ../App/Ozone/Ozone.h
4g_test\shuiliang.o: ../App/electrode/electrode.h 4g_test\shuiliang.o: ../App/electrode/electrode.h

Binary file not shown.

Binary file not shown.

View File

@ -1,59 +0,0 @@
4g_test\solar_energy.o: ..\App\solar_energy\solar_energy.c
4g_test\solar_energy.o: ..\App\solar_energy\solar_energy.h
4g_test\solar_energy.o: ../Core/Inc/adc.h
4g_test\solar_energy.o: ../Core/Inc/main.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h
4g_test\solar_energy.o: ../Core/Inc/stm32f4xx_hal_conf.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Include/core_cm4.h
4g_test\solar_energy.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdint.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Include/cmsis_version.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Include/cmsis_compiler.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Include/cmsis_armcc.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Include/mpu_armv7.h
4g_test\solar_energy.o: ../Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h
4g_test\solar_energy.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stddef.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_adc.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_adc_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h
4g_test\solar_energy.o: ../Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h
4g_test\solar_energy.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdio.h
4g_test\solar_energy.o: E:\MDK536\ARM\ARMCC\Bin\..\include\math.h
4g_test\solar_energy.o: ../Inf/Inf_4G.h
4g_test\solar_energy.o: ../Core/Inc/usart.h
4g_test\solar_energy.o: E:\MDK536\ARM\ARMCC\Bin\..\include\string.h
4g_test\solar_energy.o: ../Core/Inc/tim.h
4g_test\solar_energy.o: E:\MDK536\ARM\ARMCC\Bin\..\include\stdlib.h
4g_test\solar_energy.o: ../Driver/Driver.h
4g_test\solar_energy.o: ../Inf/Inf_4G.h
4g_test\solar_energy.o: ../App/Irrigation/Irrigation.h
4g_test\solar_energy.o: ../App/SaveTime/Save_Time.h
4g_test\solar_energy.o: ../App/EEPROM/EEPROM.h
4g_test\solar_energy.o: ../Core/Inc/i2c.h
4g_test\solar_energy.o: ../App/Irrigation/Irrigation.h
4g_test\solar_energy.o: ../App/wendu/wendu.h
4g_test\solar_energy.o: ../App/HLW8032/HLW8032.h
4g_test\solar_energy.o: ../App/Ozone/Ozone.h
4g_test\solar_energy.o: ../App/electrode/electrode.h
4g_test\solar_energy.o: ../App/gungshi/guangshi.h

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More