固件 0.1.3-c5:硬重启开机校验 + 重按(0.1.2)、status 上报上游电脑在不在(host)
- 0.1.2:power_cycle 按完电源键后看电流,没开就重按,最多 3 次;新事件 19 BOOT_CHECK - 0.1.3:UP_VBUS_DET(IO6)启动时配成输入,status 加 "host":true|false|null - rack:单板页显示「上游:已连电脑 / 未连电脑」 - HANDOFF:损耗两档的来历(Hub 工作 ≈1.1 W)、板 B 第 2 槽 PRSNT2# 卡低 Co-Authored-By: Claude Opus 5.5 <[email protected]>
这个提交包含在:
@@ -6,8 +6,10 @@
|
||||
上位机的卡死判据(电流曲线)拿 0 当真值会直接误判。 */
|
||||
#include <stdio.h>
|
||||
|
||||
#include "board_pins.h"
|
||||
#include "cmd_priv.h"
|
||||
#include "evlog.h"
|
||||
#include "hal_gpio.h"
|
||||
#include "hal_time.h"
|
||||
#include "ota.h"
|
||||
#include "pca9555.h"
|
||||
@@ -101,6 +103,14 @@ void cmd_report_status(cj_writer_t *w, const cmd_env_t *env)
|
||||
{
|
||||
const safety_snap_t *s = env->safety;
|
||||
cj_w(w, ",\"fw\":\"%s\",\"up\":%lu", phonerail_version(), (unsigned long)hal_time_now_ms());
|
||||
/* 上游 USB-C 插没插电脑(`UP_VBUS_DET`,bringup 里配的输入)。读不到写 null。
|
||||
⚠️ 这是 VBUS 在不在,不是 Hub 有没有枚举 / 挂起:电脑休眠时 VBUS 多半还在。 */
|
||||
int host = 0;
|
||||
if (hal_gpio_read(BOARD_PIN_UP_VBUS_DET, &host) == HAL_OK) {
|
||||
cj_w(w, ",\"host\":%s", b(host != 0));
|
||||
} else {
|
||||
cj_w(w, ",\"host\":null");
|
||||
}
|
||||
if (s != NULL) {
|
||||
if (s->input_ok) {
|
||||
cj_w(w, ",\"in\":{\"mv\":%ld,\"ua\":%ld}", (long)s->input.bus_mv,
|
||||
|
||||
在新工单中引用
屏蔽一个用户