Browse Source

update

master
zhaohe 2 years ago
parent
commit
903c2e5270
  1. 15
      components/cmdscheduler/cmd_scheduler.cpp
  2. 2
      components/hardware/uart/zuart_helper.cpp

15
components/cmdscheduler/cmd_scheduler.cpp

@ -77,13 +77,21 @@ void CmdScheduler::schedule() {
int inext = strlen(&rxbuf[i]) + i; int inext = strlen(&rxbuf[i]) + i;
int32_t ecode = callcmd(&rxbuf[i]); int32_t ecode = callcmd(&rxbuf[i]);
i = inext; i = inext;
if (ecode == 0) {
ZLOGI(TAG, "\tsuccess");
} else {
ZLOGE(TAG, "\tfailed:%s(%d)", err::error2str(ecode), ecode);
}
ZLOGI(TAG, "\r\n");
if (ecode != 0) { if (ecode != 0) {
ZLOGE(TAG, "callcmd %s fail:%s(%d)", &rxbuf[i], err::error2str(ecode), ecode);
break; break;
} }
} }
} }
ZLOGI(TAG, "process_rx_cmd:end");
// if (m_rxsize != 1) {
// ZLOGI(TAG, "doscript:end");
// }
m_dataisready = false; m_dataisready = false;
} }
@ -116,9 +124,6 @@ int32_t CmdScheduler::callcmd(const char* cmd) {
// ZLOGI(TAG, "callcmd:argc %d %d", argc, cmder->second.npara); // ZLOGI(TAG, "callcmd:argc %d %d", argc, cmder->second.npara);
if (cmder->second.npara != context.argc - 1) return err::kce_cmd_param_num_error; if (cmder->second.npara != context.argc - 1) return err::kce_cmd_param_num_error;
int32_t ret = cmder->second.call_cmd(&context); int32_t ret = cmder->second.call_cmd(&context);
if (ret == 0) {
ZLOGI(TAG, "success", argv[0]);
}
return ret; return ret;
} else { } else {

2
components/hardware/uart/zuart_helper.cpp

@ -3,7 +3,7 @@
#include "sdk\components\zprotocols\errorcode\errorcode.hpp" #include "sdk\components\zprotocols\errorcode\errorcode.hpp"
using namespace iflytop; using namespace iflytop;
#define DEBUG 1
#define DEBUG 0
#if DEBUG #if DEBUG
static void dumphex(char* tag, uint8_t* data, uint8_t len) { static void dumphex(char* tag, uint8_t* data, uint8_t len) {
printf("%s:", tag); printf("%s:", tag);

Loading…
Cancel
Save