Merge branch 'develop' of http://git.jsgsdt.com:8070/wxsmart-test/acdt into develop
This commit is contained in:
commit
887c05a289
290046
MDK-ARM/JLinkLog.txt
290046
MDK-ARM/JLinkLog.txt
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,9 +1,9 @@
|
|||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>µVision Build Log</h1>
|
||||
<h1><EFBFBD>Vision Build Log</h1>
|
||||
<h2>Tool Versions:</h2>
|
||||
IDE-Version: ¦ÌVision V5.39.0.0
|
||||
IDE-Version: <EFBFBD><EFBFBD>Vision V5.39.0.0
|
||||
Copyright (C) 2023 ARM Ltd and ARM Germany GmbH. All rights reserved.
|
||||
License Information: 1111 admin, 111, LIC=CZLZX-HG49K-CXUU6-DWQ8R-YUSX2-8I4LW
|
||||
|
||||
|
@ -27,7 +27,7 @@ Project File Date: 04/09/2025
|
|||
<h2>Output:</h2>
|
||||
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Users\admin\Desktop\wujunchao\99_General softwares\Keil_v5\ARM\ARM Compiler_5_06\Bin'
|
||||
Build target 'VOQC'
|
||||
compiling ch395.c...
|
||||
compiling gpios.c...
|
||||
linking...
|
||||
Program Size: Code=41082 RO-data=514 RW-data=548 ZI-data=8564
|
||||
FromELF: creating hex file...
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1048,6 +1048,9 @@ Section Cross References
|
|||
mf5803.o(i.SPI_Write_OneByte) refers to stm32f4xx_hal_gpio.o(i.HAL_GPIO_WritePin) for HAL_GPIO_WritePin
|
||||
mf5803.o(i.mf5803_loop) refers to mf5803.o(i.GetSensorData) for GetSensorData
|
||||
mf5803.o(i.mf5803_loop) refers to stm32f4xx_hal_gpio.o(i.HAL_GPIO_WritePin) for HAL_GPIO_WritePin
|
||||
mf5803.o(i.mf5803_loop) refers to dflt_clz.o(x$fpl$dflt) for __aeabi_i2d
|
||||
mf5803.o(i.mf5803_loop) refers to ddiv.o(x$fpl$ddiv) for __aeabi_ddiv
|
||||
mf5803.o(i.mf5803_loop) refers to dfix.o(x$fpl$dfix) for __aeabi_d2iz
|
||||
mf5803.o(i.mf5803_loop) refers to mf5803.o(.data) for reading
|
||||
mf5803.o(i.mf5803_loop) refers to ms5803.o(.data) for NSS_Select
|
||||
mf5803.o(i.mf5803_loop) refers to mf5803.o(.bss) for p_flt_window
|
||||
|
@ -1518,19 +1521,21 @@ Section Cross References
|
|||
modbus_tcp.o(i.writesinglereg_tcp) refers to modbus_tcp.o(i.modbus_errfunction_tcp) for modbus_errfunction_tcp
|
||||
modbus_tcp.o(i.writesinglereg_tcp) refers to modbus_tcp.o(.data) for tx_start
|
||||
modbus_tcp.o(i.writesinglereg_tcp) refers to ch395.o(.bss) for g_ch395q_sta
|
||||
adcs.o(i.adcs_data) refers to stm32f4xx_hal_adc.o(i.HAL_ADC_Start) for HAL_ADC_Start
|
||||
adcs.o(i.adcs_data) refers to stm32f4xx_hal_adc.o(i.HAL_ADC_GetValue) for HAL_ADC_GetValue
|
||||
adcs.o(i.adcs_data) refers to dflt_clz.o(x$fpl$dfltu) for __aeabi_ui2d
|
||||
adcs.o(i.adcs_data) refers to ddiv.o(x$fpl$ddiv) for __aeabi_ddiv
|
||||
adcs.o(i.adcs_data) refers to dmul.o(x$fpl$dmul) for __aeabi_dmul
|
||||
adcs.o(i.adcs_data) refers to dfixu.o(x$fpl$dfixu) for __aeabi_d2uiz
|
||||
adcs.o(i.adcs_data) refers to adc.o(.bss) for hadc1
|
||||
adcs.o(i.adcs_data) refers to adcs.o(.data) for ADC_ConvertedValue
|
||||
adcs.o(i.adcs_data) refers to modbus.o(.bss) for InputReg
|
||||
adcs.o(i.adcs_init) refers to stm32f4xx_hal_adc.o(i.HAL_ADC_Start_DMA) for HAL_ADC_Start_DMA
|
||||
adcs.o(i.adcs_init) refers to adcs.o(.data) for ADC_ConvertedValue
|
||||
adcs.o(i.adcs_init) refers to adc.o(.bss) for hadc1
|
||||
adcs.o(i.analog_gather) refers to mf5803.o(i.mf5803_loop) for mf5803_loop
|
||||
adcs.o(i.analog_gather) refers to adcs.o(i.adcs_data) for adcs_data
|
||||
adcs.o(i.analog_gather) refers to ads1256.o(i.ads1256_get_data) for ads1256_get_data
|
||||
adcs.o(i.analog_gather) refers to ads1220.o(i.ads1220_get_data) for ads1220_get_data
|
||||
adcs.o(i.analog_gather) refers to ds18b20.o(i.ds18b20_get_temp) for ds18b20_get_temp
|
||||
adcs.o(i.analog_gather) refers to timer.o(.data) for it_10ms_flag
|
||||
adcs.o(i.analog_gather) refers to adcs.o(.data) for Temp
|
||||
adcs.o(i.analog_gather) refers to modbus.o(.bss) for InputReg
|
||||
adcs.o(i.analog_gather) refers to adcs.o(.data) for Temp
|
||||
gpios.o(i.digital_ctrl) refers to gpios.o(i.led_ctrl) for led_ctrl
|
||||
gpios.o(i.digital_ctrl) refers to stm32f4xx_hal_gpio.o(i.HAL_GPIO_WritePin) for HAL_GPIO_WritePin
|
||||
gpios.o(i.digital_ctrl) refers to hc595.o(i.hc595_write_data) for hc595_write_data
|
||||
|
@ -1576,7 +1581,6 @@ Section Cross References
|
|||
provalctrl.o(i.analog_ctrl) refers to provalctrl.o(i.current_output_calibrate) for current_output_calibrate
|
||||
provalctrl.o(i.analog_ctrl) refers to dac7311.o(i.ao_dwq_set) for ao_dwq_set
|
||||
provalctrl.o(i.analog_ctrl) refers to dac7311.o(i.ao_blf1_set) for ao_blf1_set
|
||||
provalctrl.o(i.analog_ctrl) refers to dac7311.o(i.ao_blf2_set) for ao_blf2_set
|
||||
provalctrl.o(i.analog_ctrl) refers to provalctrl.o(.data) for ao_ee_save_flag
|
||||
provalctrl.o(i.analog_ctrl) refers to provalctrl.o(.bss) for AO_0_table
|
||||
provalctrl.o(i.analog_ctrl) refers to modbus.o(.data) for HoldReg
|
||||
|
@ -1943,18 +1947,23 @@ Removing Unused input sections from the image.
|
|||
Removing stm32f4xx_hal_adc.o(.rev16_text), (4 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(.revsh_text), (4 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(.rrx_text), (6 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.ADC_DMAConvCplt), (126 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.ADC_DMAError), (26 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.ADC_DMAHalfConvCplt), (14 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_AnalogWDGConfig), (136 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_ConvCpltCallback), (2 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_ConvHalfCpltCallback), (2 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_DeInit), (68 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_ErrorCallback), (2 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_GetError), (6 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_GetState), (6 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_GetValue), (8 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_IRQHandler), (354 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_LevelOutOfWindowCallback), (2 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_MspDeInit), (2 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_MspInit), (2 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_PollForConversion), (206 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_PollForEvent), (128 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_Start), (332 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_Start_DMA), (436 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_Start_IT), (348 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_Stop), (72 bytes).
|
||||
Removing stm32f4xx_hal_adc.o(i.HAL_ADC_Stop_DMA), (128 bytes).
|
||||
|
@ -2490,9 +2499,18 @@ Removing Unused input sections from the image.
|
|||
Removing ads1256.o(.rev16_text), (4 bytes).
|
||||
Removing ads1256.o(.revsh_text), (4 bytes).
|
||||
Removing ads1256.o(.rrx_text), (6 bytes).
|
||||
Removing ads1256.o(i.ADS1256ReadData), (396 bytes).
|
||||
Removing ads1256.o(i.ads1256_get_data), (868 bytes).
|
||||
Removing ads1256.o(i.ads1256_read_byte), (88 bytes).
|
||||
Removing ads1220.o(.rev16_text), (4 bytes).
|
||||
Removing ads1220.o(.revsh_text), (4 bytes).
|
||||
Removing ads1220.o(.rrx_text), (6 bytes).
|
||||
Removing ads1220.o(i.ads1220_get_data), (876 bytes).
|
||||
Removing ads1220.o(i.ads1220_read_byte), (88 bytes).
|
||||
Removing ads1220.o(i.ads1220_readdata), (68 bytes).
|
||||
Removing ads1220.o(i.ads1220_setchannl), (40 bytes).
|
||||
Removing ads1220.o(.bss), (176 bytes).
|
||||
Removing ads1220.o(.data), (32 bytes).
|
||||
Removing dac7311.o(.rev16_text), (4 bytes).
|
||||
Removing dac7311.o(.revsh_text), (4 bytes).
|
||||
Removing dac7311.o(.rrx_text), (6 bytes).
|
||||
|
@ -2640,10 +2658,10 @@ Image Symbol Table
|
|||
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c 0x00000000 Number 0 stm32f4xx_hal_tim_ex.o ABSOLUTE
|
||||
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c 0x00000000 Number 0 stm32f4xx_hal_uart.o ABSOLUTE
|
||||
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c 0x00000000 Number 0 stm32f4xx_ll_adc.o ABSOLUTE
|
||||
../clib/angel/boardlib.s 0x00000000 Number 0 boardinit2.o ABSOLUTE
|
||||
../clib/angel/boardlib.s 0x00000000 Number 0 boardinit3.o ABSOLUTE
|
||||
../clib/angel/boardlib.s 0x00000000 Number 0 boardshut.o ABSOLUTE
|
||||
../clib/angel/boardlib.s 0x00000000 Number 0 boardinit2.o ABSOLUTE
|
||||
../clib/angel/boardlib.s 0x00000000 Number 0 boardinit1.o ABSOLUTE
|
||||
../clib/angel/boardlib.s 0x00000000 Number 0 boardshut.o ABSOLUTE
|
||||
../clib/angel/dczerorl2.s 0x00000000 Number 0 __dczerorl2.o ABSOLUTE
|
||||
../clib/angel/handlers.s 0x00000000 Number 0 __scatter_zi.o ABSOLUTE
|
||||
../clib/angel/kernel.s 0x00000000 Number 0 __rtentry4.o ABSOLUTE
|
||||
|
@ -2666,10 +2684,11 @@ Image Symbol Table
|
|||
../clib/angel/sys.s 0x00000000 Number 0 use_no_semi.o ABSOLUTE
|
||||
../clib/angel/sysapp.c 0x00000000 Number 0 sys_wrch.o ABSOLUTE
|
||||
../clib/angel/sysapp.c 0x00000000 Number 0 sys_command.o ABSOLUTE
|
||||
../clib/armsys.c 0x00000000 Number 0 argv_veneer.o ABSOLUTE
|
||||
../clib/armsys.c 0x00000000 Number 0 argv_veneer.o ABSOLUTE
|
||||
../clib/angel/sysapp.c 0x00000000 Number 0 sys_wrch.o ABSOLUTE
|
||||
../clib/armsys.c 0x00000000 Number 0 _get_argv_nomalloc.o ABSOLUTE
|
||||
../clib/armsys.c 0x00000000 Number 0 no_argv.o ABSOLUTE
|
||||
../clib/armsys.c 0x00000000 Number 0 argv_veneer.o ABSOLUTE
|
||||
../clib/armsys.c 0x00000000 Number 0 argv_veneer.o ABSOLUTE
|
||||
../clib/fenv.c 0x00000000 Number 0 _rserrno.o ABSOLUTE
|
||||
../clib/heapalloc.c 0x00000000 Number 0 hrguard.o ABSOLUTE
|
||||
../clib/heapaux.c 0x00000000 Number 0 heapauxi.o ABSOLUTE
|
||||
|
@ -2712,6 +2731,15 @@ Image Symbol Table
|
|||
../clib/printf_percent.s 0x00000000 Number 0 _printf_x.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_pvfn_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_stak_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 __raise.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_cppl_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_rtred_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_fpe_outer.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_rtmem_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_segv_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_general.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_rtmem_outer.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_abrt_inner.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_rtmem_formal.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_rtmem_outer.o ABSOLUTE
|
||||
../clib/signal.c 0x00000000 Number 0 defsig_rtmem_inner.o ABSOLUTE
|
||||
|
@ -2755,8 +2783,8 @@ Image Symbol Table
|
|||
../mathlib/fabs.c 0x00000000 Number 0 fabs.o ABSOLUTE
|
||||
../mathlib/fpclassify.c 0x00000000 Number 0 fpclassify.o ABSOLUTE
|
||||
../mathlib/poly.c 0x00000000 Number 0 poly.o ABSOLUTE
|
||||
../mathlib/pow.c 0x00000000 Number 0 pow_x.o ABSOLUTE
|
||||
../mathlib/pow.c 0x00000000 Number 0 pow.o ABSOLUTE
|
||||
../mathlib/pow.c 0x00000000 Number 0 pow_x.o ABSOLUTE
|
||||
../mathlib/qnan.c 0x00000000 Number 0 qnan.o ABSOLUTE
|
||||
../mathlib/sqrt.c 0x00000000 Number 0 sqrt_x.o ABSOLUTE
|
||||
../mathlib/sqrt.c 0x00000000 Number 0 sqrt.o ABSOLUTE
|
||||
|
@ -4404,21 +4432,21 @@ Image component sizes
|
|||
856 56 0 0 41 9111 eeprom.o
|
||||
232 54 0 16 0 1489 encoder.o
|
||||
548 24 0 0 0 1319 gpio.o
|
||||
324 38 0 2 0 1408 gpios.o
|
||||
324 40 0 2 0 1408 gpios.o
|
||||
152 12 0 0 0 1213 hc165.o
|
||||
152 16 0 0 0 1206 hc595.o
|
||||
196 26 0 0 84 1849 i2c.o
|
||||
670 44 0 28 0 726051 main.o
|
||||
968 70 0 25 480 5526 mf5803.o
|
||||
1148 86 0 25 480 5599 mf5803.o
|
||||
358 32 0 192 406 7196 modbus.o
|
||||
2844 142 0 0 2048 14044 modbus_rtu.o
|
||||
3140 90 0 4 0 12672 modbus_tcp.o
|
||||
256 50 0 17 0 3199 ms5803.o
|
||||
1724 120 0 23 384 12001 provalctrl.o
|
||||
1636 118 0 23 384 11981 provalctrl.o
|
||||
204 22 0 0 88 1861 spi.o
|
||||
64 26 392 0 1536 892 startup_stm32f407xx.o
|
||||
212 36 0 9 0 9777 stm32f4xx_hal.o
|
||||
1460 66 0 0 0 7897 stm32f4xx_hal_adc.o
|
||||
1192 52 0 0 0 4534 stm32f4xx_hal_adc.o
|
||||
312 22 0 0 0 34731 stm32f4xx_hal_cortex.o
|
||||
1436 16 8 0 0 7458 stm32f4xx_hal_dma.o
|
||||
576 50 0 0 0 4355 stm32f4xx_hal_gpio.o
|
||||
|
@ -4472,7 +4500,6 @@ Image component sizes
|
|||
2 0 0 0 0 0 libshutdown.o
|
||||
2 0 0 0 0 0 libshutdown2.o
|
||||
8 4 0 0 96 68 libspace.o
|
||||
72 0 0 0 0 76 llsdiv.o
|
||||
238 0 0 0 0 100 lludivv7m.o
|
||||
24 4 0 0 0 84 noretval__2printf.o
|
||||
78 0 0 0 0 80 rt_memclr_w.o
|
||||
|
@ -4483,12 +4510,10 @@ Image component sizes
|
|||
74 0 0 0 0 80 sys_stackheap_outer.o
|
||||
2 0 0 0 0 68 use_no_semi.o
|
||||
2 0 0 0 0 68 use_no_semi_2.o
|
||||
804 16 0 0 0 368 daddsub_clz.o
|
||||
688 140 0 0 0 256 ddiv.o
|
||||
94 4 0 0 0 140 dfix.o
|
||||
90 4 0 0 0 140 dfixu.o
|
||||
46 0 0 0 0 116 dflt_clz.o
|
||||
162 0 0 0 0 132 dfltll_clz.o
|
||||
84 0 0 0 0 232 dflt_clz.o
|
||||
340 12 0 0 0 152 dmul.o
|
||||
156 4 0 0 0 140 dnaninf.o
|
||||
12 0 0 0 0 116 dretinf.o
|
||||
|
@ -4496,18 +4521,18 @@ Image component sizes
|
|||
0 0 0 0 0 0 usenofp.o
|
||||
|
||||
----------------------------------------------------------------------
|
||||
4292 230 58 0 100 3528 Library Totals
|
||||
3292 214 58 0 100 3068 Library Totals
|
||||
12 0 1 0 4 0 (incl. Padding)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Code (inc. data) RO Data RW Data ZI Data Debug Library Name
|
||||
|
||||
1878 50 57 0 96 1852 c_w.l
|
||||
2402 180 0 0 0 1676 fz_wm.l
|
||||
1806 50 57 0 96 1776 c_w.l
|
||||
1474 164 0 0 0 1292 fz_wm.l
|
||||
|
||||
----------------------------------------------------------------------
|
||||
4292 230 58 0 100 3528 Library Totals
|
||||
3292 214 58 0 100 3068 Library Totals
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
|
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -202,7 +202,7 @@ void mf5803_setup()
|
|||
|
||||
long reading = 0;
|
||||
float press = 0; //kPa
|
||||
float temp = 0; //℃
|
||||
long temp_5803 = 0; //℃
|
||||
float fDat;
|
||||
uint8_t flt_cnt = 0;
|
||||
float p_flt_window[6][FLT_SIZE] = {0}; //sliding window, sensor_1&2 -> pressure[A,B,S]
|
||||
|
@ -215,6 +215,7 @@ void mf5803_loop()
|
|||
reading |= p1[1];
|
||||
reading = reading << 8;
|
||||
reading |= p1[2];
|
||||
|
||||
if(reading >= 8388608)
|
||||
{
|
||||
fDat = (int32_t)(reading - 16777216) / 8388608.0f;
|
||||
|
@ -233,19 +234,36 @@ void mf5803_loop()
|
|||
{
|
||||
SENSOR_SELECT(1);
|
||||
|
||||
for( uint8_t i = 0; i < 6; i++ ) //均值滤波
|
||||
for( uint8_t i = 3; i < 6; i++ ) //均值滤波
|
||||
{
|
||||
sums = 0;
|
||||
for( uint8_t j = 0; j < FLT_SIZE; j++ )
|
||||
{
|
||||
sums += p_flt_window[i][j];
|
||||
}
|
||||
InputReg[ 13 + i ] = sums/FLT_SIZE; //InputReg[13]~InputReg[18]
|
||||
InputReg[ 2 + i ] = sums/FLT_SIZE; //InputReg[13]~InputReg[18]
|
||||
|
||||
temp_5803 = p1[3];
|
||||
temp_5803 = temp_5803 << 8;
|
||||
temp_5803 += p1[4];
|
||||
if (temp_5803 > 32768)
|
||||
{
|
||||
temp_5803 = (temp_5803 - 65844) / 256.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp_5803 = (temp_5803 - 308) / 256.0;
|
||||
}
|
||||
|
||||
if( (-50 <= temp_5803)&&(temp_5803 <= 100) )
|
||||
{
|
||||
InputReg[i + 13] = temp_5803*100;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(NSS_Select > 6) //记录完6路气压后进入此处,每6*10ms
|
||||
{
|
||||
NSS_Select = 1;
|
||||
NSS_Select = 4;
|
||||
|
||||
flt_cnt++;
|
||||
if(flt_cnt > (FLT_SIZE - 1) ) //滑动窗口长度FLT_SIZE,循环记录
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
uint8_t CoilState[(MAX_COIL_NUM + 7) / 8] = {0x00,0x00,0x00,0x00,0x00}; //线圈寄存器
|
||||
uint8_t DisState[(MAX_DIS_NUM + 7) / 8] = {0x00,0x00,0x00,0x00,0x00,0x00}; //离散量寄存器
|
||||
uint16_t InputReg[MAX_INPUT_REG_NUM] = {0x0000,0x0000,0x0000,0x0000}; //输入寄存器
|
||||
uint16_t HoldReg[MAX_HOLD_REG_NUM] = {0, 0,0,0x00C8}; //保持寄存器
|
||||
uint16_t HoldReg[MAX_HOLD_REG_NUM] = {0, 0, 200}; //保持寄存器
|
||||
|
||||
Var_Reg SamVarReg;
|
||||
|
||||
|
|
|
@ -15,14 +15,14 @@ short Temp = 0; //温度
|
|||
|
||||
void adcs_init(void)
|
||||
{
|
||||
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)ADC_ConvertedValue, 1);
|
||||
//HAL_ADC_Start_DMA(&hadc1, (uint32_t *)ADC_ConvertedValue, 1);
|
||||
}
|
||||
|
||||
void adcs_data(void)
|
||||
{
|
||||
//HAL_ADC_Start(&hadc1);
|
||||
//ADC_ConvertedValue = HAL_ADC_GetValue(&hadc1);
|
||||
InputReg[12] = ADC_ConvertedValue;
|
||||
HAL_ADC_Start(&hadc1);
|
||||
ADC_ConvertedValue = HAL_ADC_GetValue(&hadc1);
|
||||
InputReg[1] = ADC_ConvertedValue/4096.0*3300/0.082f;
|
||||
}
|
||||
|
||||
void analog_gather(void)
|
||||
|
@ -32,8 +32,9 @@ void analog_gather(void)
|
|||
it_10ms_flag = 0;
|
||||
mf5803_loop(); //sensor_1 and sensor_2, 气压检测
|
||||
adcs_data(); //定位器输出回采
|
||||
ads1256_get_data(); //8路模拟输入
|
||||
ads1220_get_data(); //比例阀1&2,自带反馈 + 输出回采
|
||||
InputReg[8] = 1009;
|
||||
//ads1256_get_data(); //8路模拟输入
|
||||
//ads1220_get_data(); //比例阀1&2,自带反馈 + 输出回采
|
||||
}
|
||||
|
||||
if(it_100ms_flag == 1)
|
||||
|
|
|
@ -26,7 +26,7 @@ void encoder_init(void)
|
|||
encode_num = 0;
|
||||
cnt_update = 152;
|
||||
|
||||
CoilState[3] &= 0x7F; //初始化完成后线圈寄存器0x28置零
|
||||
CoilState[0] &= 0xFB; //初始化完成后线圈寄存器0x28置零
|
||||
}
|
||||
|
||||
void encoder_run(void)
|
||||
|
@ -39,8 +39,8 @@ void encoder_run(void)
|
|||
else if((curr_encode_num - last_encode_num) > 50000) //向下溢出检测, o(0)->o(65535)
|
||||
cnt_update--;
|
||||
encode_num = curr_encode_num + cnt_update * 0xFFFF; //编码器,返回计数脉冲值
|
||||
InputReg[20] = (encode_num >> 16) & 0xffff; //32位int 拆分成两个 uint16_t,高16位
|
||||
InputReg[21] = encode_num & 0xffff; //32位int 拆分成两个 uint16_t,低16位
|
||||
InputReg[10] = (encode_num >> 16) & 0xffff; //32位int 拆分成两个 uint16_t,高16位
|
||||
InputReg[11] = encode_num & 0xffff; //32位int 拆分成两个 uint16_t,低16位
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ void digital_ctrl()
|
|||
led_ctrl();//指示灯
|
||||
|
||||
//八位DO输出控制
|
||||
PE2_DO1((GPIO_PinState)((CoilState[0]>>0)&0x01));
|
||||
PE3_DO2((GPIO_PinState)((CoilState[0]>>1)&0x01));
|
||||
PE4_DO3((GPIO_PinState)((CoilState[0]>>2)&0x01));
|
||||
PE5_DO4((GPIO_PinState)((CoilState[0]>>3)&0x01));
|
||||
PE6_DO5((GPIO_PinState)((CoilState[0]>>4)&0x01));
|
||||
PE2_DO1((GPIO_PinState)((CoilState[5]>>2)&0x01));
|
||||
PE3_DO2((GPIO_PinState)((CoilState[5]>>3)&0x01));
|
||||
PE4_DO3((GPIO_PinState)((CoilState[5]>>4)&0x01));
|
||||
PE5_DO4((GPIO_PinState)((CoilState[5]>>5)&0x01));
|
||||
PE6_DO5((GPIO_PinState)((CoilState[5]>>6)&0x01));
|
||||
PC13_DO6((GPIO_PinState)((CoilState[0]>>5)&0x01));
|
||||
PC14_DO7((GPIO_PinState)((CoilState[0]>>6)&0x01));
|
||||
PC15_DO8((GPIO_PinState)((CoilState[0]>>7)&0x01));
|
||||
|
@ -46,7 +46,7 @@ void digital_ctrl()
|
|||
DisState[2] = DI_NAMUR1 + DI_NAMUR2 * 2;
|
||||
|
||||
//encoder reset
|
||||
if( ((CoilState[3]>>7)&0x01) == 1 ) //CoilState[3]的D7位,地址0x28
|
||||
if( ((CoilState[0]>>2)&0x01) == 1 ) //CoilState[3]的D7位,地址0x28
|
||||
{
|
||||
encoder_init();
|
||||
}
|
||||
|
|
|
@ -155,15 +155,15 @@ void analog_ctrl(void)
|
|||
//prov_set(ao_blf1,&pv_one); //控制比例阀1
|
||||
}
|
||||
|
||||
if(ao_blf2 != (float)(HoldReg[2]) / 1000) //保持寄存器值发生变化时dac输出
|
||||
{
|
||||
ao_blf2 = (float)(HoldReg[2]) / 1000; // uA -> mA
|
||||
// if(ao_blf2 != (float)(HoldReg[2]) / 1000) //保持寄存器值发生变化时dac输出
|
||||
// {
|
||||
// ao_blf2 = (float)(HoldReg[2]) / 1000; // uA -> mA
|
||||
|
||||
ao_blf2 = current_output_calibrate(AO_2, ao_blf2);
|
||||
// ao_blf2 = current_output_calibrate(AO_2, ao_blf2);
|
||||
|
||||
ao_blf2_set(ao_blf2);
|
||||
//prov_set(ao_blf2,&pv_two); //控制比例阀2
|
||||
}
|
||||
// ao_blf2_set(ao_blf2);
|
||||
// //prov_set(ao_blf2,&pv_two); //控制比例阀2
|
||||
// }
|
||||
|
||||
#if ENABLE_SECTION_CAL
|
||||
if( (CoilState[3]&(0x40)) == 0x40 ) //触发比例阀1自整定
|
||||
|
|
Loading…
Reference in New Issue