1. 修改日志和RPC模块
This commit is contained in:
parent
697fe56098
commit
90a2ab4ff8
@ -169,6 +169,7 @@ void HDLogDebugSetGetTask(HDLogGetTaskType_t getTask);
|
||||
* @param size 栈大小
|
||||
*/
|
||||
void HDLogDebugInitStackAddr(unsigned long currTask, uint32_t size);
|
||||
void HDLogDebugInitStackAddrInfo(unsigned long currTask, uint32_t size, uint32_t stackAddr);
|
||||
|
||||
/**
|
||||
* @brief 删除当前任务的栈大小记录
|
||||
|
||||
@ -524,6 +524,11 @@ void HDLogDebugSetGetTask(HDLogGetTaskType_t getTask)
|
||||
void HDLogDebugInitStackAddr(unsigned long currTask, uint32_t size)
|
||||
{
|
||||
void *start = 0;
|
||||
HDLogDebugInitStackAddrInfo(currTask, size, (uint32_t)&start - sizeof(void *));
|
||||
}
|
||||
|
||||
void HDLogDebugInitStackAddrInfo(unsigned long currTask, uint32_t size, uint32_t stackAddr)
|
||||
{
|
||||
for (int i = 0; i < USE_CHECK_STACK_NUM; ++i)
|
||||
{
|
||||
if (sStackCheckInfo[i].enable)
|
||||
@ -532,7 +537,7 @@ void HDLogDebugInitStackAddr(unsigned long currTask, uint32_t size)
|
||||
}
|
||||
|
||||
sStackCheckInfo[i].enable = 1;
|
||||
sStackCheckInfo[i].stackAddr = (unsigned long)&start - sizeof(void *);
|
||||
sStackCheckInfo[i].stackAddr = stackAddr;
|
||||
sStackCheckInfo[i].stackSize = size;
|
||||
sStackCheckInfo[i].taskID = currTask;
|
||||
break;
|
||||
|
||||
@ -463,6 +463,11 @@ uint8_t HDRPCParseArgs(void *data, uint16_t len, HDRPCSession *session)
|
||||
uint8_t _HDRPCCheckArgs(HDRPCSession *session, uint8_t *type, uint8_t index, uint8_t len)
|
||||
{
|
||||
for (uint8_t i = index; i < len; ++i) {
|
||||
if (i >= session->index) {
|
||||
LogD("Check type[%d] index[%d] len[%d] error", type[i], i, session->index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (session->args[i].type != type[i]) {
|
||||
LogD("Check index[%d] Type[0x%x][0x%x] faild", i, session->args[i].type, type[i]);
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user