feat(app): 1.6.39 —— 1.6.29 起未上板业务改动入库,启动链与已提交基线对齐
主体为工作区累积的业务改动(CAN/PDO/桥/SSC/task_manager 等,详目见 config.h 版本注释链),新增 CoE 0x100A 真版本上报与 0x2502 APP→BOOT 总线交接。启动链(startup/SystemInit/initial/systick/hardfault)与 HEAD 逐字节一致;1.6.35~38 的跳转诊断实验(3M 化/BKP 面包屑/ haltWithWatchdog)未提交、已整体回退,补丁存 _revert_backup_20260916/。 真机实测(配对 BOOT 1.1.0.18):刷写 warm jump 与 reset cold jump 均可。
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
volatile uint8_t EthercatCanBridge::s_lastSeq = 0U;
|
||||
volatile bool EthercatCanBridge::s_seqPrimed = false;
|
||||
volatile bool EthercatCanBridge::s_coldStartPending = false;
|
||||
volatile uint8_t EthercatCanBridge::s_lastTxResult = 0U;
|
||||
volatile uint16_t EthercatCanBridge::s_txCount = 0U;
|
||||
volatile uint16_t EthercatCanBridge::s_dropCount = 0U;
|
||||
@@ -223,9 +224,10 @@ bool EthercatCanBridge::peekOutput(const uint8_t *head)
|
||||
/* WIN@8 不再使用:1.6.21 电机整轮密排,无滑窗。 */
|
||||
|
||||
if (!s_seqPrimed) {
|
||||
s_seqPrimed = true;
|
||||
s_lastSeq = seq;
|
||||
return false;
|
||||
s_seqPrimed = true;
|
||||
s_lastSeq = seq;
|
||||
s_coldStartPending = true;
|
||||
return true; /* 冷启动首包强制全量读,避免漏掉首帧命令 */
|
||||
}
|
||||
|
||||
if (seq != s_lastSeq) {
|
||||
@@ -234,6 +236,13 @@ bool EthercatCanBridge::peekOutput(const uint8_t *head)
|
||||
return (head[ECAT_CAN_TX_OFF_FLAGS] & 0x01U) != 0U;
|
||||
}
|
||||
|
||||
void EthercatCanBridge::resetSequenceState()
|
||||
{
|
||||
s_seqPrimed = false;
|
||||
s_lastSeq = 0U;
|
||||
s_coldStartPending = false;
|
||||
}
|
||||
|
||||
void EthercatCanBridge::processOutput(const uint8_t *out)
|
||||
{
|
||||
if (out == nullptr) {
|
||||
@@ -243,19 +252,33 @@ void EthercatCanBridge::processOutput(const uint8_t *out)
|
||||
const uint8_t seq = out[ECAT_CAN_TX_OFF_SEQ];
|
||||
|
||||
if (!s_seqPrimed) {
|
||||
s_seqPrimed = true;
|
||||
s_lastSeq = seq;
|
||||
return;
|
||||
s_seqPrimed = true;
|
||||
s_lastSeq = seq;
|
||||
s_coldStartPending = true;
|
||||
}
|
||||
|
||||
/* 无论 seq 是否变化,优先处理非 seq 驱动的命令(FLAGS bit0 清统计) */
|
||||
if ((out[ECAT_CAN_TX_OFF_FLAGS] & 0x01U) != 0U) {
|
||||
s_txCount = 0U;
|
||||
s_dropCount = 0U;
|
||||
s_rxCount = 0U;
|
||||
s_txCount = 0U;
|
||||
s_dropCount = 0U;
|
||||
s_rxCount = 0U;
|
||||
s_rxPublished = true;
|
||||
}
|
||||
|
||||
if (seq == s_lastSeq) {
|
||||
bool executeCommand = false;
|
||||
if (s_coldStartPending) {
|
||||
s_coldStartPending = false;
|
||||
/* 冷启动首包:若包含有效单帧命令或批量帧,立即执行 */
|
||||
const uint8_t dlc = out[ECAT_CAN_TX_OFF_DLC];
|
||||
const uint8_t batchCount = out[ECAT_TXB_OFF_COUNT];
|
||||
if (dlc > 0U || batchCount > 0U) {
|
||||
executeCommand = true;
|
||||
}
|
||||
} else if (seq != s_lastSeq) {
|
||||
executeCommand = true;
|
||||
}
|
||||
|
||||
if (!executeCommand) {
|
||||
return;
|
||||
}
|
||||
s_lastSeq = seq;
|
||||
@@ -384,4 +407,9 @@ void EcatCan_BuildInput(uint8_t *in)
|
||||
EthercatCanBridge::buildInput(in);
|
||||
}
|
||||
|
||||
void EcatCan_ResetSequenceState(void)
|
||||
{
|
||||
EthercatCanBridge::resetSequenceState();
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
Reference in New Issue
Block a user