modbus数据打包解包代码
This commit is contained in:
1 parent
135ce35517
commit
64ca79d1a3
15 files changed
+307
-52
No files matched your search
@@ -546,9 +546,9 @@ CONFIG_PKG_CJSON_VER="v1.7.17"
|
|||||||
#
|
#
|
||||||
CONFIG_PKG_USING_LVGL=y
|
CONFIG_PKG_USING_LVGL=y
|
||||||
CONFIG_PKG_LVGL_PATH="/packages/multimedia/LVGL/LVGL"
|
CONFIG_PKG_LVGL_PATH="/packages/multimedia/LVGL/LVGL"
|
||||||
CONFIG_PKG_LVGL_THREAD_PRIO=15
|
CONFIG_PKG_LVGL_THREAD_PRIO=25
|
||||||
CONFIG_PKG_LVGL_THREAD_STACK_SIZE=4096
|
CONFIG_PKG_LVGL_THREAD_STACK_SIZE=4096
|
||||||
CONFIG_PKG_LVGL_DISP_REFR_PERIOD=20
|
CONFIG_PKG_LVGL_DISP_REFR_PERIOD=50
|
||||||
# CONFIG_PKG_USING_LVGL_SQUARELINE is not set
|
# CONFIG_PKG_USING_LVGL_SQUARELINE is not set
|
||||||
# CONFIG_PKG_LVGL_USING_EXAMPLES is not set
|
# CONFIG_PKG_LVGL_USING_EXAMPLES is not set
|
||||||
# CONFIG_PKG_LVGL_USING_DEMOS is not set
|
# CONFIG_PKG_LVGL_USING_DEMOS is not set
|
||||||
|
|||||||
@@ -852,6 +852,169 @@
|
|||||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1183979197" name="GNU ARM Cross Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1073550295" />
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1183979197" name="GNU ARM Cross Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1073550295" />
|
||||||
</toolChain>
|
</toolChain>
|
||||||
</folderInfo>
|
</folderInfo>
|
||||||
|
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094.1351195657" name="/" resourcePath="applications/lvgl/guider">
|
||||||
|
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.1469168098" name="ARM Cross GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug" unusedChildren="">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409.1282430206.918486114" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409.1282430206" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149.2099274831.1984072617" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1365878149.2099274831" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944.1813990039.1909536329" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.709136944.1813990039" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770.1977766742.2133161526" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1986446770.1977766742" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261.1565310768.1109565574" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1312975261.1565310768" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212.2003772975.32857025" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1538128212.2003772975" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218.114895171.884637909" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.2136804218.114895171" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.244767666.1449015805.1997272102" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.244767666.1449015805" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.1055848773.1593180684.1022169969" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.1055848773.1593180684" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.501941135.1949049873.1458310841" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.501941135.1949049873" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.1696308067.2020008923.409311625" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.1696308067.2020008923" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1558403188.1848866038.339561003" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1558403188.1848866038" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.749415257.1075631782.364554528" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.749415257.1075631782" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.2114153533.1975209059.1935082689" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.2114153533.1975209059" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1600865811.1837167200.2007884836" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1600865811.1837167200" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1109963929.271084852.1596153752" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1109963929.271084852" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1040883831.704060423.763342466" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1040883831.704060423" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1678200391.171402560.701965647" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1678200391.171402560" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.1171840296.392944028.1120408621" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.1171840296.392944028" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.342604837.587442465.1125478112" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.342604837.587442465" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.898269225.134239251.1080716075" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.898269225.134239251" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.2016398076.548016294.864115142" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.2016398076.548016294" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1606171496.1815496219.1905190362" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1606171496.1815496219" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.540792084.2057374684.1052744851" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.540792084.2057374684" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.architecture.430121817.775183473.1414192984" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.architecture.430121817.775183473" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.966735324.449706993.1117013468" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.966735324.449706993" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.1381561249.88300521.1895968769" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.1381561249.88300521" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.target.other.2041717463.339855165.1545729033" name="Other target flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.target.other.2041717463.339855165" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1463655269.662963964.1256628075" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1463655269.662963964" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.166027860" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.402641416" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.713118130" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1047205824" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1340880478" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1540387012" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.897947529" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.970212999" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.247375641" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.max" valueType="enumerated" />
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.1904430484" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.2031682692" name="GNU ARM Cross Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1340301211">
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.1654271051" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input" />
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.827635923" name="GNU ARM Cross C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.760213825">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1140909589" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/applications/lvgl/guider}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/applications/lvgl}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/cubemx/Inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers//include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/drivers//include//config}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//Device//ST//STM32H7xx//Include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//Include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//CMSIS//RTOS//Template}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//STM32H7xx_HAL_Driver//Inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/libraries//STM32H7xx_HAL_Driver//Inc//Legacy}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/.}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}/applications}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//.}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//cubemx/Inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//cubemx}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/env_support/rt-thread}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/core}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/arm2d}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/nxp/pxp}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/nxp/vglite}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/renesas}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/sdl}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/stm32_dma2d}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/swm341_dma2d}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw/sw}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/draw}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/layouts/flex}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/layouts/grid}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/layouts}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/bmp}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/ffmpeg}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/freetype}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/fsdrv}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/gif}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/png}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/qrcode}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/rlottie}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs/sjpg}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/libs}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/fragment}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/gridnav}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/ime}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/imgfont}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/monkey}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/msg}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others/snapshot}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/others}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/themes/basic}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/themes/default}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/themes/mono}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/themes}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/animimg}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/calendar}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/chart}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/colorwheel}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/imgbtn}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/keyboard}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/led}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/list}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/menu}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/meter}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/msgbox}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/span}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/spinbox}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/spinner}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/tabview}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/tileview}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets/win}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra/widgets}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/extra}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/font}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/hal}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/misc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src/widgets}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/LVGL-v8.3.10/src}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/cJSON-v1.7.17}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/ft5426/inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/littlefs-v2.11.2}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/qmodbus-v1.10/inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/rs485-v1.06/inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//packages/sqlite}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/dfs/dfs_v1/filesystems/devfs}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/dfs/dfs_v1/filesystems/elmfat}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/dfs/dfs_v1/filesystems/tmpfs}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/dfs/dfs_v1/include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/spi/sfud/inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/spi}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/touch}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/usb/usbhost/class}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/usb/usbhost/core}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/usb/usbhost/include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/drivers/usb/usbhost}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/fal/inc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/finsh}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/compilers/common/include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/compilers/newlib}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/posix/io/epoll}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/posix/io/eventfd}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/posix/io/poll}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/components/libc/posix/ipc}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/include}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/libcpu/arm/common}"" />
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc://${ProjName}//rt-thread/libcpu/arm/cortex-m7}"" />
|
||||||
|
</option>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.431326567" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input" />
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.889690327" name="GNU ARM Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.491840938" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.640803175" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.85425436" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1883543016" name="GNU ARM Cross C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1562079477" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.316139463" name="GNU ARM Cross Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.1383707285" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.1632929248" name="GNU ARM Cross Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.666920606" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1077646942" name="GNU ARM Cross Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1870571985" />
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.2135298412" name="GNU ARM Cross Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1183979197" />
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094.96379999" name="/" resourcePath="applications/sql">
|
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.553091094.96379999" name="/" resourcePath="applications/sql">
|
||||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.645385655" name="ARM Cross GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug" unusedChildren="">
|
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.645385655" name="ARM Cross GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug" unusedChildren="">
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409.1683321664" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" />
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409.1683321664" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.251260409" />
|
||||||
@@ -1009,7 +1172,7 @@
|
|||||||
</toolChain>
|
</toolChain>
|
||||||
</folderInfo>
|
</folderInfo>
|
||||||
<sourceEntries>
|
<sourceEntries>
|
||||||
<entry excluding="//packages/LVGL-v8.3.10/examples|//rt-thread/components/dfs/dfs_v1/filesystems/romfs|//packages/LVGL-v8.3.10/env_support/rt-thread/squareline|//rt-thread/src/slab.c|//rt-thread/libcpu/m16c|//rt-thread/libcpu/arm/arm926|//rt-thread/libcpu/arm/cortex-a|//rt-thread/libcpu/arc|//rt-thread/libcpu/arm/common/divsi3.S|//rt-thread/components/drivers/pinctrl|//rt-thread/components/libc/compilers/armlibc|//rt-thread/libcpu/arm/s3c44b0|//rt-thread/components/drivers/serial/serial_tty.c|//rt-thread/components/dfs/dfs_v1/filesystems/mqueue|//rt-thread/libcpu/c-sky|//rt-thread/libcpu/avr32|//rt-thread/components/drivers/ktime|//rt-thread/components/drivers/rtc/alarm.c|//cubemx/EWARM|//rt-thread/components/drivers/sensor|//rt-thread/libcpu/arm/am335x|//rt-thread/components/dfs/dfs_v1/filesystems/cromfs|//rt-thread/components/drivers/can|//rt-thread/components/drivers/pin/pin_dm.c|//rt-thread/components/drivers/usb/usbhost/class/hid.c|//rt-thread/components/libc/compilers/picolibc|//packages/LVGL-v8.3.10/tests|//rt-thread/components/legacy|//rt-thread/components/drivers/wlan|//rt-thread/libcpu/arm/cortex-r4|//rt-thread/libcpu/mips|//rt-thread/src/cpu.c|//rt-thread/components/drivers/ofw|//rt-thread/components/drivers/usb/usbhost/class/adk.c|//rt-thread/libcpu/arm/sep4020|//packages/sqlite/rtthread_io_methods.c|//rt-thread/components/drivers/usb/usbdevice|//rt-thread/libcpu/nios|//rt-thread/components/lwp|//rt-thread/libcpu/arm/dm36x|//rt-thread/components/drivers/misc|//rt-thread/components/drivers/pic|//rt-thread/components/drivers/mtd/mtd_nand.c|//rt-thread/components/drivers/core/driver.c|//rt-thread/libcpu/arm/cortex-m85|//rt-thread/components/libc/compilers/dlib|//rt-thread/components/dfs/dfs_v1/filesystems/skeleton|//rt-thread/components/drivers/i2c/i2c_dm.c|//rt-thread/components/drivers/serial/serial_v2.c|//rt-thread/components/mprotect|//rt-thread/libcpu/ppc|//rt-thread/components/drivers/hwcrypto|//rt-thread/components/drivers/usb/usbhost/class/ukbd.c|//rt-thread/libcpu/sparc-v8|//rt-thread/components/drivers/usb/usbhost/class/umouse.c|//rt-thread/libcpu/unicore32|//cubemx/Src/stm32h7xx_it.c|//rt-thread/components/drivers/pm|//rt-thread/libcpu/risc-v|//rt-thread/libcpu/rx|//cubemx/Src/system_stm32h7xx.c|//packages/littlefs-v2.11.2/runners|//rt-thread/libcpu/arm/zynqmp-r5|//rt-thread/libcpu/arm/cortex-m4|//rt-thread/libcpu/arm/cortex-m33|//rt-thread/src/mem.c|//rt-thread/libcpu/arm/AT91SAM7S|//rt-thread/components/libc/cplusplus|//rt-thread/libcpu/v850|//rt-thread/libcpu/xilinx|//rt-thread/libcpu/arm/common/atomic_arm.c|//rt-thread/libcpu/ia32|//rt-thread/components/drivers/fdt|//rt-thread/libcpu/arm/cortex-m23|//rt-thread/components/libc/compilers/musl|//rt-thread/components/dfs/dfs_v2|//rt-thread/components/drivers/core/dm.c|//rt-thread/components/drivers/core/platform.c|//rt-thread/components/drivers/i2c/i2c_bus.c|//rt-thread/libcpu/ti-dsp|//rt-thread/libcpu/sim|//rt-thread/components/dfs/dfs_v1/filesystems/nfs|//rt-thread/components/drivers/core/platform_ofw.c|//rt-thread/libcpu/arm/realview-a8-vmm|//packages/sqlite/shell.c|//rt-thread/components/drivers/spi/spi-bit-ops.c|//rt-thread/tools|//rt-thread/components/drivers/i2c/soft_i2c.c|//rt-thread/components/net|//rt-thread/components/utilities|//rt-thread/components/drivers/spi/enc28j60.c|//rt-thread/components/drivers/phy|//rt-thread/libcpu/arm/cortex-m0|//rt-thread/libcpu/arm/lpc24xx|//rt-thread/libcpu/arm/s3c24x0|//rt-thread/components/vbus|//packages/LVGL-v8.3.10/demos|//rt-thread/components/drivers/hwtimer|//rt-thread/libcpu/blackfin|//rt-thread/libcpu/arm/cortex-m7/context_iar.S|//packages/sqlite/rtthread_mutex.c|//rt-thread/components/drivers/spi/spi_wifi_rw009.c|//rt-thread/components/dfs/dfs_v1/filesystems/ramfs|//rt-thread/components/fal/samples/porting/fal_flash_stm32f2_port.c|//rt-thread/libcpu/arm/armv6|//rt-thread/components/drivers/audio|//rt-thread/libcpu/arm/lpc214x|//rt-thread/components/drivers/clk|//rt-thread/libcpu/arm/cortex-m7/context_rvds.S|packages/sqlite/rtthread_vfs.c|//rt-thread/components/libc/posix|//rt-thread/libcpu/arm/cortex-m7/mpu.c|//packages/sqlite/rtthread_vfs.c|//rt-thread/components/drivers/cputime|//rt-thread/components/drivers/pin/pin_ofw.c|//rt-thread/libcpu/arm/AT91SAM7X|//rt-thread/components/drivers/serial/serial_dm.c|//rt-thread/components/drivers/virtio|//rt-thread/libcpu/aarch64|//rt-thread/libcpu/arm/cortex-r52|//cubemx/Drivers|//rt-thread/src/scheduler_mp.c|//rt-thread/libcpu/arm/cortex-m3|//rt-thread/components/mm" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
<entry excluding="//cubemx/Drivers|//cubemx/EWARM|//cubemx/Src/stm32h7xx_it.c|//cubemx/Src/system_stm32h7xx.c|//packages/LVGL-v8.3.10/demos|//packages/LVGL-v8.3.10/env_support/rt-thread/squareline|//packages/LVGL-v8.3.10/examples|//packages/LVGL-v8.3.10/tests|//packages/littlefs-v2.11.2/runners|//packages/sqlite/rtthread_io_methods.c|//packages/sqlite/rtthread_mutex.c|//packages/sqlite/rtthread_vfs.c|//packages/sqlite/shell.c|//rt-thread/components/dfs/dfs_v1/filesystems/cromfs|//rt-thread/components/dfs/dfs_v1/filesystems/mqueue|//rt-thread/components/dfs/dfs_v1/filesystems/nfs|//rt-thread/components/dfs/dfs_v1/filesystems/ramfs|//rt-thread/components/dfs/dfs_v1/filesystems/romfs|//rt-thread/components/dfs/dfs_v1/filesystems/skeleton|//rt-thread/components/dfs/dfs_v2|//rt-thread/components/drivers/audio|//rt-thread/components/drivers/can|//rt-thread/components/drivers/clk|//rt-thread/components/drivers/core/dm.c|//rt-thread/components/drivers/core/driver.c|//rt-thread/components/drivers/core/platform.c|//rt-thread/components/drivers/core/platform_ofw.c|//rt-thread/components/drivers/cputime|//rt-thread/components/drivers/fdt|//rt-thread/components/drivers/hwcrypto|//rt-thread/components/drivers/hwtimer|//rt-thread/components/drivers/i2c/i2c_bus.c|//rt-thread/components/drivers/i2c/i2c_dm.c|//rt-thread/components/drivers/i2c/soft_i2c.c|//rt-thread/components/drivers/ktime|//rt-thread/components/drivers/misc|//rt-thread/components/drivers/mtd/mtd_nand.c|//rt-thread/components/drivers/ofw|//rt-thread/components/drivers/phy|//rt-thread/components/drivers/pic|//rt-thread/components/drivers/pin/pin_dm.c|//rt-thread/components/drivers/pin/pin_ofw.c|//rt-thread/components/drivers/pinctrl|//rt-thread/components/drivers/pm|//rt-thread/components/drivers/rtc/alarm.c|//rt-thread/components/drivers/sensor|//rt-thread/components/drivers/serial/serial_dm.c|//rt-thread/components/drivers/serial/serial_tty.c|//rt-thread/components/drivers/serial/serial_v2.c|//rt-thread/components/drivers/spi/enc28j60.c|//rt-thread/components/drivers/spi/spi-bit-ops.c|//rt-thread/components/drivers/spi/spi_wifi_rw009.c|//rt-thread/components/drivers/usb/usbdevice|//rt-thread/components/drivers/usb/usbhost/class/adk.c|//rt-thread/components/drivers/usb/usbhost/class/hid.c|//rt-thread/components/drivers/usb/usbhost/class/ukbd.c|//rt-thread/components/drivers/usb/usbhost/class/umouse.c|//rt-thread/components/drivers/virtio|//rt-thread/components/drivers/wlan|//rt-thread/components/fal/samples/porting/fal_flash_stm32f2_port.c|//rt-thread/components/legacy|//rt-thread/components/libc/compilers/armlibc|//rt-thread/components/libc/compilers/dlib|//rt-thread/components/libc/compilers/musl|//rt-thread/components/libc/compilers/picolibc|//rt-thread/components/libc/cplusplus|//rt-thread/components/libc/posix|//rt-thread/components/lwp|//rt-thread/components/mm|//rt-thread/components/mprotect|//rt-thread/components/net|//rt-thread/components/utilities|//rt-thread/components/vbus|//rt-thread/libcpu/aarch64|//rt-thread/libcpu/arc|//rt-thread/libcpu/arm/AT91SAM7S|//rt-thread/libcpu/arm/AT91SAM7X|//rt-thread/libcpu/arm/am335x|//rt-thread/libcpu/arm/arm926|//rt-thread/libcpu/arm/armv6|//rt-thread/libcpu/arm/common/atomic_arm.c|//rt-thread/libcpu/arm/common/divsi3.S|//rt-thread/libcpu/arm/cortex-a|//rt-thread/libcpu/arm/cortex-m0|//rt-thread/libcpu/arm/cortex-m23|//rt-thread/libcpu/arm/cortex-m3|//rt-thread/libcpu/arm/cortex-m33|//rt-thread/libcpu/arm/cortex-m4|//rt-thread/libcpu/arm/cortex-m7/context_iar.S|//rt-thread/libcpu/arm/cortex-m7/context_rvds.S|//rt-thread/libcpu/arm/cortex-m7/mpu.c|//rt-thread/libcpu/arm/cortex-m85|//rt-thread/libcpu/arm/cortex-r4|//rt-thread/libcpu/arm/cortex-r52|//rt-thread/libcpu/arm/dm36x|//rt-thread/libcpu/arm/lpc214x|//rt-thread/libcpu/arm/lpc24xx|//rt-thread/libcpu/arm/realview-a8-vmm|//rt-thread/libcpu/arm/s3c24x0|//rt-thread/libcpu/arm/s3c44b0|//rt-thread/libcpu/arm/sep4020|//rt-thread/libcpu/arm/zynqmp-r5|//rt-thread/libcpu/avr32|//rt-thread/libcpu/blackfin|//rt-thread/libcpu/c-sky|//rt-thread/libcpu/ia32|//rt-thread/libcpu/m16c|//rt-thread/libcpu/mips|//rt-thread/libcpu/nios|//rt-thread/libcpu/ppc|//rt-thread/libcpu/risc-v|//rt-thread/libcpu/rx|//rt-thread/libcpu/sim|//rt-thread/libcpu/sparc-v8|//rt-thread/libcpu/ti-dsp|//rt-thread/libcpu/unicore32|//rt-thread/libcpu/v850|//rt-thread/libcpu/xilinx|//rt-thread/src/cpu.c|//rt-thread/src/mem.c|//rt-thread/src/scheduler_mp.c|//rt-thread/src/slab.c|//rt-thread/tools" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="" />
|
||||||
</sourceEntries>
|
</sourceEntries>
|
||||||
</configuration>
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
|
|||||||
+31
-2
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "rtthread.h"
|
#include "rtthread.h"
|
||||||
#include "modbus.h"
|
#include "modbus.h"
|
||||||
|
#include "SC828_DATA_table.h"
|
||||||
|
|
||||||
#define DBG_TAG "plc.rtu"
|
#define DBG_TAG "plc.rtu"
|
||||||
#define DBG_LVL DBG_LOG
|
#define DBG_LVL DBG_LOG
|
||||||
@@ -37,7 +38,35 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 regs[64];
|
//输入m0000->rtu2000
|
||||||
|
uint8_t r_buffer[(DI_TABLE_SIZE + 7) / 8];
|
||||||
|
//读取 Modbus bits
|
||||||
|
int mrx = mb_read_bits(hinst, 2000, DI_TABLE_SIZE, r_buffer);
|
||||||
|
if (mrx > 0)
|
||||||
|
{ //解包到数据表
|
||||||
|
for (int i = 0; i < DI_TABLE_SIZE; i++) {
|
||||||
|
di_table[i].current_state = (r_buffer[i / 8] >> (i % 8)) & 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 输出 m0256 -> RTU 2256
|
||||||
|
uint8_t w_buffer[(DO_TABLE_SIZE + 7) / 8]; // 关键:初始化为0
|
||||||
|
// 打包 do_table 到 bit_buffer
|
||||||
|
for (int i = 0; i < DO_TABLE_SIZE; i++) {
|
||||||
|
const int byte_idx = i / 8;
|
||||||
|
const int bit_idx = i % 8;
|
||||||
|
const uint8_t bit_mask = (1U << bit_idx);
|
||||||
|
if (do_table[i].current_state) {
|
||||||
|
w_buffer[byte_idx] |= bit_mask;
|
||||||
|
} else {
|
||||||
|
w_buffer[byte_idx] &= ~bit_mask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 写入 Modbus
|
||||||
|
mb_write_bits(hinst, 2256, DO_TABLE_SIZE, w_buffer);
|
||||||
|
|
||||||
|
|
||||||
|
/* u16 regs[64];
|
||||||
int addr = 7000;
|
int addr = 7000;
|
||||||
int nb = 10;
|
int nb = 10;
|
||||||
int total = mb_write_regs(hinst, addr, nb, regs);
|
int total = mb_write_regs(hinst, addr, nb, regs);
|
||||||
@@ -52,7 +81,7 @@ static void mb_plc_read_regs(mb_inst_t *hinst)
|
|||||||
if (totalM <= 0)
|
if (totalM <= 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mb_plc_thread(void *args)//线程服务函数
|
static void mb_plc_thread(void *args)//线程服务函数
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
}
|
}
|
||||||
else if (strcmp(api, "SC851") == 0)
|
else if (strcmp(api, "SC851") == 0)
|
||||||
{//创建数组
|
{//创建数组
|
||||||
cJSON *Dev = cJSON_CreateArray();
|
/* cJSON *Dev = cJSON_CreateArray();
|
||||||
for (int i = 0; i < DIO_TABLE_SIZE; i++) {
|
for (int i = 0; i < DIO_TABLE_SIZE; i++) {
|
||||||
cJSON* item = cJSON_CreateObject();
|
cJSON* item = cJSON_CreateObject();
|
||||||
// 添加 IO 编号
|
// 添加 IO 编号
|
||||||
@@ -469,11 +469,11 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
// 将当前项添加到数组中
|
// 将当前项添加到数组中
|
||||||
cJSON_AddItemToArray(Dev, item);
|
cJSON_AddItemToArray(Dev, item);
|
||||||
}
|
}
|
||||||
cJSON_AddItemToObject(dat,"DIO",Dev);
|
cJSON_AddItemToObject(dat,"DIO",Dev);*/
|
||||||
}
|
}
|
||||||
else if (strcmp(api, "SC852") == 0)
|
else if (strcmp(api, "SC852") == 0)
|
||||||
{//创建数组
|
{//创建数组
|
||||||
cJSON *Dev = cJSON_CreateArray();
|
/* cJSON *Dev = cJSON_CreateArray();
|
||||||
for (int i = 0; i < AIO_TABLE_SIZE; i++) {
|
for (int i = 0; i < AIO_TABLE_SIZE; i++) {
|
||||||
cJSON* item = cJSON_CreateObject();
|
cJSON* item = cJSON_CreateObject();
|
||||||
// 添加 IO 编号
|
// 添加 IO 编号
|
||||||
@@ -483,11 +483,11 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
// 将当前项添加到数组中
|
// 将当前项添加到数组中
|
||||||
cJSON_AddItemToArray(Dev, item);
|
cJSON_AddItemToArray(Dev, item);
|
||||||
}
|
}
|
||||||
cJSON_AddItemToObject(dat,"A",Dev);
|
cJSON_AddItemToObject(dat,"A",Dev);*/
|
||||||
}
|
}
|
||||||
else if (strcmp(api, "SC853") == 0)
|
else if (strcmp(api, "SC853") == 0)
|
||||||
{//创建数组
|
{//创建数组
|
||||||
cJSON *Dev = cJSON_CreateArray();
|
/* cJSON *Dev = cJSON_CreateArray();
|
||||||
for (int i = 0; i < DATA_TABLE_SIZE; i++) {
|
for (int i = 0; i < DATA_TABLE_SIZE; i++) {
|
||||||
cJSON* item = cJSON_CreateObject();
|
cJSON* item = cJSON_CreateObject();
|
||||||
// 添加 IO 编号
|
// 添加 IO 编号
|
||||||
@@ -497,7 +497,7 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
// 将当前项添加到数组中
|
// 将当前项添加到数组中
|
||||||
cJSON_AddItemToArray(Dev, item);
|
cJSON_AddItemToArray(Dev, item);
|
||||||
}
|
}
|
||||||
cJSON_AddItemToObject(dat,"M",Dev);
|
cJSON_AddItemToObject(dat,"M",Dev);*/
|
||||||
}
|
}
|
||||||
else if (strcmp(api, "SC854") == 0) {
|
else if (strcmp(api, "SC854") == 0) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "SC828_DATA_table.h"
|
#include "SC828_DATA_table.h"
|
||||||
#include <rtthread.h>
|
|
||||||
#include "Variable.h"
|
#include "Variable.h"
|
||||||
|
|
||||||
// 系统数据状态表(表格)
|
// 系统数据状态表(表格)
|
||||||
@@ -19,7 +18,7 @@ IO_State_DATA data_table[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// DIO状态表(表格)
|
// DIO状态表(表格)
|
||||||
IO_State_DIO dio_table[] = {
|
IO_State_DIO di_table[] = {
|
||||||
{2001, 0, STR_EMERGENCY_STOP},
|
{2001, 0, STR_EMERGENCY_STOP},
|
||||||
{2002, 0, STR_TEMP_LOCK},
|
{2002, 0, STR_TEMP_LOCK},
|
||||||
{2003, 0, STR_PRESSURE_LOCK},
|
{2003, 0, STR_PRESSURE_LOCK},
|
||||||
@@ -102,8 +101,10 @@ IO_State_DIO dio_table[] = {
|
|||||||
{2080, 0, STR_MATERIAL3_FILL},
|
{2080, 0, STR_MATERIAL3_FILL},
|
||||||
{2081, 0, STR_MATERIAL3_HEAT},
|
{2081, 0, STR_MATERIAL3_HEAT},
|
||||||
{2082, 0, STR_MATERIAL3_STIR},
|
{2082, 0, STR_MATERIAL3_STIR},
|
||||||
|
};
|
||||||
// --- DIO 输出(3001~3066)---
|
// --- DIO 输出(3001~3066)---
|
||||||
{3001, 0, STR_RED}, // 红
|
IO_State_DIO do_table[] = {
|
||||||
|
{3001, 1, STR_RED}, // 红
|
||||||
{3002, 0, STR_GREEN}, // 绿
|
{3002, 0, STR_GREEN}, // 绿
|
||||||
{3003, 0, STR_YELLOW}, // 黄
|
{3003, 0, STR_YELLOW}, // 黄
|
||||||
{3004, 0, STR_ALARM}, // 警报
|
{3004, 0, STR_ALARM}, // 警报
|
||||||
@@ -215,15 +216,21 @@ IO_State_AIO aio_table[] = {
|
|||||||
//步骤数据表最大99
|
//步骤数据表最大99
|
||||||
IO_STEP_DATA step_table[99];
|
IO_STEP_DATA step_table[99];
|
||||||
|
|
||||||
const unsigned char DIO_TABLE_SIZE = sizeof(dio_table) / sizeof(dio_table[0]);
|
const unsigned char DI_TABLE_SIZE = sizeof(di_table) / sizeof(di_table[0]);
|
||||||
|
const unsigned char DO_TABLE_SIZE = sizeof(do_table) / sizeof(do_table[0]);
|
||||||
const unsigned char AIO_TABLE_SIZE = sizeof(aio_table) / sizeof(aio_table[0]);
|
const unsigned char AIO_TABLE_SIZE = sizeof(aio_table) / sizeof(aio_table[0]);
|
||||||
const unsigned char DATA_TABLE_SIZE = sizeof(data_table) / sizeof(data_table[0]);
|
const unsigned char DATA_TABLE_SIZE = sizeof(data_table) / sizeof(data_table[0]);
|
||||||
|
|
||||||
void DATA_Table_Init(){
|
void DATA_Table_Init(){
|
||||||
for(int i=0;i<DIO_TABLE_SIZE;i++)
|
for(int i=0;i<DI_TABLE_SIZE;i++)
|
||||||
{
|
{
|
||||||
dio_table[i].current_state = 0;
|
di_table[i].current_state = 0;
|
||||||
}
|
}
|
||||||
|
for(int i=0;i<DO_TABLE_SIZE;i++)
|
||||||
|
{
|
||||||
|
do_table[i].current_state = 0;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i=0;i<AIO_TABLE_SIZE;i++)
|
for(int i=0;i<AIO_TABLE_SIZE;i++)
|
||||||
{
|
{
|
||||||
aio_table[i].current_Value = 0;
|
aio_table[i].current_Value = 0;
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
#ifndef APPLICATIONS_SC828_DATA_Table_H
|
#ifndef APPLICATIONS_SC828_DATA_Table_H
|
||||||
#define APPLICATIONS_SC828_DATA_Table_H
|
#define APPLICATIONS_SC828_DATA_Table_H
|
||||||
|
|
||||||
|
#include <rtthread.h>
|
||||||
#include "stdbool.h"
|
#include "stdbool.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
|
||||||
// IO状态结构体(可扩展)
|
// IO状态结构体(可扩展)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int pin; // PLCID
|
int pin; // PLCID
|
||||||
unsigned char current_state; // 当前电平:0=低,1=高
|
rt_bool_t current_state; // 当前电平:0=低,1=高
|
||||||
str_id_t name; // 名称(可选,用于调试)
|
str_id_t name; // 名称(可选,用于调试)
|
||||||
} IO_State_DIO;
|
} IO_State_DIO;
|
||||||
|
|
||||||
@@ -51,12 +52,14 @@ typedef struct {
|
|||||||
double Parameter5_S3;
|
double Parameter5_S3;
|
||||||
} IO_STEP_DATA;
|
} IO_STEP_DATA;
|
||||||
|
|
||||||
extern IO_State_DIO dio_table[];
|
extern IO_State_DIO di_table[];
|
||||||
|
extern IO_State_DIO do_table[];
|
||||||
extern IO_State_AIO aio_table[];
|
extern IO_State_AIO aio_table[];
|
||||||
extern IO_State_DATA data_table[];
|
extern IO_State_DATA data_table[];
|
||||||
extern IO_STEP_DATA step_table[99];
|
extern IO_STEP_DATA step_table[99];
|
||||||
|
|
||||||
extern const unsigned char DIO_TABLE_SIZE;
|
extern const unsigned char DI_TABLE_SIZE;
|
||||||
|
extern const unsigned char DO_TABLE_SIZE;
|
||||||
extern const unsigned char AIO_TABLE_SIZE;
|
extern const unsigned char AIO_TABLE_SIZE;
|
||||||
extern const unsigned char DATA_TABLE_SIZE;
|
extern const unsigned char DATA_TABLE_SIZE;
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
rt_int32_t sys_temperature;//主机环境温度
|
rt_int32_t sys_temperature;//主机环境温度
|
||||||
rt_int32_t sys_humidity;//主机环境湿度
|
rt_int32_t sys_humidity;//主机环境湿度
|
||||||
char sys_var[8];//主机版本0.0.00A
|
char sys_var[8];//主机版本0.0.00A
|
||||||
unsigned char sys_time[6];//系统时间
|
char sys_time[9]="00:00:00";//系统时间
|
||||||
unsigned int sys_run_time;//运行时间
|
unsigned int sys_run_time=0;//运行时间
|
||||||
int pow_bat;//电池电压
|
int pow_bat;//电池电压
|
||||||
int pow_code;//主电压
|
int pow_code;//主电压
|
||||||
int pow_dev1;//设备电压.通讯
|
int pow_dev1;//设备电压.通讯
|
||||||
@@ -28,7 +28,7 @@ char MACHINE_CALL = 0;
|
|||||||
char MACHINE_USER = 0;
|
char MACHINE_USER = 0;
|
||||||
|
|
||||||
// 字符串变量(RAM 中可修改)
|
// 字符串变量(RAM 中可修改)
|
||||||
char Work[25];
|
char Work[25]="SC----------";
|
||||||
char Dye[25];
|
char Dye[25];
|
||||||
char Process[50];
|
char Process[50];
|
||||||
char Message[40];
|
char Message[40];
|
||||||
@@ -42,25 +42,25 @@ unsigned int RUN = 0;
|
|||||||
unsigned int STEPID = 0;
|
unsigned int STEPID = 0;
|
||||||
|
|
||||||
// 浮点变量
|
// 浮点变量
|
||||||
float MTT = 0.0f;
|
float MTT = 0.0f;//主缸温度
|
||||||
float MTL = 0.0f;
|
float MTL = 0.0f;//主缸水位
|
||||||
float MTH = 6.0f; // 默认目标温度
|
float MTH = 6.0f;//主缸ph
|
||||||
float MST = 0.0f;
|
float MST = 0.0f;//目标温度
|
||||||
float MUT = 0.0f;
|
float MUT = 0.0f;//主缸温度2
|
||||||
float STTA = 0.0f;
|
float STTA = 0.0f;//料a温度
|
||||||
float STLA = 0.0f;
|
float STLA = 0.0f;//料a水位
|
||||||
float STTB = 0.0f;
|
float STTB = 0.0f;//料b温度
|
||||||
float STLB = 0.0f;
|
float STLB = 0.0f;//料b水位
|
||||||
float STTC = 0.0f;
|
float STTC = 0.0f;//料c温度
|
||||||
float STLC = 0.0f;
|
float STLC = 0.0f;//料c水位
|
||||||
|
|
||||||
// 控制输出
|
// 控制输出
|
||||||
unsigned int Pump = 0;
|
unsigned int Pump = 0;//主泵
|
||||||
unsigned int TC = 0;
|
unsigned int TC = 0;//温度比例
|
||||||
unsigned int Fan = 0;
|
unsigned int Fan = 0;//风机
|
||||||
unsigned int Pull = 0;
|
unsigned int Pull = 0;//提布
|
||||||
unsigned int Swing = 0;
|
unsigned int Swing = 0;//摆布
|
||||||
unsigned int STA = 0;
|
unsigned int STA = 0;//料a比例
|
||||||
unsigned int STB = 0;
|
unsigned int STB = 0;
|
||||||
unsigned int STC = 0;
|
unsigned int STC = 0;
|
||||||
unsigned int Time = 0;
|
unsigned int Time = 0;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
extern rt_int32_t sys_temperature;//主机环境温度
|
extern rt_int32_t sys_temperature;//主机环境温度
|
||||||
extern rt_int32_t sys_humidity;//主机环境湿度
|
extern rt_int32_t sys_humidity;//主机环境湿度
|
||||||
extern char sys_var[8];//主机版本0.0.00A
|
extern char sys_var[8];//主机版本0.0.00A
|
||||||
extern unsigned char sys_time[6];//系统时间
|
extern char sys_time[9];//系统时间
|
||||||
extern unsigned int sys_run_time;//运行时间
|
extern unsigned int sys_run_time;//运行时间
|
||||||
extern int pow_bat;//电池电压
|
extern int pow_bat;//电池电压
|
||||||
extern int pow_code;//主电压
|
extern int pow_code;//主电压
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*********************/
|
*********************/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
#include "custom.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
#include "gui_guider.h"
|
||||||
|
|
||||||
#if LV_USE_GUIDER_SIMULATOR && LV_USE_FREEMASTER
|
#if LV_USE_GUIDER_SIMULATOR && LV_USE_FREEMASTER
|
||||||
#include "freemaster_client.h"
|
#include "freemaster_client.h"
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "gui_guider.h"
|
||||||
|
#include "widgets_init.h"
|
||||||
|
|
||||||
#if LV_USE_GUIDER_SIMULATOR && LV_USE_FREEMASTER
|
#if LV_USE_GUIDER_SIMULATOR && LV_USE_FREEMASTER
|
||||||
#include "gg_external_data.h"
|
#include "gg_external_data.h"
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "widgets_init.h"
|
||||||
|
#include "gui_guider.h"
|
||||||
|
|
||||||
void setup_scr_screen(lv_ui *ui)
|
void setup_scr_screen(lv_ui *ui)
|
||||||
{
|
{
|
||||||
@@ -138,7 +140,7 @@ void setup_scr_screen(lv_ui *ui)
|
|||||||
lv_label_set_text(ui->screen_temp, "120.5");
|
lv_label_set_text(ui->screen_temp, "120.5");
|
||||||
lv_label_set_long_mode(ui->screen_temp, LV_LABEL_LONG_CLIP);
|
lv_label_set_long_mode(ui->screen_temp, LV_LABEL_LONG_CLIP);
|
||||||
lv_obj_set_pos(ui->screen_temp, 50, 10);
|
lv_obj_set_pos(ui->screen_temp, 50, 10);
|
||||||
lv_obj_set_size(ui->screen_temp, 70, 25);
|
lv_obj_set_size(ui->screen_temp, 75, 25);
|
||||||
|
|
||||||
//Write style for screen_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
//Write style for screen_temp, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||||||
lv_obj_set_style_border_width(ui->screen_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_border_width(ui->screen_temp, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
@@ -190,7 +192,7 @@ void setup_scr_screen(lv_ui *ui)
|
|||||||
lv_obj_set_style_border_width(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_border_width(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_radius(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_radius(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_color(ui->screen_order, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_text_color(ui->screen_order, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_font(ui->screen_order, &lv_font_simsun_32, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_text_font(ui->screen_order, &lv_font_simsun_30, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_opa(ui->screen_order, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_text_opa(ui->screen_order, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_letter_space(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_text_letter_space(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_text_line_space(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
lv_obj_set_style_text_line_space(ui->screen_order, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||||
@@ -5805,7 +5807,7 @@ void setup_scr_screen(lv_ui *ui)
|
|||||||
lv_textarea_set_accepted_chars(ui->screen_pname_set, "");
|
lv_textarea_set_accepted_chars(ui->screen_pname_set, "");
|
||||||
lv_textarea_set_max_length(ui->screen_pname_set, 32);
|
lv_textarea_set_max_length(ui->screen_pname_set, 32);
|
||||||
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
|
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
|
||||||
// lv_obj_add_event_cb(ui->screen_pname_set, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
|
lv_obj_add_event_cb(ui->screen_pname_set, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_set_pos(ui->screen_pname_set, 305, -1);
|
lv_obj_set_pos(ui->screen_pname_set, 305, -1);
|
||||||
lv_obj_set_size(ui->screen_pname_set, 679, 50);
|
lv_obj_set_size(ui->screen_pname_set, 679, 50);
|
||||||
@@ -5965,7 +5967,7 @@ void setup_scr_screen(lv_ui *ui)
|
|||||||
lv_textarea_set_accepted_chars(ui->screen_machine_name, "");
|
lv_textarea_set_accepted_chars(ui->screen_machine_name, "");
|
||||||
lv_textarea_set_max_length(ui->screen_machine_name, 32);
|
lv_textarea_set_max_length(ui->screen_machine_name, 32);
|
||||||
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
|
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
|
||||||
//lv_obj_add_event_cb(ui->screen_machine_name, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
|
lv_obj_add_event_cb(ui->screen_machine_name, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_set_pos(ui->screen_machine_name, 150, 70);
|
lv_obj_set_pos(ui->screen_machine_name, 150, 70);
|
||||||
lv_obj_set_size(ui->screen_machine_name, 200, 50);
|
lv_obj_set_size(ui->screen_machine_name, 200, 50);
|
||||||
@@ -6051,7 +6053,7 @@ void setup_scr_screen(lv_ui *ui)
|
|||||||
lv_textarea_set_accepted_chars(ui->screen_machine_id, "");
|
lv_textarea_set_accepted_chars(ui->screen_machine_id, "");
|
||||||
lv_textarea_set_max_length(ui->screen_machine_id, 32);
|
lv_textarea_set_max_length(ui->screen_machine_id, 32);
|
||||||
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
|
#if LV_USE_KEYBOARD != 0 || LV_USE_ZH_KEYBOARD != 0
|
||||||
//lv_obj_add_event_cb(ui->screen_machine_id, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
|
lv_obj_add_event_cb(ui->screen_machine_id, ta_event_cb, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
#endif
|
#endif
|
||||||
lv_obj_set_pos(ui->screen_machine_id, 150, 10);
|
lv_obj_set_pos(ui->screen_machine_id, 150, 10);
|
||||||
lv_obj_set_size(ui->screen_machine_id, 200, 50);
|
lv_obj_set_size(ui->screen_machine_id, 200, 50);
|
||||||
|
|||||||
@@ -9,12 +9,16 @@
|
|||||||
*/
|
*/
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include <rtdevice.h>
|
#include <rtdevice.h>
|
||||||
|
#include <applications/data/Variable.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <string.h>
|
||||||
#include <guider/custom/custom.h>
|
#include <guider/custom/custom.h>
|
||||||
#include <guider/generated/events_init.h>
|
#include <guider/generated/events_init.h>
|
||||||
#include <guider/generated/gui_guider.h>
|
#include <guider/generated/gui_guider.h>
|
||||||
|
#include <guider/generated/widgets_init.h>
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
//#include "lv_demo_widgets.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define DBG_TAG "gui"
|
#define DBG_TAG "gui"
|
||||||
@@ -24,11 +28,54 @@
|
|||||||
#define LCD_BL_PIN GET_PIN(D,12)
|
#define LCD_BL_PIN GET_PIN(D,12)
|
||||||
#define LCD_RST_PIN GET_PIN(D,11)
|
#define LCD_RST_PIN GET_PIN(D,11)
|
||||||
|
|
||||||
|
|
||||||
|
void setup_user_screen(lv_ui *ui)
|
||||||
|
{
|
||||||
|
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
|
||||||
|
lv_textarea_set_text(ui->screen_machine_id, machine_ID);//设备id
|
||||||
|
lv_textarea_set_text(ui->screen_machine_name, machine_name);//设备名
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
time_t nows;
|
||||||
|
char time_str[9]; //"0000:00\0"
|
||||||
|
char temp_str[6]; //"120.5"
|
||||||
|
char wter_str[6]; //"120.5"
|
||||||
|
void setup_s_screen(lv_ui *ui)
|
||||||
|
{
|
||||||
|
//系统时间
|
||||||
|
time(&nows);
|
||||||
|
struct tm *t = localtime(&nows);
|
||||||
|
snprintf(sys_time, sizeof(sys_time), "%02d:%02d:%02d", t->tm_hour, t->tm_min, t->tm_sec);
|
||||||
|
lv_label_set_text(ui->screen_SYS_TIME, (const char *)sys_time);//系统时间
|
||||||
|
//运行时间
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wformat-truncation"
|
||||||
|
snprintf(time_str, sizeof(time_str), "%04d:%02d", sys_run_time / 60, sys_run_time % 60);
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
lv_label_set_text(ui->screen_RUN_TIME, (const char *)time_str);//显示运行时间
|
||||||
|
//工单
|
||||||
|
lv_label_set_text(ui->screen_order, (const char *)Work);
|
||||||
|
//水位
|
||||||
|
snprintf(wter_str, sizeof(wter_str), "%04.0f", MTL);
|
||||||
|
lv_label_set_text(ui->screen_water, (const char *)wter_str);
|
||||||
|
//温度
|
||||||
|
snprintf(temp_str, sizeof(temp_str), "%05.1f", MTT);
|
||||||
|
lv_label_set_text(ui->screen_temp, (const char *)temp_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void time_update_timer_cb(lv_timer_t * timer)
|
||||||
|
{
|
||||||
|
setup_s_screen(&guider_ui);
|
||||||
|
}
|
||||||
|
|
||||||
void lv_user_gui_init(void)
|
void lv_user_gui_init(void)
|
||||||
{
|
{
|
||||||
//gui_guider_setup();
|
|
||||||
//lv_demo_widgets();
|
|
||||||
setup_ui(&guider_ui);
|
setup_ui(&guider_ui);
|
||||||
events_init(&guider_ui);
|
events_init(&guider_ui);
|
||||||
custom_init(&guider_ui);
|
custom_init(&guider_ui);
|
||||||
|
setup_user_screen(&guider_ui);
|
||||||
|
|
||||||
|
// 创建一个每 500ms 触发一次的定时器
|
||||||
|
lv_timer_create(time_update_timer_cb, 500, NULL);
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ static int lvgl_thread_init(void)
|
|||||||
rt_err_t err;
|
rt_err_t err;
|
||||||
|
|
||||||
err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL,
|
err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL,
|
||||||
&lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 10);
|
&lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 20);
|
||||||
if(err != RT_EOK)
|
if(err != RT_EOK)
|
||||||
{
|
{
|
||||||
LOG_E("Failed to create LVGL thread");
|
LOG_E("Failed to create LVGL thread");
|
||||||
|
|||||||
+2
-2
@@ -263,9 +263,9 @@
|
|||||||
/* LVGL: powerful and easy-to-use embedded GUI library */
|
/* LVGL: powerful and easy-to-use embedded GUI library */
|
||||||
|
|
||||||
#define PKG_USING_LVGL
|
#define PKG_USING_LVGL
|
||||||
#define PKG_LVGL_THREAD_PRIO 15
|
#define PKG_LVGL_THREAD_PRIO 25
|
||||||
#define PKG_LVGL_THREAD_STACK_SIZE 4096
|
#define PKG_LVGL_THREAD_STACK_SIZE 4096
|
||||||
#define PKG_LVGL_DISP_REFR_PERIOD 20
|
#define PKG_LVGL_DISP_REFR_PERIOD 50
|
||||||
#define PKG_LVGL_USING_V080310
|
#define PKG_LVGL_USING_V080310
|
||||||
#define PKG_LVGL_VER_NUM 0x080310
|
#define PKG_LVGL_VER_NUM 0x080310
|
||||||
/* end of LVGL: powerful and easy-to-use embedded GUI library */
|
/* end of LVGL: powerful and easy-to-use embedded GUI library */
|
||||||
|
|||||||
Reference in new issue
Block a user