Refactor and clean up codebase
- Removed unused constants and type aliases in app_spi_command_defs.h and temp_sensor.h. - Simplified ISpiCommandHandler destructor to default. - Eliminated redundant methods and comments in temp_sensor and usart0 files. - Consolidated writeU32Le function to app_spi_command_defs.h for reuse. - Updated comments for clarity and accuracy in task_manager.h and task_runner.cpp. - Removed hardfault.h as it contained no declarations. - Cleaned up CANFD and watchdog implementations by removing dead code and unnecessary comments. - Updated version numbers in config.h to reflect recent changes. - Enhanced error handling and diagnostics in hardfault handling.
This commit is contained in:
@@ -28,7 +28,7 @@ void EscLan9252::init()
|
||||
EscExmcBus::init();
|
||||
|
||||
/* ============================================================
|
||||
* TODO: 完整 ESC 寄存器配置(需 SSC 或等价协议栈代码,本 spec 不实现)
|
||||
* TODO(spec): 完整 ESC 寄存器配置(需 SSC 或等价协议栈代码,本 spec 不实现)
|
||||
* ============================================================
|
||||
* 当前仅完成 EXMC 总线初始化与芯片 ID 读取。要使 SYNC0 实际触发,还需配置:
|
||||
*
|
||||
@@ -58,11 +58,6 @@ void EscLan9252::init()
|
||||
* ============================================================ */
|
||||
}
|
||||
|
||||
bool EscLan9252::selfTest()
|
||||
{
|
||||
return (readChipId() == LAN9252_CHIP_ID_VALUE);
|
||||
}
|
||||
|
||||
uint32_t EscLan9252::readChipId()
|
||||
{
|
||||
/* INIT-ONLY:init 阶段中断未使能,但仍走 initOnly 路径保持一致性 */
|
||||
@@ -77,11 +72,6 @@ uint16_t EscLan9252::readReg(uint16_t addr)
|
||||
return EscExmcBus::read16((uint32_t)addr << 1U);
|
||||
}
|
||||
|
||||
void EscLan9252::writeReg(uint16_t addr, uint16_t val)
|
||||
{
|
||||
EscExmcBus::write16((uint32_t)addr << 1U, val);
|
||||
}
|
||||
|
||||
__attribute__((section(".ramfunc"), noinline))
|
||||
void EscLan9252::readPdi(uint16_t offset, uint8_t *buf, size_t len)
|
||||
{
|
||||
@@ -121,24 +111,8 @@ void EscLan9252::writePdi(uint16_t offset, const uint8_t *buf, size_t len)
|
||||
}
|
||||
|
||||
/* ---- initOnly* 接口:INIT-ONLY,仅允许在 EthercatSync::init() 使能 EXTI NVIC 之前调用 ----
|
||||
* 运行期禁止调用;需 ESC 寄存器访问须通过 SYNC0 ISR 代访队列(本 spec 不涵盖)。
|
||||
* 注:不再使用 PRIMASK 关中断(违反项目硬约束"Critical sections MUST use BASEPRI")。 */
|
||||
* 运行期禁止调用;需 ESC 寄存器访问须通过 SYNC0 ISR 代访队列(本 spec 不涵盖)。 */
|
||||
uint16_t EscLan9252::initOnlyReadReg(uint16_t addr)
|
||||
{
|
||||
return readReg(addr);
|
||||
}
|
||||
|
||||
void EscLan9252::initOnlyWriteReg(uint16_t addr, uint16_t val)
|
||||
{
|
||||
writeReg(addr, val);
|
||||
}
|
||||
|
||||
void EscLan9252::initOnlyReadPdi(uint16_t offset, uint8_t *buf, size_t len)
|
||||
{
|
||||
readPdi(offset, buf, len);
|
||||
}
|
||||
|
||||
void EscLan9252::initOnlyWritePdi(uint16_t offset, const uint8_t *buf, size_t len)
|
||||
{
|
||||
writePdi(offset, buf, len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user