Commit c9dc0bfb authored by lyong's avatar lyong

feat:自动化测试授权增加2、4、6、8、16、32段 ;2、增加lcd测试时间 1秒切换一个画面;3、优化触摸

parent a8f35efa
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
ledtimerSet: function () { ledtimerSet: function () {
this.resetLcd(); this.resetLcd();
this.clearTimer(); this.clearTimer();
idTimeOut = this.$setInterval(this.normalTimerOut, 300, [], this); idTimeOut = this.$setInterval(this.normalTimerOut, 1000, [], this);
// this.$setTimeout(this.LedTimerOut, 5000, [], this); // this.$setTimeout(this.LedTimerOut, 5000, [], this);
}, },
......
...@@ -41,7 +41,8 @@ function event(fd, recvBuf) { ...@@ -41,7 +41,8 @@ function event(fd, recvBuf) {
if (hit) return hit.fn(fd, recvBuf); if (hit) return hit.fn(fd, recvBuf);
} }
function eventHex(fd, recvBuf) { function eventHex(fd, recvBuf) {
console.log('RXHEX:' + recvBuf); console.debug(`RXHEX:${recvBuf}`);
//console.debug(`!!!!will go to main globalThis.appAliveValue!=1 ${globalThis.appAliveValue}`)
const hit = cmdTableHex.find(item => recvBuf.includes(item.kw)); const hit = cmdTableHex.find(item => recvBuf.includes(item.kw));
if (hit) return hit.fn(fd, recvBuf); if (hit) return hit.fn(fd, recvBuf);
} }
...@@ -167,15 +168,21 @@ function doWriteLic(fd, recvBuf) { ...@@ -167,15 +168,21 @@ function doWriteLic(fd, recvBuf) {
console.log("recvBuf:" + recvBuf) console.log("recvBuf:" + recvBuf)
var ret = autoUtil.licParce(recvBuf); var ret = autoUtil.licParce(recvBuf);
if (ret == 1) { if (ret == 1) {
console.log("licParce ret:" + ret)
send(fd, '+OK'); send(fd, '+OK');
} else if (ret == -2) { }
else if (ret == 2) {
console.log("licParce error");
if (uartMode == 1) { if (uartMode == 1) {
restartUart(); restartUart();
} else if (uartMode == 2) { } else if (uartMode == 2) {
restartUartCarrieWave(); restartUartCarrieWave();
} }
}
else if (ret == 3) {
console.log("licParce ret:" + ret)
send(fd, '+OK');
autoUtil.gotoWriteLic();
} }
// console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); // console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
// console.log('write lic:' + recvBuf); // console.log('write lic:' + recvBuf);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <signal.h> #include <signal.h>
#include <sys/stat.h> // 放在现有 #include 区域任意位置 #include <sys/stat.h> // 放在现有 #include 区域任意位置
#include <stdint.h> // 就有 uint8_t #include <stdint.h> // 就有 uint8_t
#include <sched.h>
#define DEBUG 0 /* 1=打开调试 0=关闭打印 */ #define DEBUG 0 /* 1=打开调试 0=关闭打印 */
#if DEBUG #if DEBUG
...@@ -30,6 +31,14 @@ static int g_rxlen = 0; /* 有效长度 ...@@ -30,6 +31,14 @@ static int g_rxlen = 0; /* 有效长度
static int g_rxHexlen = 0; /* 有效长度 */ static int g_rxHexlen = 0; /* 有效长度 */
static pthread_mutex_t g_rx_mutex = PTHREAD_MUTEX_INITIALIZER; /* 互斥锁 */ static pthread_mutex_t g_rx_mutex = PTHREAD_MUTEX_INITIALIZER; /* 互斥锁 */
void set_realtime_priority(pthread_t thread, int priority) {
struct sched_param param;
param.sched_priority = priority;
pthread_setschedparam(thread, SCHED_FIFO, &param);
}
/* ---------------- 串口底层 ---------------- */ /* ---------------- 串口底层 ---------------- */
/** /**
* @brief 接收数据 * @brief 接收数据
...@@ -332,6 +341,9 @@ int uart_init(const char *port, const char *baud_str) ...@@ -332,6 +341,9 @@ int uart_init(const char *port, const char *baud_str)
pthread_t tid; pthread_t tid;
pthread_create(&tid, NULL, rx_thread, (void *)(long)fd); pthread_create(&tid, NULL, rx_thread, (void *)(long)fd);
set_realtime_priority(tid, 10);
pthread_detach(tid); /* 自生自灭 */ pthread_detach(tid); /* 自生自灭 */
return fd; return fd;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment