批检仪检测流程验证成功
This commit is contained in:
49
prot_cmd/cmd_m4.cpp
Normal file
49
prot_cmd/cmd_m4.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
#include "base/base.h"
|
||||
#include "base/check_cfg.h"
|
||||
#include "base/mycfg.h"
|
||||
#include "prot/prot_m4.h"
|
||||
#include "prot/prot_pc.h"
|
||||
|
||||
|
||||
typedef struct{
|
||||
int key_pressed;
|
||||
int ke1_pressed;
|
||||
}self_def;
|
||||
|
||||
|
||||
static self_def g_self;
|
||||
|
||||
|
||||
void cmd_m4_init()
|
||||
{
|
||||
prot_m4 *m4=protM4();
|
||||
m4->set_irq_fun([=](myarray data){
|
||||
ProtPc *pc=protPc();
|
||||
g_self.key_pressed=1;
|
||||
qDebug("key press");
|
||||
pc->send_data_slot(0x37,myarray(1,char(0)));
|
||||
},"key press");
|
||||
m4->set_irq_fun([=](myarray data){
|
||||
g_self.key_pressed=0;
|
||||
qDebug("key up");
|
||||
},"key up");
|
||||
m4->set_irq_fun([=](myarray data){
|
||||
g_self.ke1_pressed=1;
|
||||
qDebug("ke1 press");
|
||||
},"ke1 press");
|
||||
m4->set_irq_fun([=](myarray data){
|
||||
g_self.ke1_pressed=0;
|
||||
qDebug("ke1 up");
|
||||
},"ke1 up");
|
||||
// m4->set_irq_fun([=](myarray data){
|
||||
// ProtPc *pc=protPc();
|
||||
// qDebug("send 0x37 to pc");
|
||||
// pc->send_data_slot(0x37,myarray(1,char(0)));
|
||||
// },"key press");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user