添加自研批检仪检测命令

This commit is contained in:
ranchuan
2023-11-27 14:31:00 +08:00
parent b3a0d7b57c
commit a0b0f41c39
45 changed files with 3778 additions and 2628 deletions

View File

@@ -14,34 +14,32 @@ class InterFace : public QObject
{
Q_OBJECT
public:
InterFace() {irq_fun=nullptr;}
InterFace() { irq_fun = nullptr; }
virtual ~InterFace() {}
virtual void init() = 0;
virtual int write(myarray data) = 0;
virtual void set_irq(irq_cb fun){
this->irq_fun=fun;
virtual void set_irq(irq_cb fun)
{
this->irq_fun = fun;
}
protected:
irq_cb irq_fun;
};
InterFace *interFaceFind(const char *name);
typedef struct
{
const char *name;
InterFace *(*if_get_fun)();
} if_def;
typedef struct{
const char *name;
InterFace *(*if_get_fun)();
}if_def;
#define if_export(name_,fun_) \
#define if_export(name_, fun_) \
const static char __if_##name_##_name[] __attribute__((section(".rodata.ifstr"))) = #name_; \
__attribute__((used)) static if_def _if_##name_ __attribute__((section("ifdef")))={\
.name=__if_##name_##_name,\
.if_get_fun=fun_,\
}
__attribute__((used)) static if_def _if_##name_ __attribute__((section("ifdef"))) = { \
.name = __if_##name_##_name, \
.if_get_fun = fun_, \
}
#endif // INTERFACE_H