From a162027584ae008b18abeb808245b20cb87fecad Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 23 May 2024 17:37:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B0=B4=E6=B5=B8=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .settings/language.settings.xml | 4 +- .vscode/c_cpp_properties.json | 94 ++++----------------- Core/Src/usart.c | 2 +- little_disinfection_liquid_path_control Debug.cfg | 44 ---------- ...e_disinfection_liquid_path_control Debug.launch | 96 ---------------------- little_disinfection_liquid_path_control.ioc | 3 +- little_disinfection_liquid_path_control.launch | 14 ++-- sdk | 2 +- transmit_disinfection_protocol_v1 | 2 +- usrc/hardware.cpp | 25 +++--- usrc/main.cpp | 8 +- usrc/main.hpp | 3 +- 12 files changed, 47 insertions(+), 250 deletions(-) delete mode 100644 little_disinfection_liquid_path_control Debug.cfg delete mode 100644 little_disinfection_liquid_path_control Debug.launch diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 34e6a9d..79984cc 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 6a8db16..9ac4c07 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,88 +3,28 @@ { "name": "app", "includePath": [ - "Drivers/STM32F4xx_HAL_Driver/Inc", - "Drivers/CMSIS/Include", - "./", "./Core/Inc", - "Drivers/CMSIS/Device/ST/STM32F4xx/Include/" + "./Drivers/STM32F4xx_HAL_Driver/Inc", + "./Drivers/STM32F4xx_HAL_Driver/Inc/Legacy", + "./Middlewares/Third_Party/FreeRTOS/Source/include", + "./Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS", + "./Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F", + "./Drivers/CMSIS/Device/ST/STM32F4xx/Include", + "./Drivers/CMSIS/Include", + "C:/ST/STM32CubeIDE_1.13.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/arm-none-eabi/include", + "./usrc/", + "Middlewares/Third_Party/LwIP/src/include/", + "LWIP/Target/", + "LWIP/App/", + "Middlewares/Third_Party/LwIP/system/", + "./" ], "defines": [ + "DEBUG", "USE_HAL_DRIVER", - "STM32F407xx", - "__CC_ARM", - "__arm__", - "__align(x)=", - "__ALIGNOF__(x)=", - "__alignof__(x)=", - "__asm(x)=", - "__forceinline=", - "__restrict=", - "__global_reg(n)=", - "__inline=", - "__int64=long long", - "__INTADDR__(expr)=0", - "__irq=", - "__packed=", - "__pure=", - "__smc(n)=", - "__svc(n)=", - "__svc_indirect(n)=", - "__svc_indirect_r7(n)=", - "__value_in_regs=", - "__weak=", - "__writeonly=", - "__declspec(x)=", - "__attribute__(x)=", - "__nonnull__(x)=", - "__register=", - "__breakpoint(x)=", - "__cdp(x,y,z)=", - "__clrex()=", - "__clz(x)=0U", - "__current_pc()=0U", - "__current_sp()=0U", - "__disable_fiq()=", - "__disable_irq()=", - "__dmb(x)=", - "__dsb(x)=", - "__enable_fiq()=", - "__enable_irq()=", - "__fabs(x)=0.0", - "__fabsf(x)=0.0f", - "__force_loads()=", - "__force_stores()=", - "__isb(x)=", - "__ldrex(x)=0U", - "__ldrexd(x)=0U", - "__ldrt(x)=0U", - "__memory_changed()=", - "__nop()=", - "__pld(...)=", - "__pli(...)=", - "__qadd(x,y)=0", - "__qdbl(x)=0", - "__qsub(x,y)=0", - "__rbit(x)=0U", - "__rev(x)=0U", - "__return_address()=0U", - "__ror(x,y)=0U", - "__schedule_barrier()=", - "__semihost(x,y)=0", - "__sev()=", - "__sqrt(x)=0.0", - "__sqrtf(x)=0.0f", - "__ssat(x,y)=0", - "__strex(x,y)=0U", - "__strexd(x,y)=0", - "__strt(x,y)=", - "__swp(x,y)=0U", - "__usat(x,y)=0U", - "__wfe()=", - "__wfi()=", - "__yield()=", - "__vfp_status(x,y)=0" + "STM32F407xx" ], + "compilerPath": "C:/ST/STM32CubeIDE_1.13.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/bin/arm-none-eabi-g++.exe", "intelliSenseMode": "${default}" } ], diff --git a/Core/Src/usart.c b/Core/Src/usart.c index d606e3c..533b0d1 100644 --- a/Core/Src/usart.c +++ b/Core/Src/usart.c @@ -41,7 +41,7 @@ void MX_USART1_UART_Init(void) /* USER CODE END USART1_Init 1 */ huart1.Instance = USART1; - huart1.Init.BaudRate = 115200; + huart1.Init.BaudRate = 460800; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; diff --git a/little_disinfection_liquid_path_control Debug.cfg b/little_disinfection_liquid_path_control Debug.cfg deleted file mode 100644 index ef37116..0000000 --- a/little_disinfection_liquid_path_control Debug.cfg +++ /dev/null @@ -1,44 +0,0 @@ -# This is an genericBoard board with a single STM32F407VETx chip -# -# Generated by STM32CubeIDE -# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s) - -source [find interface/stlink-dap.cfg] - - -set WORKAREASIZE 0x8000 - -transport select "dapdirect_swd" - -set CHIPNAME STM32F407VETx -set BOARDNAME genericBoard - -# Enable debug when in low power modes -set ENABLE_LOW_POWER 1 - -# Stop Watchdog counters when halt -set STOP_WATCHDOG 1 - -# STlink Debug clock frequency -set CLOCK_FREQ 8000 - -# Reset configuration -# use hardware reset, connect under reset -# connect_assert_srst needed if low power mode application running (WFI...) -reset_config srst_only srst_nogate connect_assert_srst -set CONNECT_UNDER_RESET 1 -set CORE_RESET 0 - -# ACCESS PORT NUMBER -set AP_NUM 0 -# GDB PORT -set GDB_PORT 3333 - - - - - -# BCTM CPU variables - -source [find target/stm32f4x.cfg] - diff --git a/little_disinfection_liquid_path_control Debug.launch b/little_disinfection_liquid_path_control Debug.launch deleted file mode 100644 index f5a5e19..0000000 --- a/little_disinfection_liquid_path_control Debug.launch +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/little_disinfection_liquid_path_control.ioc b/little_disinfection_liquid_path_control.ioc index 116970b..153eea2 100644 --- a/little_disinfection_liquid_path_control.ioc +++ b/little_disinfection_liquid_path_control.ioc @@ -219,7 +219,8 @@ TIM6.IPParameters=Prescaler TIM6.Prescaler=71 TIM7.IPParameters=Prescaler TIM7.Prescaler=81 -USART1.IPParameters=VirtualMode +USART1.BaudRate=460800 +USART1.IPParameters=VirtualMode,BaudRate USART1.VirtualMode=VM_ASYNC USART2.IPParameters=VirtualMode USART2.VirtualMode=VM_ASYNC diff --git a/little_disinfection_liquid_path_control.launch b/little_disinfection_liquid_path_control.launch index 71cb833..970bc56 100644 --- a/little_disinfection_liquid_path_control.launch +++ b/little_disinfection_liquid_path_control.launch @@ -5,7 +5,7 @@ - + @@ -20,10 +20,11 @@ - - + + + @@ -46,7 +47,7 @@ - + @@ -54,6 +55,7 @@ + @@ -64,9 +66,9 @@ - + - + diff --git a/sdk b/sdk index f6f7900..b20f4cc 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit f6f7900b876e6a4a6b2c5ebe6bd26b5f1b1fbe0a +Subproject commit b20f4cc2e42244d6dd21566dd1a4b1a48ddc64a9 diff --git a/transmit_disinfection_protocol_v1 b/transmit_disinfection_protocol_v1 index e6635f8..c39bd36 160000 --- a/transmit_disinfection_protocol_v1 +++ b/transmit_disinfection_protocol_v1 @@ -1 +1 @@ -Subproject commit e6635f820ca96611424e10c2b79b4014e28d3c7e +Subproject commit c39bd364d809a9a6ad965c83fd3ea28c67514317 diff --git a/usrc/hardware.cpp b/usrc/hardware.cpp index d87a237..f04e190 100644 --- a/usrc/hardware.cpp +++ b/usrc/hardware.cpp @@ -2,16 +2,14 @@ #include #include +#include #include "main.h" #include "project.hpp" // // #include "sdk/components/single_axis_motor_control_v2/single_axis_motor_control_v2.hpp" -#include "sdk/components/iflytop_can_slave_modules/idcard_reader_service.hpp" -#include "sdk/components/single_axis_motor_control/single_axis_motor_control.hpp" + #include "sdk/hal/zhal.hpp" -#include "sdk\components\iflytop_can_slave_modules\io_control_service.hpp" -#include "sdk\components\iflytop_can_slave_v1\iflytop_can_slave.hpp" #include "sdk\components\m3078\m3078_code_scaner.hpp" #include "sdk\components\tmc\ic\ztmc4361A.hpp" #include "sdk\components\tmc\ic\ztmc5130.hpp" @@ -131,6 +129,8 @@ int32_t Hardware::process_rx_packet(from_where_t fromwhere, uint8_t *packet, int Cmdheader_t *cmdheader = (Cmdheader_t *)packet; if (fromwhere == kuart) printf("rx: cmdid:%d subcmdid:%d id:%d\n", cmdheader->cmdid, cmdheader->subcmdid, cmdheader->data[0]); + // printf("rx: cmdid:%d subcmdid:%d id:%d\n", cmdheader->cmdid, cmdheader->subcmdid, cmdheader->data[0]); + /** * @brief Ping */ @@ -140,20 +140,17 @@ int32_t Hardware::process_rx_packet(from_where_t fromwhere, uint8_t *packet, int return 0; } - /** - * @brief 获取蒸发仓水浸状态 - */ - PROCESS_CMD(kcmd_proportional_read_water_immersion_sensor, 0, 0) { - ((int32_t *)receipt)[0] = !IO_PC7_IN.getState(); + if ((cmdheader->cmdid == (uint16_t)kcmd_read_evaporation_bin_water_detection)) { + matching = true; + + ((int32_t *)receipt)[0] = IO_PC7_IN.getState(); // 高有效 receiptsize = 4; return 0; } - /** - * @brief 获取设备底盘水浸传感器 - */ - PROCESS_CMD(kcmd_proportional_read_water_immersion_sensor, 0, 1) { - ((int32_t *)receipt)[0] = !IO_PD13_IN.getState(); + if ((cmdheader->cmdid == (uint16_t)kcmd_read_device_bottom_water_detection_sensor)) { + matching = true; + ((int32_t *)receipt)[0] = !IO_PD13_IN.getState(); // 低有效 receiptsize = 4; return 0; } diff --git a/usrc/main.cpp b/usrc/main.cpp index 41c5549..73b659e 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -2,16 +2,15 @@ #include #include +#include #include "main.h" #include "project.hpp" // // #include "sdk/components/single_axis_motor_control_v2/single_axis_motor_control_v2.hpp" -#include "sdk/components/iflytop_can_slave_modules/idcard_reader_service.hpp" -#include "sdk/components/single_axis_motor_control/single_axis_motor_control.hpp" + #include "sdk/hal/zhal.hpp" -#include "sdk\components\iflytop_can_slave_modules\io_control_service.hpp" -#include "sdk\components\iflytop_can_slave_v1\iflytop_can_slave.hpp" + #include "sdk\components\m3078\m3078_code_scaner.hpp" #include "sdk\components\tmc\ic\ztmc4361A.hpp" #include "sdk\components\tmc\ic\ztmc5130.hpp" @@ -42,7 +41,6 @@ void dumphexdata(uint8_t *data, int32_t len) { * GLOBAL * *******************************************************************************/ -IflytopCanProtocolStackProcesser m_protocolStack; Hardware m_hardware; ZGPIO debuglight; ZCanReceiver m_canReceiver; diff --git a/usrc/main.hpp b/usrc/main.hpp index 5767d46..0f39f0e 100644 --- a/usrc/main.hpp +++ b/usrc/main.hpp @@ -4,8 +4,7 @@ #include -#include "sdk\components\iflytop_can_slave_modules\device_base_control_service.hpp" -#include "sdk\components\iflytop_can_slave_v1\iflytop_can_slave.hpp" + #include "sdk\components\zcanreceiver\zcanreceiver.hpp" namespace iflytop { using namespace std;