Qt TCP通信实战:从粘包处理到断线重连的完整方案
2026/10/17 4:20:49
- Mac M1
- STC89C52RC
# homebrew/bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"# vscodebrewinstall--caskvisual-studio-code# Pythonbrewinstallpython3# USB转串口https://www.wch.cn/downloads/CH341SER_MAC_ZIP.html](https://www.wch.cn/downloads/CH341SER_MAC_ZIP.html# sdccbrewinstallsdcc sdcc-v# stcgalpip3installstcgal插件
C/C++ Extension Packc_cpp_properties.json
{"configurations":[{"name":"SDCC 8051 Mac","intelliSenseMode":"macos-clang-x64","compilerPath":"/opt/homebrew/bin/sdcc","cStandard":"c11","includePath":["${workspaceFolder}/**","/opt/homebrew/share/sdcc/include","/opt/homebrew/share/sdcc/include/mcs51"],"defines":["__SDCC","__MCS51__"]}],"version":4}sdcc头文件
#include<mcs51/8052.h># 编译为 .ihx 文件sdcc main.c# sdcc -mmcs51 file1.c file2.c file3.c main.c# 查询串口 | 例:/dev/tty.wchusbserial210ls/dev/tty.wch*# 烧录 | -P 指定芯片系列 -p 指定串口sudostcgal-Pstc89-p/dev/tty.wchusbserial210 main.ihx