更新晶振

This commit is contained in:
许晟昊 2024-11-27 10:12:52 +08:00
parent 88e7c6ff77
commit 5a1078b82c
23 changed files with 633 additions and 465 deletions

View File

@ -9,7 +9,7 @@ CDefines=USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTU
[PreviousUsedKeilFiles]
SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\adc.c;..\Core\Src\dac.c;..\Core\Src\dma.c;..\Core\Src\spi.c;..\Core\Src\tim.c;..\Core\Src\usart.c;..\Core\Src\stm32l4xx_it.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_utils.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_exti.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_gpio.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_adc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_dma.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_dac.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_spi.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_pwr.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_tim.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_usart.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_rcc.c;..\Drivers\CMSIS\Device\ST\STM32L4xx\Source\Templates\system_stm32l4xx.c;..\Core\Src\system_stm32l4xx.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_utils.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_exti.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_gpio.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_adc.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_dma.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_dac.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_spi.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_pwr.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_tim.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_usart.c;..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_rcc.c;..\Drivers\CMSIS\Device\ST\STM32L4xx\Source\Templates\system_stm32l4xx.c;..\Core\Src\system_stm32l4xx.c;;;
HeaderPath=..\Drivers\STM32L4xx_HAL_Driver\Inc;..\Drivers\CMSIS\Device\ST\STM32L4xx\Include;..\Drivers\CMSIS\Include;..\Middlewares\ST\ARM\DSP\Inc;..\Core\Inc;
CDefines=USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;MSI_VALUE:16000000;EXTERNALSAI1_CLOCK_VALUE:2097000;EXTERNALSAI2_CLOCK_VALUE:2097000;HSI_VALUE:16000000;LSI_VALUE:32000;VDD_VALUE:3300;PREFETCH_ENABLE:0;INSTRUCTION_CACHE_ENABLE:1;DATA_CACHE_ENABLE:1;STM32L476xx;USE_FULL_LL_DRIVER;HSE_VALUE:8000000;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;MSI_VALUE:16000000;EXTERNALSAI1_CLOCK_VALUE:2097000;EXTERNALSAI2_CLOCK_VALUE:2097000;HSI_VALUE:16000000;LSI_VALUE:32000;VDD_VALUE:3300;PREFETCH_ENABLE:0;INSTRUCTION_CACHE_ENABLE:1;DATA_CACHE_ENABLE:1;
CDefines=USE_FULL_LL_DRIVER;HSE_VALUE:11059200;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;MSI_VALUE:16000000;EXTERNALSAI1_CLOCK_VALUE:2097000;EXTERNALSAI2_CLOCK_VALUE:2097000;HSI_VALUE:16000000;LSI_VALUE:32000;VDD_VALUE:3300;PREFETCH_ENABLE:0;INSTRUCTION_CACHE_ENABLE:1;DATA_CACHE_ENABLE:1;STM32L476xx;USE_FULL_LL_DRIVER;HSE_VALUE:11059200;HSE_STARTUP_TIMEOUT:100;LSE_STARTUP_TIMEOUT:5000;LSE_VALUE:32768;MSI_VALUE:16000000;EXTERNALSAI1_CLOCK_VALUE:2097000;EXTERNALSAI2_CLOCK_VALUE:2097000;HSI_VALUE:16000000;LSI_VALUE:32000;VDD_VALUE:3300;PREFETCH_ENABLE:0;INSTRUCTION_CACHE_ENABLE:1;DATA_CACHE_ENABLE:1;
[]
SourceFiles=;;

View File

@ -183,6 +183,7 @@ void SystemClock_Config(void)
/* Wait till HSE is ready */
while(LL_RCC_HSE_IsReady() != 1)
{
}
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 12, LL_RCC_PLLR_DIV_6);
LL_RCC_PLL_EnableDomain_SYS();
@ -191,12 +192,14 @@ void SystemClock_Config(void)
/* Wait till PLL is ready */
while(LL_RCC_PLL_IsReady() != 1)
{
}
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
/* Wait till System clock is ready */
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
{
}
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2);
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
@ -220,6 +223,7 @@ void PeriphCommonClock_Config(void)
/* Wait till PLLSAI1 is ready */
while(LL_RCC_PLLSAI1_IsReady() != 1)
{
}
}

View File

@ -44,7 +44,7 @@ void MX_TIM2_Init(void)
/* USER CODE END TIM2_Init 1 */
TIM_InitStruct.Prescaler = 0;
TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;
TIM_InitStruct.Autoreload = 3999;
TIM_InitStruct.Autoreload = 5529;
TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1;
LL_TIM_Init(TIM2, &TIM_InitStruct);
LL_TIM_EnableARRPreload(TIM2);
@ -98,7 +98,7 @@ void MX_TIM3_Init(void)
/* USER CODE END TIM3_Init 1 */
TIM_InitStruct.Prescaler = 0;
TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;
TIM_InitStruct.Autoreload = 3999;
TIM_InitStruct.Autoreload = 11;
TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1;
LL_TIM_Init(TIM3, &TIM_InitStruct);
LL_TIM_EnableARRPreload(TIM3);
@ -152,7 +152,7 @@ void MX_TIM6_Init(void)
/* USER CODE BEGIN TIM6_Init 1 */
/* USER CODE END TIM6_Init 1 */
TIM_InitStruct.Prescaler = 399;
TIM_InitStruct.Prescaler = 552;
TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;
TIM_InitStruct.Autoreload = 99;
LL_TIM_Init(TIM6, &TIM_InitStruct);
@ -184,7 +184,7 @@ void MX_TIM7_Init(void)
/* USER CODE BEGIN TIM7_Init 1 */
/* USER CODE END TIM7_Init 1 */
TIM_InitStruct.Prescaler = 399;
TIM_InitStruct.Prescaler = 552;
TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;
TIM_InitStruct.Autoreload = 249;
LL_TIM_Init(TIM7, &TIM_InitStruct);
@ -216,7 +216,7 @@ void MX_TIM16_Init(void)
/* USER CODE BEGIN TIM16_Init 1 */
/* USER CODE END TIM16_Init 1 */
TIM_InitStruct.Prescaler = 399;
TIM_InitStruct.Prescaler = 552;
TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;
TIM_InitStruct.Autoreload = 24;
TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1;
@ -248,7 +248,7 @@ void MX_TIM17_Init(void)
/* USER CODE BEGIN TIM17_Init 1 */
/* USER CODE END TIM17_Init 1 */
TIM_InitStruct.Prescaler = 399;
TIM_InitStruct.Prescaler = 552;
TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;
TIM_InitStruct.Autoreload = 999;
TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml version="1.0" encoding="UTF-8"?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
@ -26,7 +26,7 @@
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>8000000</CLKADS>
<CLKADS>11059000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath></ListingPath>
<ListingPath />
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@ -104,16 +104,16 @@
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>6</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<sDll />
<sDllPa />
<sDlgDll />
<sDlgPa />
<sIfile />
<tDll />
<tDllPa />
<tDlgDll />
<tDlgPa />
<tIfile />
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
@ -153,19 +153,19 @@
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<LintExecutable />
<LintConfigFile />
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<pMisraName />
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
@ -200,7 +200,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath></ListingPath>
<ListingPath />
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@ -259,16 +259,16 @@
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>4</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<sDll />
<sDllPa />
<sDlgDll />
<sDlgPa />
<sIfile />
<tDll />
<tDllPa />
<tDlgDll />
<tDlgPa />
<tIfile />
<pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
@ -308,19 +308,19 @@
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<LintExecutable />
<LintConfigFile />
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<pMisraName />
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
@ -355,7 +355,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath></ListingPath>
<ListingPath />
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@ -414,16 +414,16 @@
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>6</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<sDll />
<sDllPa />
<sDlgDll />
<sDlgPa />
<sIfile />
<tDll />
<tDllPa />
<tDlgDll />
<tDlgPa />
<tIfile />
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
@ -440,7 +440,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
<Name />
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -500,19 +500,19 @@
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<LintExecutable />
<LintConfigFile />
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<pMisraName />
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>

View File

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
<Target>
<TargetName>controller</TargetName>
@ -19,28 +16,28 @@
<PackID>Keil.STM32L4xx_DFP.2.6.2</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00018000) IRAM2(0x10000000,0x00008000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 DSP CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashUtilSpec />
<StartupFile />
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476RGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:STM32L476RGTx$Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l4xx.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<MemoryEnv />
<Cmp />
<Asm />
<Linker />
<OHString />
<InfinionOptionDll />
<SLE66CMisc />
<SLE66AMisc />
<SLE66LinkerMisc />
<SFDFile>$$Device:STM32L476RGTx$CMSIS\SVD\STM32L4x6.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<BinPath />
<IncludePath>../Core/Inc;../Drivers/STM32L0xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32L0xx/Include;../Drivers/CMSIS/Include;../User;../User/system/bsp;../User/board/inc;../User/lib/inc;../User/system/inc;../User/lib/font;../User/application/inc;../User/application/menus;../User/hart/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/control/custom;../User/lib/lcd;../User/lib/menu;../User/lib/unity;../Tests</IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<LibPath />
<RegisterFilePath />
<DBRegisterFilePath />
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
@ -55,15 +52,15 @@
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath></ListingPath>
<ListingPath />
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
@ -72,8 +69,8 @@
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
@ -90,7 +87,7 @@
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>1</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
<SVCSIdString />
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
@ -104,8 +101,8 @@
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>0</ComprImg>
</CommonProperty>
<DllOption>
@ -139,10 +136,10 @@
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<Flash4 />
<pFcarmOut />
<pFcarmGrp />
<pFcArmRoot />
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
@ -175,7 +172,7 @@
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M4"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<RvctDeviceName />
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
@ -309,7 +306,7 @@
<Size>0x8000</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
<RvctStartVector />
</ArmAdsMisc>
<Cads>
<interw>1</interw>
@ -337,8 +334,8 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls>--locale=english --diag_suppress=9</MiscControls>
<Define>STM32,SLAVE,USE_FULL_LL_DRIVER,STM32L476xx,__FPU_PRESENT=1U,__FPU_USED=0U,__CC_ARM,ARM_MATH_CM4,HSE_VALUE=8000000,HSE_STARTUP_TIMEOUT=100,LSE_STARTUP_TIMEOUT=5000,LSE_VALUE=32768,EXTERNALSAI1_CLOCK_VALUE=2097000,EXTERNALSAI2_CLOCK_VALUE=2097000,HSI_VALUE=16000000,LSI_VALUE=32000,VDD_VALUE=3300,PREFETCH_ENABLE=1,INSTRUCTION_CACHE_ENABLE=1,DATA_CACHE_ENABLE=1,MSI_VALUE=16000000,PREFETCH_ENABLE=0</Define>
<Undefine></Undefine>
<Define>STM32,SLAVE,USE_FULL_LL_DRIVER,STM32L476xx,__FPU_PRESENT=1U,__FPU_USED=0U,__CC_ARM,ARM_MATH_CM4,HSE_STARTUP_TIMEOUT=100,LSE_STARTUP_TIMEOUT=5000,LSE_VALUE=32768,EXTERNALSAI1_CLOCK_VALUE=2097000,EXTERNALSAI2_CLOCK_VALUE=2097000,HSI_VALUE=16000000,LSI_VALUE=32000,VDD_VALUE=3300,PREFETCH_ENABLE=1,INSTRUCTION_CACHE_ENABLE=1,DATA_CACHE_ENABLE=1,MSI_VALUE=16000000,PREFETCH_ENABLE=0,HSE_VALUE=11059200</Define>
<Undefine />
<IncludePath>../Core/Inc;../Drivers/STM32L4xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32L4xx/Include;../Drivers/CMSIS/Include;../User;../User/system/bsp;../User/board/inc;../User/lib/inc;../User/system/inc;../User/lib/font;../User/application/inc;../User/application/menus;../User/application/mode;../User/hart/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/control/custom;../User/lib/lcd;../User/lib/lcd/gui/Config;../User/lib/lcd/gui/Core;../User/lib/menu;../User/lib/unity;../User/lib/flashdb;../User/lib/flashdb/fal;../User/lib/bootload;../Tests;../Middlewares/ST/ARM/DSP/Inc</IncludePath>
</VariousControls>
</Cads>
@ -354,10 +351,10 @@
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Aads>
<LDads>
@ -367,15 +364,15 @@
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange></TextAddressRange>
<DataAddressRange></DataAddressRange>
<pXoBase></pXoBase>
<TextAddressRange />
<DataAddressRange />
<pXoBase />
<ScatterFile>.\stm32l476xx.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
<IncludeLibs />
<IncludeLibsPath />
<Misc />
<LinkerInputFile />
<DisabledWarnings />
</LDads>
</TargetArmAds>
</TargetOption>
@ -495,8 +492,6 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
@ -524,12 +519,6 @@
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
@ -816,6 +805,9 @@
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
<Group>
<GroupName>Middlewares/Library/DSP Library/DSP Library</GroupName>
<GroupOption>
@ -831,8 +823,6 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<GroupArmAds>
@ -860,12 +850,6 @@
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>2</interw>
@ -878,16 +862,67 @@
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<ClangAsOpt>1</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
</GroupArmAds>
</GroupOption>
<Files>
<File>
<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>
<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>
</Cads>
<Aads>
<interw>2</interw>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<thumb>2</thumb>
<SplitLS>2</SplitLS>
<SwStkChk>2</SwStkChk>
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<ClangAsOpt>1</ClangAsOpt>
</Aads>
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>arm_cortexM4l_math.lib</FileName>
<FileType>4</FileType>
@ -905,18 +940,51 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds/>
<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>
</Cads>
<Aads>
<interw>2</interw>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<thumb>2</thumb>
<SplitLS>2</SplitLS>
<SwStkChk>2</SwStkChk>
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<ClangAsOpt>1</ClangAsOpt>
</Aads>
</FileArmAds>
</FileOption>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
</Groups>
</Target>
<Target>
@ -932,28 +1000,28 @@
<PackID>Keil.STM32L4xx_DFP.2.6.2</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00018000) IRAM2(0x10000000,0x00008000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 DSP CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashUtilSpec />
<StartupFile />
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476RGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:STM32L476RGTx$Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l4xx.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<MemoryEnv />
<Cmp />
<Asm />
<Linker />
<OHString />
<InfinionOptionDll />
<SLE66CMisc />
<SLE66AMisc />
<SLE66LinkerMisc />
<SFDFile>$$Device:STM32L476RGTx$CMSIS\SVD\STM32L4x6.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<BinPath />
<IncludePath>../Core/Inc;../Drivers/STM32L0xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32L0xx/Include;../Drivers/CMSIS/Include;../User;../User/system/bsp;../User/board/inc;../User/lib/inc;../User/system/inc;../User/lib/font;../User/application/inc;../User/application/menus;../User/hart/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/control/custom;../User/lib/lcd;../User/lib/menu;../User/lib/unity;../Tests</IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<LibPath />
<RegisterFilePath />
<DBRegisterFilePath />
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
@ -968,15 +1036,15 @@
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>0</BrowseInformation>
<ListingPath></ListingPath>
<ListingPath />
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
@ -985,8 +1053,8 @@
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
@ -1003,7 +1071,7 @@
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>1</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
<SVCSIdString />
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
@ -1017,8 +1085,8 @@
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>0</ComprImg>
</CommonProperty>
<DllOption>
@ -1052,10 +1120,10 @@
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<Flash4 />
<pFcarmOut />
<pFcarmGrp />
<pFcArmRoot />
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
@ -1088,7 +1156,7 @@
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M4"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<RvctDeviceName />
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
@ -1222,7 +1290,7 @@
<Size>0x8000</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
<RvctStartVector />
</ArmAdsMisc>
<Cads>
<interw>1</interw>
@ -1251,7 +1319,7 @@
<VariousControls>
<MiscControls>--locale=english --diag_suppress=9</MiscControls>
<Define>STM32,SLAVE,USE_FULL_LL_DRIVER,STM32L476xx,__FPU_PRESENT=1U,__FPU_USED=0U,__CC_ARM,ARM_MATH_CM4,HSE_VALUE=8000000,HSE_STARTUP_TIMEOUT=100,LSE_STARTUP_TIMEOUT=5000,LSE_VALUE=32768,EXTERNALSAI1_CLOCK_VALUE=2097000,EXTERNALSAI2_CLOCK_VALUE=2097000,HSI_VALUE=16000000,LSI_VALUE=32000,VDD_VALUE=3300,PREFETCH_ENABLE=1,INSTRUCTION_CACHE_ENABLE=1,DATA_CACHE_ENABLE=1,MSI_VALUE=16000000</Define>
<Undefine></Undefine>
<Undefine />
<IncludePath>../Core/Inc;../Drivers/STM32L4xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32L4xx/Include;../Drivers/CMSIS/Include;../User;../User/system/bsp;../User/board/inc;../User/lib/inc;../User/system/inc;../User/lib/font;../User/application/inc;../User/application/menus;../User/application/mode;../User/hart/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/control/custom;../User/lib/lcd;../User/lib/lcd/gui/Config;../User/lib/lcd/gui/Core;../User/lib/menu;../User/lib/unity;../User/lib/flashdb;../User/lib/flashdb/fal;../User/lib/bootload;../Tests;../Middlewares/ST/ARM/DSP/Inc</IncludePath>
</VariousControls>
</Cads>
@ -1267,10 +1335,10 @@
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Aads>
<LDads>
@ -1280,15 +1348,15 @@
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange></TextAddressRange>
<DataAddressRange></DataAddressRange>
<pXoBase></pXoBase>
<TextAddressRange />
<DataAddressRange />
<pXoBase />
<ScatterFile>.\stm32l476xx.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
<IncludeLibs />
<IncludeLibsPath />
<Misc />
<LinkerInputFile />
<DisabledWarnings />
</LDads>
</TargetArmAds>
</TargetOption>
@ -1408,8 +1476,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
@ -1438,10 +1506,10 @@
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Cads>
</FileArmAds>
@ -1729,16 +1797,6 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Middlewares/Library/DSP Library/DSP Library</GroupName>
<Files>
<File>
<FileName>arm_cortexM4l_math.lib</FileName>
<FileType>4</FileType>
<FilePath>../Middlewares/ST/ARM/DSP/Lib/arm_cortexM4l_math.lib</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
<GroupOption>
@ -1754,8 +1812,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>1</ComprImg>
</CommonProperty>
<GroupArmAds>
@ -1784,10 +1842,10 @@
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Cads>
<Aads>
@ -1802,10 +1860,10 @@
<useXO>2</useXO>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Aads>
</GroupArmAds>
@ -1826,28 +1884,28 @@
<PackID>Keil.STM32L4xx_DFP.2.6.2</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00018000) IRAM2(0x10000000,0x00008000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 DSP CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashUtilSpec />
<StartupFile />
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476RGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:STM32L476RGTx$Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l4xx.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<MemoryEnv />
<Cmp />
<Asm />
<Linker />
<OHString />
<InfinionOptionDll />
<SLE66CMisc />
<SLE66AMisc />
<SLE66LinkerMisc />
<SFDFile>$$Device:STM32L476RGTx$CMSIS\SVD\STM32L4x6.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<BinPath />
<IncludePath>../Core/Inc;../Drivers/STM32L0xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32L0xx/Include;../Drivers/CMSIS/Include;../User;../User/system/bsp;../User/board/inc;../User/lib/inc;../User/system/inc;../User/lib/font;../User/application/inc;../User/application/menus;../User/hart/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/control/custom;../User/lib/lcd;../User/lib/menu;../User/lib/unity;../Tests</IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<LibPath />
<RegisterFilePath />
<DBRegisterFilePath />
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
@ -1862,15 +1920,15 @@
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath></ListingPath>
<ListingPath />
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
@ -1879,8 +1937,8 @@
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Name />
<UserProg2Name />
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
@ -1897,7 +1955,7 @@
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>1</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
<SVCSIdString />
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
@ -1911,8 +1969,8 @@
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>0</ComprImg>
</CommonProperty>
<DllOption>
@ -1946,10 +2004,10 @@
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<Flash4 />
<pFcarmOut />
<pFcarmGrp />
<pFcArmRoot />
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
@ -1982,7 +2040,7 @@
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M4"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<RvctDeviceName />
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
@ -2116,7 +2174,7 @@
<Size>0x8000</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
<RvctStartVector />
</ArmAdsMisc>
<Cads>
<interw>1</interw>
@ -2145,7 +2203,7 @@
<VariousControls>
<MiscControls>--locale=english --diag_suppress=9</MiscControls>
<Define>STM32,SLAVE,USE_FULL_LL_DRIVER,STM32L476xx,__FPU_PRESENT=1U,__FPU_USED=0U,__CC_ARM,ARM_MATH_CM4,HSE_VALUE=8000000,HSE_STARTUP_TIMEOUT=100,LSE_STARTUP_TIMEOUT=5000,LSE_VALUE=32768,EXTERNALSAI1_CLOCK_VALUE=2097000,EXTERNALSAI2_CLOCK_VALUE=2097000,HSI_VALUE=16000000,LSI_VALUE=32000,VDD_VALUE=3300,PREFETCH_ENABLE=1,INSTRUCTION_CACHE_ENABLE=1,DATA_CACHE_ENABLE=1,MSI_VALUE=16000000</Define>
<Undefine></Undefine>
<Undefine />
<IncludePath>../Core/Inc;../Drivers/STM32L4xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32L4xx/Include;../Drivers/CMSIS/Include;../User;../User/system/bsp;../User/board/inc;../User/lib/inc;../User/system/inc;../User/lib/font;../User/application/inc;../User/application/menus;../User/application/mode;../User/hart/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/control/custom;../User/lib/lcd;../User/lib/lcd/gui/Config;../User/lib/lcd/gui/Core;../User/lib/menu;../User/lib/unity;../User/lib/flashdb;../User/lib/flashdb/fal;../User/lib/bootload;../Tests;../Middlewares/ST/ARM/DSP/Inc</IncludePath>
</VariousControls>
</Cads>
@ -2161,10 +2219,10 @@
<useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Aads>
<LDads>
@ -2174,15 +2232,15 @@
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange></TextAddressRange>
<DataAddressRange></DataAddressRange>
<pXoBase></pXoBase>
<TextAddressRange />
<DataAddressRange />
<pXoBase />
<ScatterFile>.\stm32l476xx.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
<IncludeLibs />
<IncludeLibsPath />
<Misc />
<LinkerInputFile />
<DisabledWarnings />
</LDads>
</TargetArmAds>
</TargetOption>
@ -2302,8 +2360,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
@ -2332,10 +2390,10 @@
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Cads>
</FileArmAds>
@ -2623,16 +2681,6 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Middlewares/Library/DSP Library/DSP Library</GroupName>
<Files>
<File>
<FileName>arm_cortexM4l_math.lib</FileName>
<FileType>4</FileType>
<FilePath>../Middlewares/ST/ARM/DSP/Lib/arm_cortexM4l_math.lib</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
<GroupOption>
@ -2648,8 +2696,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<CustomArgument />
<IncludeLibraryModules />
<ComprImg>1</ComprImg>
</CommonProperty>
<GroupArmAds>
@ -2678,10 +2726,10 @@
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Cads>
<Aads>
@ -2696,10 +2744,10 @@
<useXO>2</useXO>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<MiscControls />
<Define />
<Undefine />
<IncludePath />
</VariousControls>
</Aads>
</GroupArmAds>
@ -2708,7 +2756,6 @@
</Groups>
</Target>
</Targets>
<RTE>
<apis />
<components>
@ -2722,7 +2769,6 @@
</components>
<files />
</RTE>
<LayerInfo>
<Layers>
<Layer>
@ -2731,5 +2777,5 @@
</Layer>
</Layers>
</LayerInfo>
</Project>

Binary file not shown.

View File

@ -428,6 +428,7 @@ void app_init(void)
}
app_preload_logo(TRUE);
system_clock_config_high(); // 切换高频
// fal初始化
{
size = 0;
@ -453,6 +454,7 @@ void app_init(void)
fal_execution_status_set(FAL_EXECUTION_EEPROM_M95_2, TRUE);
fal_execution_status_set(FAL_EXECUTION_EEPROM_FM24, TRUE);
}
system_clock_config_low();
leds_on(LEDS_GREEN);
// 断电重启:优先启动控制模块 <=2000ms
if (noinit_data.rest_flag == 0)

View File

@ -503,6 +503,9 @@ static uint8_t business_inspection(struct flow *fl)
// 工作模式检测
mode_master_detection();
// 对外输出电流
mode_ctrl_output();
// HART检测
app_hart_inspection();

View File

@ -822,7 +822,7 @@ static BOOL hart_write_compression_state_mapping_req(hart_user_req_t *const req)
return TRUE;
}
// 35-写入电流上下限
// 35-写入电流上下限(主变量范围)
static BOOL hart_write_input_range_req(hart_command_req_t *const req)
{
float32_u tmp;
@ -948,7 +948,7 @@ BOOL hart_user_handle(hart_interface_user_event_e event, const void *const data)
BOOL ret = FALSE;
switch (event)
{
case HART_COMMAND_35_EVENT: // 写入电流上下限
case HART_COMMAND_35_EVENT: // 写入电流上下限(主变量范围)
ret = hart_write_input_range_req((hart_command_req_t *)data);
break;
case HART_COMMAND_44_EVENT: // 写入主变量单位

View File

@ -361,7 +361,6 @@ void mode_ctrl_gather(void)
mode_pressure_statistics(); // 气压轮询读取
}
/**
* @brief
*

View File

@ -1921,6 +1921,7 @@ void power_on_diagnosis(void)
{
hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_4);
}
}
/**

View File

@ -609,7 +609,7 @@ static void restart_udevice(void)
// 定位器软件版本号
udevice.dev_sw_version = SW_VER;
// 定位器输出模式
udevice.dev_algorithm_mode = MODE_FREQUENCY_DOMAIN_CONTROL_ALGORITHM;
udevice.dev_algorithm_mode = MODE_VARIABLE_FREQUENCY_CONTROL_ALGORITHM;
// 定位器型号
udevice.dev_model = POSITIONER_MODEL_GPS2000;
// 阀门类型:直行程/角行程 TRAVEL_TYPE_STRAIGHT/TRAVEL_TYPE_ANGULAR

View File

@ -23,7 +23,7 @@ static void variable_params_fill_default(hart_device_variable_t *p)
p->attribute.alarm_selection_code = ALARM_CODE_NOT_USED;
p->attribute.transfer_function_code = TRANSMISSION_FUNCTION_CODE_NOT_USED;
p->attribute.analog_channel_flags = ANALOG_CHANNEL_CODE_0;
p->transducer.upper_and_lower_range_values_units_code = p->units_code;
p->attribute.upper_and_lower_range_values_units_code = p->units_code;
p->status.bits.process_data_status = DEVICE_VARIABLE_STATUS_MANUAL_FIXED;
p->trim_point.trim_points = TRIM_POINTS_1; // HART测试必须所有变量都可测试校准点
p->trim_point.units_code = p->units_code;

View File

@ -83,8 +83,6 @@
GPIO_SET(IP_H_PWR_GPIO_Port, IP_H_PWR_Pin); \
} while (0)
///< PWM对外输出
#define PWM_CTRL_OUTPUT(out) PWM_SET_DUTY(TIM3, 3, out)
/* HART */
#define HART_EN_ENABLE() GPIO_SET(HART_PWR_GPIO_Port, HART_PWR_Pin) ///< HART使能

View File

@ -54,7 +54,7 @@
#define BLE_CURRENT_WORK 7.5f ///< 蓝牙启动工作电流
#define LOOP_TUNE_CURRENT 8.0f ///< 自整定最小输入电流
#define SYSTEM_CLOCK_HIGHT 16000000U ///< 系统高频运行的时钟
#define SYSTEM_CLOCK_HIGHT 11059200U ///< 系统高频运行的时钟
#define SYSTEM_HART_CLOCK 460.8f
#define TEMP_MIN -40.0f ///< 温度最低-40℃
@ -684,6 +684,7 @@ typedef struct
float32 show_target;
float32 show_actual;
uint32_t cpuid[3]; ///< CPUID
} real_time_data_t;
typedef struct

View File

@ -76,7 +76,8 @@ BOOL hart_init(const hart_init_t *const init)
#ifdef SLAVE
hart_device_attribute.hart_protocol_version = &handle.hart_protocol_version;
hart_device_attribute.message_count.ack = 0; // 响应消息计数
hart_device_attribute.message_count.phack = 0; // 响应消息计数
hart_device_attribute.message_count.shack = 0; // 响应消息计数
if (!DBG_ASSERT((hart_get_current_protocol_version() == HART_PROTOCOL_VERSION_5 ||
hart_get_current_protocol_version() == HART_PROTOCOL_VERSION_7) __DBG_LINE)) // 校验协议版本号模块支持协议版本为5,7
return FALSE;
@ -161,7 +162,8 @@ BOOL hart_init(const hart_init_t *const init)
handle.interface.set_dynamics(&hart_device_attribute.dynamics);
hart_device_attribute.hart_protocol_version = &handle.hart_protocol_version;
hart_device_attribute.message_count.ack = 0; // 响应消息计数
hart_device_attribute.message_count.phack = 0; // 响应消息计数
hart_device_attribute.message_count.shack = 0; // 响应消息计数
#else
mock_data();
#endif

View File

@ -49,15 +49,15 @@ void hart_frame_slave_response_operate_code(hart_device_attribute_t *hart_device
* Note:
Masters will issue this command whenever More Status Available (Bit 4 of the device status byte) issetAs a result, the Field Device must carefully define and contro the events and status information inthis command that affect these two device status bits. f the More Status Available bit is alwaysasserted. then communication bandwidth is effectively cut in half.
*/
uint16_t crc = crc16_compute((uint8_t *)&hart_device_attribute->device_status.additional_device_status, sizeof(additional_device_status_t));
if (hart_device_attribute->device_status.additional_device_status_crc != crc)
{
hart_device_status_set_operational_state(DEVICE_OPERATIONAL_STATE_5);
}
else
{
hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_5);
}
// uint16_t crc = crc16_compute((uint8_t *)&hart_device_attribute->device_status.additional_device_status, sizeof(additional_device_status_t));
// if (hart_device_attribute->device_status.additional_device_status_crc != crc)
// {
// hart_device_status_set_operational_state(DEVICE_OPERATIONAL_STATE_5);
// }
// else
// {
// hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_5);
// }
*(hart_frame_response_code_p + 1) = hart_device_attribute->device_status.operational_state;
}

View File

@ -320,7 +320,7 @@ typedef struct
typedef struct
{
uint16_t configuration_change_counter; // 配置被更新的次数
} hart_command_38_t; // 重置配置更改标志
} hart_command_38_t;
typedef struct
{
@ -371,7 +371,10 @@ typedef struct
{
uint8_t pv_transfer_function_code;
} hart_command_47_t;
typedef struct
{
uint8_t command48_status[24]; // 配置被更新的次数
} hart_command_48_t;
typedef struct
{
uint24_t pv_transducer_serial_number;
@ -703,6 +706,7 @@ typedef union
hart_command_45_t command_45; // 微调回路电流归零
hart_command_46_t command_46; // 微调回路电流增益
hart_command_47_t command_47; // 编写主变量传递函数
hart_command_48_t command_48; // 重置配置更改标志
hart_command_49_t command_49; // 写入主变量传感器序列号
hart_command_51_t command_51; // 编写动态变量赋值
hart_command_52_t command_52; // 设置设备变量零
@ -803,7 +807,10 @@ typedef struct
{
uint8_t alarm_selection_code; // 报警选择代码
uint8_t transfer_function_code; // 传递函数代码
uint8_t upper_and_lower_range_values_units_code; // 上限值和下限值单位代码
float32 damping_value; // 阻尼值(以秒为单位)
float32 upper_range_value; // 上限值
float32 lower_range_value; // 下限值
uint8_t analog_channel_flags; // 模拟通道标志 analog_channel_code_e
} device_attribute_t; // 设备属性
@ -811,14 +818,14 @@ typedef struct
typedef struct
{
uint16_t stx; // 此设备接收的STX消息计数
uint16_t ack; // 从该设备发送的ACK消息计数
uint16_t phack; // 从该设备发送到第一主站的ACK消息计数
uint16_t shack; // 从该设备发送到第二主站的ACK消息计数
uint16_t back; // 从此设备发送的BACK消息计数
} message_count_t;
typedef struct
{
uint24_t serial_number; // 传感器序列号
uint8_t limits_and_minimum_span_units_code; // 传感器限制和最小跨度单位代码
uint8_t upper_and_lower_range_values_units_code; // 上限值和下限值单位代码
float32_u upper_limit; // 传感器上限
float32_u lower_limit; // 传感器下限
float32_u minimum_span; // 传感器最小跨度
@ -1021,6 +1028,14 @@ typedef struct
// 这里存放的都是动态变量
} device_variable_dynamics_t; // 设备变量动态,开发人员对该结构体进行初始化
typedef struct
{
uint8_t phost_command38;
uint8_t shost_command38;
uint8_t phost_command48;
uint8_t shost_command48;
} simulation_test; // HTS测试使用 add by ZKBW
typedef struct
{
// 需要实时写入到FLASH中的变量上电时需要从falsh中读取在协议中被更新时需要写入到falsh中地址HART_FLASH_ADDRESS
@ -1045,6 +1060,7 @@ typedef struct
// 当前请求来自第一还是第二主机
uint8_t host;
simulation_test simulation;
} hart_device_attribute_t; // 设备属性
#pragma pack()

View File

@ -532,6 +532,37 @@ BOOL hart_slave_device_send(hart_cache_t *cache_data)
handle->response->data_p += cache_data->payload_length;
osel_mem_free(cache_data->payload);
}
//设备状态位 // ZKBW
if(hart_device_attribute.host == 0x01)
{
if(hart_device_attribute.message_count.phack == 0)
{
hart_device_status_set_operational_state(DEVICE_OPERATIONAL_STATE_6);
}
else if(hart_device_attribute.simulation.phost_command48 == 0)
{
BIT_CLR(hart_device_attribute.device_status.operational_state, DEVICE_OPERATIONAL_STATE_5);
}
else if(hart_device_attribute.simulation.phost_command48 == 1)
{
BIT_SET(hart_device_attribute.device_status.operational_state, DEVICE_OPERATIONAL_STATE_5);
}
}
else if(hart_device_attribute.host == 0x00)
{
if(hart_device_attribute.message_count.shack == 0)
{
hart_device_status_set_operational_state(DEVICE_OPERATIONAL_STATE_6);
}
else if(hart_device_attribute.simulation.shost_command48 == 0)
{
BIT_CLR(hart_device_attribute.device_status.operational_state, DEVICE_OPERATIONAL_STATE_5);
}
else if(hart_device_attribute.simulation.shost_command48 == 1)
{
BIT_SET(hart_device_attribute.device_status.operational_state, DEVICE_OPERATIONAL_STATE_5);
}
}
hart_frame_data_length_end(handle->response->data_p);
hart_frame_response_communication_code(cache_data->code);
@ -552,12 +583,24 @@ BOOL hart_slave_device_send(hart_cache_t *cache_data)
if (handle->response->data_length > 0)
{
handle->response_call(cache_data->uart_index, handle->response->data, handle->response->data_length);
hart_device_attribute.message_count.ack++;
// 发送完第一帧后,需要清理设备状态
handle->response_call(cache_data->uart_index, handle->response->data, handle->response->data_length);
if(hart_device_attribute.host == 0x01)
{
if (hart_device_attribute.message_count.ack == 1)
hart_device_attribute.message_count.phack++;
}
if(hart_device_attribute.host == 0x00)
{
hart_device_attribute.message_count.shack++;
}
// 发送完第一帧后,需要清理设备冷启动状态 // ZKBW
{
if (hart_device_attribute.message_count.phack == 1 && hart_device_attribute.host == 0x01)
{
hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_6);
}
if (hart_device_attribute.message_count.shack == 1 && hart_device_attribute.host == 0x00)
{
hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_6);
}

View File

@ -37,6 +37,7 @@ static void hart_configuration_count_update(void)
}
else
{
//hart_device_attribute.flash_variable.master_cfg_update_count++;
hart_device_attribute.flash_variable.slave_cfg_update_count++;
hart_storage_write_item(HART_STORAGE_PARAMS, HPB_SLAVE_CFG_UPDATE_COUNT,
(uint8_t *)&hart_device_attribute.flash_variable.slave_cfg_update_count);

View File

@ -31,7 +31,7 @@ static void command_0_req(const hart_command_req_t *const req, hart_response_t *
resp->data_p++; // 保留
osel_memcpy(resp->data_p, hart_device_attribute.flash_variable.long_address + 2, 3); // 设备ID长ID的后3个字节
resp->data_p += 3;
uint16_t cfg_cnt = req->master == HART_MASTER ? hart_device_attribute.flash_variable.master_cfg_update_count : hart_device_attribute.flash_variable.slave_cfg_update_count; // 配置更新计数
uint16_t cfg_cnt = hart_device_attribute.flash_variable.master_cfg_update_count; // ZKBW req->master == HART_MASTER ? hart_device_attribute.flash_variable.master_cfg_update_count : hart_device_attribute.flash_variable.slave_cfg_update_count; // 配置更新计数
if (hart_get_current_protocol_version() == HART_PROTOCOL_VERSION_7)
{
*resp->data_p++ = hart_device_attribute.flash_variable.s2m_preambles; // 从设备到主设备的响应前导码个数
@ -242,6 +242,14 @@ static BOOL hart_slave_command_6_req(const hart_command_req_t *const req, hart_r
}
else
{
if (req->data.command_6.poll_address != hart_device_attribute.flash_variable.poll_address)
{
hart_device_attribute.flash_variable.poll_address = req->data.command_6.poll_address;
hart_storage_write_item(HART_STORAGE_PARAMS, HPB_POLL_ADDRESS,
&hart_device_attribute.flash_variable.poll_address);
change = TRUE;
}
if (req->data.command_6.loop_current_mode != hart_device_attribute.flash_variable.loop_current_mode)
{
hart_device_attribute.flash_variable.loop_current_mode = req->data.command_6.loop_current_mode;
@ -522,10 +530,10 @@ static BOOL hart_slave_command_15_req(const hart_command_req_t *const req, hart_
data.pv_alarm_selection_code = variable->attribute.alarm_selection_code;
data.pv_transfer_function_code = variable->attribute.transfer_function_code;
data.pv_upper_and_lower_range_values_units_code = variable->transducer.upper_and_lower_range_values_units_code;
data.pv_upper_and_lower_range_values_units_code = variable->attribute.upper_and_lower_range_values_units_code;
data.pv_damping_value.f = variable->attribute.damping_value;
osel_memcpy((uint8_t *)&data.pv_upper_range_value.f, (uint8_t *)&variable->transducer.upper_limit.f, sizeof(float32));
osel_memcpy((uint8_t *)&data.pv_lower_range_value.f, (uint8_t *)&variable->transducer.lower_limit.f, sizeof(float32));
osel_memcpy((uint8_t *)&data.pv_upper_range_value.f, (uint8_t *)&variable->attribute.upper_range_value, sizeof(float32));
osel_memcpy((uint8_t *)&data.pv_lower_range_value.f, (uint8_t *)&variable->attribute.lower_range_value, sizeof(float32));
data.pv_upper_range_value.c = S2B_UINT32(data.pv_upper_range_value.c); // 主变量上限
data.pv_lower_range_value.c = S2B_UINT32(data.pv_lower_range_value.c); // 主变量下限
data.pv_damping_value.c = S2B_UINT32(data.pv_damping_value.c); // 主变量阻尼
@ -731,7 +739,7 @@ static BOOL hart_slave_command_21_req(const hart_command_req_t *const req, hart_
}
else
{
resp->code = RESPONSE_COMMUNICATION_CODE_38;
return FALSE;
}
return TRUE;
}
@ -775,9 +783,12 @@ static BOOL hart_slave_command_22_req(const hart_command_req_t *const req, hart_
*/
static BOOL hart_slave_command_38_req(const hart_command_req_t *const req, hart_response_t *resp) // ZKBW
{
uint16_t cfg_cnt = req->master == HART_MASTER ? hart_device_attribute.flash_variable.master_cfg_update_count : hart_device_attribute.flash_variable.slave_cfg_update_count; // 配置更新计数
uint16_t cfg_cnt = hart_device_attribute.flash_variable.master_cfg_update_count; // req->master == HART_MASTER ? hart_device_attribute.flash_variable.master_cfg_update_count : hart_device_attribute.flash_variable.slave_cfg_update_count; // 配置更新计数
if (req->data_length == 1) // ZKBW
if (req->data_length == 0)
{
}
else if (req->data_length == 1) // ZKBW
{
resp->code = RESPONSE_COMMUNICATION_CODE_5;
return TRUE;
@ -801,7 +812,11 @@ static BOOL hart_slave_command_38_req(const hart_command_req_t *const req, hart_
{
*resp->data_p++ = HI_UINT16(cfg_cnt);
*resp->data_p++ = LO_UINT16(cfg_cnt);
hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_7);
if (hart_device_attribute.host == 0x01)
{
BIT_CLR(hart_device_attribute.device_status.operational_state, DEVICE_OPERATIONAL_STATE_7);
}
// hart_device_status_clr_operational_state(DEVICE_OPERATIONAL_STATE_7);
}
return TRUE;
}
@ -815,8 +830,38 @@ static BOOL hart_slave_command_38_req(const hart_command_req_t *const req, hart_
static BOOL hart_slave_command_48_req(const hart_command_req_t *const req, hart_response_t *resp)
{
additional_device_status_t command_48;
uint8_t *ptr = NULL;
osel_memset((uint8_t *)&command_48, 0x00, sizeof(additional_device_status_t));
if (req->data_length == 0)
{
}
else if (req->data_length > 0 & req->data_length < 10)
{
resp->code = RESPONSE_COMMUNICATION_CODE_5;
return TRUE;
}
else
{
if ((req->data.command_48.command48_status[0] == hart_device_attribute.device_status.additional_device_status.device_specific_status[0]) && (req->data.command_48.command48_status[1] == hart_device_attribute.device_status.additional_device_status.device_specific_status[1]) && (req->data.command_48.command48_status[2] == hart_device_attribute.device_status.additional_device_status.device_specific_status[2]) && (req->data.command_48.command48_status[3] == hart_device_attribute.device_status.additional_device_status.device_specific_status[3]) && (req->data.command_48.command48_status[4] == hart_device_attribute.device_status.additional_device_status.device_specific_status[4]) && (req->data.command_48.command48_status[5] == hart_device_attribute.device_status.additional_device_status.device_specific_status[5]) && (req->data.command_48.command48_status[6] == hart_device_attribute.device_status.additional_device_status.extended_device_status) && (req->data.command_48.command48_status[7] == hart_device_attribute.device_status.additional_device_status.device_operating_mode) && (req->data.command_48.command48_status[8] == hart_device_attribute.device_status.additional_device_status.standardized_status0) && (req->data.command_48.command48_status[9] == hart_device_attribute.device_status.additional_device_status.standardized_status1))
{
if (hart_device_attribute.host == 0x01)
{
// 清第一主站更多状态
hart_device_attribute.simulation.phost_command48 = 0;
}
if (hart_device_attribute.host == 0x00)
{
// 清第二主站更多状态
hart_device_attribute.simulation.shost_command48 = 0;
}
}
else
{
resp->code = RESPONSE_COMMUNICATION_CODE_14;
// return TRUE;
}
}
ptr = command_48.device_specific_status;
for (uint8_t i = 0; i < ARRAY_LEN(hart_device_attribute.device_status.additional_device_status.device_specific_status); i++)
{
@ -895,8 +940,11 @@ static BOOL hart_slave_command_33_req(const hart_command_req_t *const req, hart_
{
uctemp_length = 4;
}
if(uctemp_length == 4 && req->data.command_33.slot_0 == 0xff && req->data.command_33.slot_1 == 0xff
&& req->data.command_33.slot_2 == 0xff && req->data.command_33.slot_3)
if (uctemp_length == 4 &&
req->data.command_33.slot_0 == 0xff &&
req->data.command_33.slot_1 == 0xff &&
req->data.command_33.slot_2 == 0xff &&
req->data.command_33.slot_3)
{
resp->code = RESPONSE_COMMUNICATION_CODE_2;
return TRUE;
@ -962,9 +1010,9 @@ static BOOL hart_slave_command_35_req(const hart_command_req_t *const req, hart_
{
if (variable->units_code_allow[i] == req->data.command_35.pv_upper_and_lower_range_values_units_code)
{
if (variable->transducer.upper_and_lower_range_values_units_code != req->data.command_35.pv_upper_and_lower_range_values_units_code)
if (variable->attribute.upper_and_lower_range_values_units_code != req->data.command_35.pv_upper_and_lower_range_values_units_code)
{
variable->transducer.upper_and_lower_range_values_units_code = req->data.command_35.pv_upper_and_lower_range_values_units_code;
variable->attribute.upper_and_lower_range_values_units_code = req->data.command_35.pv_upper_and_lower_range_values_units_code;
change = TRUE;
}
break;
@ -979,32 +1027,32 @@ static BOOL hart_slave_command_35_req(const hart_command_req_t *const req, hart_
tmpupper.c = B2S_UINT32(tmpupper.c);
tmplower.f = req->data.command_35.pv_lower_range_value;
tmplower.c = B2S_UINT32(tmplower.c);
if ((tmpupper.f > variable->transducer.upper_limit.f && tmplower.f < variable->transducer.lower_limit.f) || (tmpupper.f < variable->transducer.lower_limit.f && tmplower.f > variable->transducer.upper_limit.f))
if ((tmpupper.f > variable->attribute.upper_range_value && tmplower.f < variable->attribute.lower_range_value) || (tmpupper.f < variable->attribute.lower_range_value && tmplower.f > variable->attribute.lower_range_value))
{
resp->code = RESPONSE_COMMUNICATION_CODE_13;
return TRUE;
}
if (tmplower.f > variable->transducer.upper_limit.f)
if (tmplower.f > variable->attribute.lower_range_value)
{
resp->code = RESPONSE_COMMUNICATION_CODE_9;
return TRUE;
}
if (tmpupper.f > variable->transducer.upper_limit.f)
if (tmpupper.f > variable->attribute.lower_range_value)
{
resp->code = RESPONSE_COMMUNICATION_CODE_11;
return TRUE;
}
if (tmpupper.f < variable->transducer.lower_limit.f)
if (tmpupper.f < variable->attribute.lower_range_value)
{
resp->code = RESPONSE_COMMUNICATION_CODE_12;
return TRUE;
}
if (tmplower.f < variable->transducer.lower_limit.f)
if (tmplower.f < variable->attribute.lower_range_value)
{
resp->code = RESPONSE_COMMUNICATION_CODE_10;
@ -1027,15 +1075,15 @@ static BOOL hart_slave_command_35_req(const hart_command_req_t *const req, hart_
resp->code = RESPONSE_COMMUNICATION_CODE_14;
}
if (variable->transducer.upper_limit.f != tmpupper.f)
if (variable->attribute.lower_range_value != tmpupper.f)
{
osel_memcpy((uint8_t *)&variable->transducer.upper_limit.f, (uint8_t *)&tmpupper.f, sizeof(float32));
osel_memcpy((uint8_t *)&variable->attribute.lower_range_value, (uint8_t *)&tmpupper.f, sizeof(float32));
change = TRUE;
}
if (variable->transducer.lower_limit.f != tmplower.f)
if (variable->attribute.lower_range_value != tmplower.f)
{
osel_memcpy((uint8_t *)&variable->transducer.lower_limit.f, (uint8_t *)&tmplower.f, sizeof(float32));
osel_memcpy((uint8_t *)&variable->attribute.lower_range_value, (uint8_t *)&tmplower.f, sizeof(float32));
change = TRUE;
}
@ -1044,13 +1092,13 @@ static BOOL hart_slave_command_35_req(const hart_command_req_t *const req, hart_
hart_device_status_set_operational_state(DEVICE_OPERATIONAL_STATE_7);
}
// 回复数据
*resp->data_p++ = variable->transducer.upper_and_lower_range_values_units_code;
osel_memcpy((uint8_t *)&tmpupper.f, (uint8_t *)&variable->transducer.upper_limit.f, sizeof(float32));
*resp->data_p++ = variable->attribute.upper_and_lower_range_values_units_code;
osel_memcpy((uint8_t *)&tmpupper.f, (uint8_t *)&variable->attribute.lower_range_value, sizeof(float32));
tmpupper.c = S2B_UINT32(tmpupper.c);
osel_memcpy(resp->data_p, (uint8_t *)&tmpupper, sizeof(float32_u));
resp->data_p += sizeof(float32_u);
osel_memcpy((uint8_t *)&tmplower.f, (uint8_t *)&variable->transducer.lower_limit.f, sizeof(float32));
osel_memcpy((uint8_t *)&tmplower.f, (uint8_t *)&variable->attribute.lower_range_value, sizeof(float32));
tmplower.c = S2B_UINT32(tmplower.c);
osel_memcpy(resp->data_p, (uint8_t *)&tmplower, sizeof(float32_u));
resp->data_p += sizeof(float32_u);
@ -1110,9 +1158,9 @@ static BOOL hart_slave_command_44_req(const hart_command_req_t *const req, hart_
variable->units_code = req->data.command_44.pv_units_code;
change = TRUE;
}
if (variable->transducer.upper_and_lower_range_values_units_code != req->data.command_44.pv_units_code)
if (variable->attribute.upper_and_lower_range_values_units_code != req->data.command_44.pv_units_code)
{
variable->transducer.upper_and_lower_range_values_units_code = req->data.command_44.pv_units_code;
variable->attribute.upper_and_lower_range_values_units_code = req->data.command_44.pv_units_code;
change = TRUE;
}
break;
@ -1295,7 +1343,6 @@ static BOOL hart_slave_command_53_req(const hart_command_req_t *const req, hart_
osel_memcpy((uint8_t *)&user_req.data.command_53, (uint8_t *)&req->data.command_53, sizeof(hart_command_53_t));
hart_device_variable_p = get_device_variable(req->data.command_53.device_ariable);
type = get_variable_type(req->data.command_53.device_ariable);
if (type == VARIABLE)
{

Binary file not shown.

View File

@ -554,60 +554,65 @@ ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-LL-false,2-MX_GPIO_Init-GPIO-false-LL-true,3-MX_DMA_Init-DMA-false-LL-true,4-MX_ADC1_Init-ADC1-false-LL-true,5-MX_TIM3_Init-TIM3-false-LL-true,6-MX_DAC1_Init-DAC1-false-LL-true,7-MX_SPI2_Init-SPI2-false-LL-true,8-MX_SPI1_Init-SPI1-false-LL-true,9-MX_TIM2_Init-TIM2-false-LL-true,10-MX_UART5_Init-UART5-false-LL-true,11-MX_USART1_UART_Init-USART1-false-LL-true,12-MX_TIM6_Init-TIM6-false-LL-true,13-MX_TIM7_Init-TIM7-false-LL-true,14-MX_TIM17_Init-TIM17-false-LL-true,15-MX_TIM16_Init-TIM16-false-LL-true
RCC.ADCFreq_Value=32000000
RCC.AHBCLKDivider=RCC_SYSCLK_DIV8
RCC.AHBFreq_Value=4000000
RCC.APB1Freq_Value=4000000
RCC.APB1TimFreq_Value=4000000
RCC.APB2Freq_Value=4000000
RCC.APB2TimFreq_Value=4000000
RCC.CortexFreq_Value=4000000
RCC.DFSDMFreq_Value=4000000
RCC.FCLKCortexFreq_Value=4000000
RCC.ADCFreq_Value=8294400
RCC.AHBCLKDivider=RCC_SYSCLK_DIV2
RCC.AHBFreq_Value=5529600
RCC.APB1Freq_Value=5529600
RCC.APB1TimFreq_Value=5529600
RCC.APB2Freq_Value=5529600
RCC.APB2TimFreq_Value=5529600
RCC.CortexFreq_Value=5529600
RCC.DFSDMFreq_Value=5529600
RCC.FCLKCortexFreq_Value=5529600
RCC.FamilyName=M
RCC.HCLKFreq_Value=4000000
RCC.HSE_VALUE=8000000
RCC.HCLKFreq_Value=5529600
RCC.HSE_VALUE=11059200
RCC.HSI_VALUE=16000000
RCC.I2C1Freq_Value=4000000
RCC.I2C2Freq_Value=4000000
RCC.I2C3Freq_Value=4000000
RCC.IPParameters=ADCFreq_Value,AHBCLKDivider,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDMFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MSIClockRange,MSI_VALUE,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSAI2PoutputFreq_Value,PLLSAI2RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMCFreq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value,VCOSAI2OutputFreq_Value
RCC.LPTIM1Freq_Value=4000000
RCC.LPTIM2Freq_Value=4000000
RCC.LPUART1Freq_Value=4000000
RCC.I2C1Freq_Value=5529600
RCC.I2C2Freq_Value=5529600
RCC.I2C3Freq_Value=5529600
RCC.IPParameters=ADCFreq_Value,AHBCLKDivider,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDMFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MSIClockRange,MSI_VALUE,PLLM,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLR,PLLRCLKFreq_Value,PLLSAI1N,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1R,PLLSAI1RoutputFreq_Value,PLLSAI2PoutputFreq_Value,PLLSAI2RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMCFreq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value,VCOSAI2OutputFreq_Value
RCC.LPTIM1Freq_Value=5529600
RCC.LPTIM2Freq_Value=5529600
RCC.LPUART1Freq_Value=5529600
RCC.LSCOPinFreq_Value=32000
RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000
RCC.MCO1PinFreq_Value=32000000
RCC.MCO1PinFreq_Value=11059200
RCC.MSIClockRange=RCC_MSIRANGE_8
RCC.MSI_VALUE=16000000
RCC.PLLPoutputFreq_Value=9142857.142857144
RCC.PLLQoutputFreq_Value=32000000
RCC.PLLRCLKFreq_Value=32000000
RCC.PLLSAI1PoutputFreq_Value=9142857.142857144
RCC.PLLSAI1QoutputFreq_Value=32000000
RCC.PLLSAI1RoutputFreq_Value=32000000
RCC.PLLSAI2PoutputFreq_Value=9142857.142857144
RCC.PLLSAI2RoutputFreq_Value=32000000
RCC.PLLM=2
RCC.PLLN=12
RCC.PLLPoutputFreq_Value=9479314.285714285
RCC.PLLQoutputFreq_Value=33177600
RCC.PLLR=RCC_PLLR_DIV6
RCC.PLLRCLKFreq_Value=11059200
RCC.PLLSAI1N=12
RCC.PLLSAI1PoutputFreq_Value=9479314.285714285
RCC.PLLSAI1QoutputFreq_Value=33177600
RCC.PLLSAI1R=RCC_PLLR_DIV8
RCC.PLLSAI1RoutputFreq_Value=8294400
RCC.PLLSAI2PoutputFreq_Value=6319542.857142857
RCC.PLLSAI2RoutputFreq_Value=22118400
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
RCC.PWRFreq_Value=32000000
RCC.RNGFreq_Value=32000000
RCC.SAI1Freq_Value=9142857.142857144
RCC.SAI2Freq_Value=9142857.142857144
RCC.SDMMCFreq_Value=32000000
RCC.SWPMI1Freq_Value=4000000
RCC.SYSCLKFreq_VALUE=32000000
RCC.PWRFreq_Value=11059200
RCC.RNGFreq_Value=33177600
RCC.SAI1Freq_Value=9479314.285714285
RCC.SAI2Freq_Value=9479314.285714285
RCC.SDMMCFreq_Value=33177600
RCC.SWPMI1Freq_Value=5529600
RCC.SYSCLKFreq_VALUE=11059200
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.UART4Freq_Value=4000000
RCC.UART5Freq_Value=4000000
RCC.USART1Freq_Value=4000000
RCC.USART2Freq_Value=4000000
RCC.USART3Freq_Value=4000000
RCC.USBFreq_Value=32000000
RCC.VCOInputFreq_Value=8000000
RCC.VCOOutputFreq_Value=64000000
RCC.VCOSAI1OutputFreq_Value=64000000
RCC.VCOSAI2OutputFreq_Value=64000000
RCC.UART4Freq_Value=5529600
RCC.UART5Freq_Value=5529600
RCC.USART1Freq_Value=5529600
RCC.USART2Freq_Value=5529600
RCC.USART3Freq_Value=5529600
RCC.USBFreq_Value=33177600
RCC.VCOInputFreq_Value=5529600
RCC.VCOOutputFreq_Value=66355200
RCC.VCOSAI1OutputFreq_Value=66355200
RCC.VCOSAI2OutputFreq_Value=44236800
SH.ADCx_IN11.0=ADC1_IN11,IN11-Single-Ended
SH.ADCx_IN11.ConfNb=1
SH.ADCx_IN12.0=ADC1_IN12,IN12-Single-Ended
@ -639,7 +644,7 @@ SH.S_TIM3_CH2.ConfNb=1
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
SPI1.CLKPhase=SPI_PHASE_2EDGE
SPI1.CLKPolarity=SPI_POLARITY_HIGH
SPI1.CalculateBaudRate=2.0 MBits/s
SPI1.CalculateBaudRate=2.7648 MBits/s
SPI1.DataSize=SPI_DATASIZE_8BIT
SPI1.Direction=SPI_DIRECTION_2LINES
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,CLKPolarity,CLKPhase,BaudRatePrescaler
@ -647,7 +652,7 @@ SPI1.Mode=SPI_MODE_MASTER
SPI1.VirtualType=VM_MASTER
SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
SPI2.CLKPolarity=SPI_POLARITY_LOW
SPI2.CalculateBaudRate=1000.0 KBits/s
SPI2.CalculateBaudRate=1.3824 MBits/s
SPI2.DataSize=SPI_DATASIZE_8BIT
SPI2.Direction=SPI_DIRECTION_2LINES
SPI2.FirstBit=SPI_FIRSTBIT_LSB
@ -662,11 +667,11 @@ STMicroelectronics.X-CUBE-ALGOBUILD.1.3.0_SwParameter=LibraryCcDSPOoLibraryJjDSP
TIM16.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM16.IPParameters=Prescaler,Period,AutoReloadPreload
TIM16.Period=24
TIM16.Prescaler=399
TIM16.Prescaler=552
TIM17.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM17.IPParameters=Prescaler,Period,AutoReloadPreload
TIM17.Period=999
TIM17.Prescaler=399
TIM17.Prescaler=552
TIM2.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM2.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
TIM2.ClearChannel4=TIM_CHANNEL_4
@ -675,22 +680,22 @@ TIM2.CounterMode=TIM_COUNTERMODE_UP
TIM2.IPParameters=Channel-PWM Generation4 CH4,Period,AutoReloadPreload,ClearInputSource,ClearChannel4,Prescaler,OCPolarity_4,CounterMode,OCFastMode_PWM-PWM Generation4 CH4
TIM2.OCFastMode_PWM-PWM\ Generation4\ CH4=TIM_OCFAST_ENABLE
TIM2.OCPolarity_4=TIM_OCPOLARITY_HIGH
TIM2.Period=3999
TIM2.Period=5529
TIM2.Prescaler=0
TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
TIM3.IPParameters=Period,AutoReloadPreload,Prescaler,Channel-PWM Generation2 CH2,Pulse-PWM Generation2 CH2
TIM3.Period=3999
TIM3.Period=11
TIM3.Prescaler=0
TIM3.Pulse-PWM\ Generation2\ CH2=0
TIM6.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM6.IPParameters=Prescaler,Period,AutoReloadPreload
TIM6.Period=99
TIM6.Prescaler=399
TIM6.Prescaler=552
TIM7.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM7.IPParameters=Prescaler,Period,AutoReloadPreload
TIM7.Period=249
TIM7.Prescaler=399
TIM7.Prescaler=552
UART5.BaudRate=115200
UART5.IPParameters=BaudRate
USART1.BaudRate=1200