增加调试打印输出
This commit is contained in:
@@ -13,6 +13,12 @@
|
||||
#include "tpafe5160.h"
|
||||
#include "main.h"
|
||||
|
||||
/*
|
||||
* 调试输出配置
|
||||
*/
|
||||
#define DBG_TAG "[ADC]"
|
||||
#include "dbg_log.h"
|
||||
|
||||
/* ======================== 私有宏定义 ======================== */
|
||||
|
||||
/*
|
||||
@@ -69,7 +75,13 @@ int tpafe5160_init(void)
|
||||
TPAFE5160_CONVST_LOW();
|
||||
|
||||
/* 等待 BUSY 释放,确保上电后无残留转换 */
|
||||
return tpafe5160_wait_busy(TPAFE5160_CONV_TIMEOUT_MS);
|
||||
int ret = tpafe5160_wait_busy(TPAFE5160_CONV_TIMEOUT_MS);
|
||||
if (ret != TPAFE5160_OK) {
|
||||
DBG_ERROR("Init wait BUSY timeout");
|
||||
} else {
|
||||
DBG_INFO("Init OK");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -150,6 +162,7 @@ int tpafe5160_read_all(int16_t *buf)
|
||||
/* 等待转换完成 */
|
||||
ret = tpafe5160_wait_busy(TPAFE5160_CONV_TIMEOUT_MS);
|
||||
if (ret != TPAFE5160_OK) {
|
||||
DBG_ERROR("read_all BUSY timeout");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user