feat(can): 添加跨通道CAN突发发送功能支持多电机同步驱动

- 新增 /can/send_burst HTTP接口,支持一次SPI事务批量发送多帧CAN消息
- 实现canFdSendBurst函数,通过0xC7 SPI类型实现背靠背装载各通道邮箱
- 添加canBurstCapacity函数计算单次突发最大帧数限制
- 突发发送期间暂停can_feedback_task避免SPI抢占冲突

refactor(can_feedback_task): 改造为周期查询+事件消费模式

- 0xC4/0xC5从GD32主动推送改为ESP32周期查询(250ms/1s)
- 0xC6/0xD2仍保留事件驱动推送模式,由任务消费处理
- 消除OTA期间GD32悬空按铃导致的超时刷屏问题
- 电机OTA期间也暂停任务避免与0xD1抢夺SPI资源

perf(ota_relay): 增加重发次数上限提升传输可靠性

- 将kMaxDataSends从3次增加到5次,提高数据包传输成功率

chore(version): 更新固件版本号至0.3.78

- 版本查询checkVersionWait移到tickInFlight释放后异步触发
- 避免/motor/version请求拖长tick导致tickStuck误报通道闪黄
This commit is contained in:
小龙虾
2026-08-10 00:54:12 +08:00
parent f9cbcc396b
commit ef6d3a4be3
23 changed files with 2524 additions and 157 deletions
+217 -3
View File
@@ -699,9 +699,223 @@ code { color: var(--esp32-hi); font-family: var(--font-mono); }
border-bottom: 1px solid rgba(255,255,255,.04);
}
.heap-low-table th { color: var(--text-dim); font-weight: 500; position: sticky; top: 0; background: var(--bg-elevated); text-align: right; }
.heap-low-table td:nth-child(5), .heap-low-table td:nth-child(6),
.heap-low-table td:nth-child(7), .heap-low-table td:nth-child(9) { text-align: left; }
.heap-low-table td:first-child { color: var(--text-dim); }
.ble-low-table td:nth-child(5), .ble-low-table td:nth-child(6),
.ble-low-table td:nth-child(7), .ble-low-table td:nth-child(9) { text-align: left; }
.ble-low-table td:first-child { color: var(--text-dim); }
/* ================= BLE 连接按钮(launch 风格) =================
圆形物理按键:未连接=暗淡待机;勾选=已连接,蓝光环绕 + 文字波浪动画。
checkbox 隐藏,由 JS setConnectionState 驱动 checked,避免异步连接失败导致状态错位。 */
.ble-launch-wrap {
display: flex; flex-direction: column; align-items: center;
gap: 12px; padding: 6px 0 2px;
}
.ble-launch-btn {
cursor: pointer; position: relative;
display: flex; flex-direction: column; align-items: center;
margin: 0;
}
.ble-launch-btn input {
opacity: 0; width: 0; height: 0; display: none;
}
/* —— 三态:idle 待机 / connecting 连接中转圈 / connected 已连接变亮 —— */
/* 默认 text3 隐藏 */
.ble-launch-btn .back .mid .ble-dial .center .start .text3 {
opacity: 0;
}
/* connecting:仅光晕转圈(loading),按钮整体保持暗淡 */
.ble-launch-btn[data-ble-state="connecting"] .back .spot-shadow,
.ble-launch-btn[data-ble-state="connecting"] .back .mid .spot-main,
.ble-launch-btn[data-ble-state="connecting"] .back .mid .ble-dial .spot-light {
opacity: 0.7;
animation: ble-spot-rot 1.4s linear infinite;
}
.ble-launch-btn[data-ble-state="connecting"] .back .mid .ble-dial .center .start .text1 {
opacity: 0;
}
.ble-launch-btn[data-ble-state="connecting"] .back .mid .ble-dial .center .start .text3 {
opacity: 1;
color: #9bb8d8;
animation: ble-text-pulse 1.2s ease-in-out infinite;
}
/* connected:整个按钮变亮 + 静态整圈蓝光晕(不转圈)+ 文字波浪 */
/* spot 元素默认是横向条状(为转圈动画设计),connected 时改成整圈圆环 */
.ble-launch-btn[data-ble-state="connected"] .back .spot-shadow {
transition: opacity 1.2s ease;
opacity: 0.9;
width: 106px; height: 106px;
border-radius: 50%;
filter: blur(12px) brightness(1.2);
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .spot-main {
transition: opacity 1.2s ease;
opacity: 0.95;
width: 100px; height: 100px;
border-radius: 50%;
filter: blur(9px) brightness(1.6);
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .ble-dial .spot-light {
transition: opacity 1.2s ease;
opacity: 0.9;
width: 92px; height: 92px;
border-radius: 50%;
filter: blur(8px) brightness(1.2);
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .ble-dial .center .icon svg {
filter: brightness(1.15);
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .ble-dial .center .launch {
color: #e9f0fa;
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .ble-dial .center .launch > div {
animation: ble-wave-text 1.8s calc(var(--i) * -0.13s) infinite;
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .ble-dial .center .start .text1 {
transition: transform 0.5s ease, opacity 0.5s ease;
transform: translateX(10px);
opacity: 0;
}
.ble-launch-btn[data-ble-state="connected"] .back .mid .ble-dial .center .start .text2 {
opacity: 1;
animation: ble-text2 0.5s forwards;
}
.ble-launch-btn:active .back .mid .ble-dial {
transform: scale(0.94);
box-shadow:
0 -1px 2px rgba(255,255,255,0.3),
inset 0 0 10px rgba(0,0,0,0.24),
inset 0 -13px 26px rgba(0,0,0,0.8);
}
/* —— 外圈金属环 —— */
.ble-launch-btn .back {
position: relative; z-index: 200;
width: 128px; height: 128px;
display: flex; justify-content: center; align-items: center;
border-radius: 50%;
background-image: linear-gradient(0, #5e5e61 20%, #212123);
box-shadow:
inset 0 1px 1px rgba(255,255,255,0.3),
inset 0 3px 5px rgba(255,255,255,0.6),
inset 0 -4px 2px rgba(255,255,255,0.05),
inset 0 -2px 0 rgba(0,0,0,0.15),
inset -2px 4px 0 rgba(0,0,0,0.3),
inset 2px 4px 0 rgba(0,0,0,0.3),
0 -7px 16px 2px rgba(255,255,255,0.18),
0 4px 16px 2px rgba(0,0,0,0.5),
0 2px 5px #7c7c7c;
cursor: pointer;
}
.ble-launch-btn .back .spot-shadow {
position: absolute;
width: 96px; height: 27px;
background: rgba(95,168,255,0.9);
opacity: 0;
filter: blur(14px) brightness(1.1);
}
.ble-launch-btn .back .mid {
overflow: hidden; position: relative;
width: 106px; height: 106px;
display: flex; justify-content: center; align-items: center;
border-radius: 50%;
background: #000;
box-shadow: 0 0 4px #000, 0 1px 2px rgba(255,255,255,0.8);
}
.ble-launch-btn .back .mid::before {
content: ''; position: absolute; z-index: 500;
width: 100%; height: 100%; border-radius: 50%;
background: transparent;
box-shadow: inset 0 -12px 18px rgba(0,0,0,0.8);
pointer-events: none;
}
.ble-launch-btn .back .mid .spot-main {
position: absolute;
width: 110px; height: 20px;
background: #5fa8ff;
opacity: 0;
filter: blur(11px) brightness(1.5);
}
.ble-launch-btn .back .mid .ble-dial {
position: relative; z-index: 90;
display: flex; justify-content: center; align-items: center;
width: 100px; height: 100px; border-radius: 50%;
background: #424242;
box-shadow:
0 -1px 2px rgba(255,255,255,0.5),
inset 0 -9px 18px rgba(0,0,0,0.8);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ble-launch-btn .back .mid .ble-dial .spot-light {
position: absolute;
width: 110px; height: 20px;
opacity: 0;
background: rgba(95,168,255,0.6);
filter: blur(14px) brightness(1.1);
}
.ble-launch-btn .back .mid .ble-dial .center {
position: relative; z-index: 100;
width: 86px; height: 86px;
display: flex; flex-direction: column;
align-items: center; justify-content: center; gap: 2px;
border-radius: 50%;
background: #232323;
cursor: pointer;
}
.ble-launch-btn .back .mid .ble-dial .center .icon svg {
margin-top: -3px;
width: 18px;
filter: brightness(1) grayscale(1);
transition: filter 1.5s ease;
}
.ble-launch-btn .back .mid .ble-dial .center .launch {
display: flex; margin-top: -3px;
font-size: 13px; color: #595959;
font-family: var(--font-display);
letter-spacing: 0.04em;
}
.ble-launch-btn .back .mid .ble-dial .center .start {
position: relative;
width: 100%; height: 11px;
font-size: 9px; color: #737373;
text-align: center;
font-family: var(--font-display);
}
.ble-launch-btn .back .mid .ble-dial .center .start > div {
position: absolute; left: 50%; top: 0;
transform: translateX(-50%);
white-space: nowrap;
}
.ble-launch-btn .back .mid .ble-dial .center .start .text2 {
opacity: 0;
display: inline-flex;
}
.ble-launch-btn .back .mid .ble-dial .center .start .text2 > span {
animation: ble-wave-text 1.8s calc(var(--n) * -0.13s) infinite;
}
.ble-launch-hint {
font-size: 11px; color: var(--text-dim);
letter-spacing: 0.04em;
}
@keyframes ble-wave-text {
0% { opacity: 0.7; }
50% { color: #c6e0ff; opacity: 1; }
100% { opacity: 0.7; }
}
@keyframes ble-spot-rot {
0% { transform: rotate(0); }
100% { transform: rotate(360deg); }
}
@keyframes ble-text2 {
0% { transform: translateX(-80%); }
100% { transform: translateX(-50%); }
}
@keyframes ble-text-pulse {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
.heap-low-table tbody tr:hover { background: rgba(255,255,255,.03); }
.heap-low-table td.has-suspect { color: var(--red); font-weight: 500; }
.heap-low-table td.idle-suspect { color: var(--gd32-hi); }
+102 -5
View File
@@ -74,11 +74,14 @@ label { display: block; }
/* ═══════════════════════ TOOLBAR ═══════════════════════ */
.toolbar {
grid-row: 1;
grid-column: 1;
position: relative; z-index: 10;
display: flex; align-items: center; gap: var(--sp-4);
padding: 0 var(--sp-5);
background: var(--bg-panel);
background: linear-gradient(90deg, color-mix(in srgb, var(--seed-primary) 7%, var(--bg-panel)), var(--bg-panel) 42%);
border-bottom: 1px solid var(--border);
box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.toolbar-brand {
display: flex; align-items: center; gap: var(--sp-3);
@@ -146,6 +149,15 @@ label { display: block; }
font-family: var(--font-mono); font-size: 0.82rem; outline: none;
}
.ch-select:focus { border-color: var(--primary); }
/* 轮询卡顿:通道下拉框变黄并呼吸发光(fixed-tick 下某拍未按时完成) */
.ch-select.stuck {
border-color: color-mix(in srgb, var(--warn) 65%, transparent);
animation: stuckPulse 1.2s ease-in-out infinite;
}
@keyframes stuckPulse {
0%, 100% { box-shadow: 0 0 2px color-mix(in srgb, var(--warn) 15%, transparent); }
50% { box-shadow: 0 0 10px color-mix(in srgb, var(--warn) 40%, transparent); }
}
/* 刷新速度输入框:与 .ch-select 同风格,宽度收窄 */
.refresh-input {
@@ -169,6 +181,8 @@ label { display: block; }
/* ═══════════════════════ MAIN LAYOUT ═══════════════════════ */
.main-grid {
grid-row: 2;
grid-column: 1;
position: relative; z-index: 1;
display: grid;
grid-template-columns: minmax(240px, 290px) minmax(0, 0.9fr) minmax(420px, 1.1fr);
@@ -178,15 +192,17 @@ label { display: block; }
min-height: 0;
}
.panel {
background: var(--bg-panel);
background: linear-gradient(145deg, color-mix(in srgb, var(--bg-panel) 94%, #ffffff 3%), var(--bg-panel) 52%);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
display: flex; flex-direction: column;
min-height: 0; overflow: hidden;
box-shadow: 0 10px 28px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .025);
}
.panel-head {
display: flex; align-items: center; gap: var(--sp-2);
padding: var(--sp-3) var(--sp-4);
background: linear-gradient(90deg, var(--primary-dim), transparent 48%);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
@@ -588,10 +604,12 @@ label { display: block; }
/* ═══════════════════════ STATUS BAR ═══════════════════════ */
.statusbar {
grid-row: 3;
grid-column: 1;
position: relative; z-index: 10;
display: flex; align-items: center; gap: var(--sp-4);
padding: 0 var(--sp-5);
background: var(--bg-panel);
background: color-mix(in srgb, var(--bg-panel) 92%, #000000 8%);
border-top: 1px solid var(--border);
font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg-muted);
overflow: hidden;
@@ -641,12 +659,91 @@ label { display: block; }
/* disconnected banner */
.net-banner {
display: none; align-items: center; gap: var(--sp-2);
display: none; grid-row: 1; grid-column: 1;
align-self: end; transform: translateY(100%); z-index: 20;
align-items: center; gap: var(--sp-2);
padding: 4px var(--sp-5); font-size: .72rem; font-family: var(--font-mono);
background: var(--danger-dim); color: var(--danger);
background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 20%, var(--bg-panel)), var(--danger-dim)); color: var(--danger);
border-bottom: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
}
.net-banner.show { display: flex; }
body:has(.net-banner.show) .main-grid { padding-top: calc(var(--sp-3) + 29px); }
/* ═══════════════════════ 命令序列 tab ═══════════════════════ */
.seq-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.seq-status { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-dim); margin-left: auto; white-space: nowrap; }
.seq-status.on { color: var(--primary); }
.seq-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.seq-empty {
padding: var(--sp-5); text-align: center; color: var(--fg-dim); font-size: 0.8rem;
border: 1px dashed var(--border-strong); border-radius: var(--radius); line-height: 1.7;
}
.seq-step {
padding: var(--sp-3); border-radius: var(--radius);
border: 1px solid var(--border); background: var(--bg-root);
transition: border-color .2s, background .2s;
}
.seq-step:hover { border-color: var(--border-strong); }
.seq-step.current {
border-color: color-mix(in srgb, var(--seed-primary) 55%, transparent);
background: color-mix(in srgb, var(--seed-primary) 5%, var(--bg-root));
}
.seq-locked .seq-step { opacity: .55; pointer-events: none; }
.seq-step-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.seq-idx { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; color: var(--primary); min-width: 4.2em; }
.seq-num {
padding: 4px 8px; background: var(--bg-root);
border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
font-family: var(--font-mono); font-size: 0.78rem; outline: none; color: var(--fg);
transition: border-color .2s;
}
.seq-num:focus { border-color: var(--primary); }
/* 隐藏原生上下箭头(样式丑且尺寸不可控):数值直接键入,聚焦后可用键盘 ↑↓ 微调 */
.seq-num { -moz-appearance: textfield; appearance: textfield; }
.seq-num::-webkit-inner-spin-button,
.seq-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.seq-step-head .seq-num { width: 6.8em; text-align: right; }
.seq-step-head select {
padding: 4px 8px; background: var(--bg-root);
border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
font-family: var(--font-mono); font-size: 0.78rem; outline: none; color: var(--fg);
}
.seq-step-head select:focus { border-color: var(--primary); }
.seq-hold-label, .seq-hold-unit { font-size: 0.68rem; color: var(--fg-dim); font-family: var(--font-mono); }
.seq-ops { margin-left: auto; display: flex; gap: 2px; }
.seq-ops button {
width: 26px; height: 26px; border-radius: var(--radius-sm);
display: inline-flex; align-items: center; justify-content: center;
color: var(--fg-dim); background: transparent; border: none;
transition: background .15s, color .15s;
}
.seq-ops button svg { flex-shrink: 0; }
.seq-ops button:hover:not(:disabled) { background: var(--primary-dim); color: var(--primary); }
.seq-ops button.seq-del:hover:not(:disabled) { background: var(--danger-dim); color: var(--danger); }
.seq-ops button:disabled { opacity: .25; cursor: default; }
.seq-step-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--sp-2); }
.seq-step-fields .field-label { font-size: 0.62rem; }
.seq-step-fields .seq-num { width: 100%; }
/* 动作组:一步内多个电机动作(近同时下发),动作行嵌套在步骤卡片内 */
.seq-count {
font-family: var(--font-mono); font-size: 0.68rem; color: var(--fg-dim);
padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap;
}
.seq-actions { display: flex; flex-direction: column; gap: var(--sp-2); }
.seq-action {
padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
border: 1px solid var(--border); background: var(--bg-panel);
}
.seq-action-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.seq-action-tag { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: var(--fg-muted); min-width: 4.2em; }
.seq-action-head select {
padding: 4px 8px; background: var(--bg-root);
border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
font-family: var(--font-mono); font-size: 0.78rem; outline: none; color: var(--fg);
}
.seq-action-head select:focus { border-color: var(--primary); }
.seq-hint { margin-top: var(--sp-4); font-size: 0.72rem; color: var(--fg-dim); line-height: 1.6; }
/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 1365px) {