v1.2版本改为通过xbox系列手柄进行遥控,并增加智能模式和手动模式
This commit is contained in:
1 parent
76603d3c31
commit
1a97bc32c3
1839 files changed
+478852
-3
No files matched your search
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
namespace XboxSeriesXHIDReportBuilder_asukiaaa {
|
||||
|
||||
struct InfoSelect {
|
||||
uint8_t center : 1;
|
||||
uint8_t shake : 1;
|
||||
uint8_t right : 1;
|
||||
uint8_t left : 1;
|
||||
uint8_t _unkown_bit_4 : 1;
|
||||
uint8_t _unkown_bit_5 : 1;
|
||||
uint8_t _unkown_bit_6 : 1;
|
||||
uint8_t _unkown_bit_7 : 1;
|
||||
};
|
||||
|
||||
// 0 to 0x64 (100), over 0x64 becomes 0x64
|
||||
struct InfoPower {
|
||||
uint8_t left;
|
||||
uint8_t right;
|
||||
uint8_t shake;
|
||||
uint8_t center;
|
||||
};
|
||||
|
||||
struct ReportBeforeUnion {
|
||||
InfoSelect select;
|
||||
InfoPower power;
|
||||
// value * 0.01 seconds, max 2.55 seconds
|
||||
uint8_t timeActive;
|
||||
uint8_t timeSilent;
|
||||
// max 0xff
|
||||
uint8_t countRepeat;
|
||||
};
|
||||
|
||||
class ReportBase {
|
||||
public:
|
||||
static const size_t arr8tLen = 8;
|
||||
union {
|
||||
ReportBeforeUnion v;
|
||||
uint8_t arr8t[arr8tLen];
|
||||
};
|
||||
|
||||
ReportBase() { setFullPowerFor1Sec(); }
|
||||
|
||||
void setFullPowerFor1Sec() {
|
||||
v.select.center = true;
|
||||
v.select.left = true;
|
||||
v.select.right = true;
|
||||
v.select.shake = false;
|
||||
v.power.center = 30;
|
||||
// v.power.left = 30;
|
||||
// v.power.right = 30;
|
||||
// v.power.shake = 30;
|
||||
// v.timeActive = 30;
|
||||
v.timeSilent = 0;
|
||||
v.countRepeat = 0;
|
||||
}
|
||||
|
||||
void setAllOff() {
|
||||
v.select.center = false;
|
||||
v.select.left = false;
|
||||
v.select.right = false;
|
||||
v.select.shake = false;
|
||||
v.power.center = 0;
|
||||
v.power.left = 0;
|
||||
v.power.right = 0;
|
||||
v.power.shake = 0;
|
||||
v.timeActive = 0;
|
||||
v.timeSilent = 0;
|
||||
v.countRepeat = 0;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace XboxSeriesXHIDReportBuilder_asukiaaa
|
||||
Reference in new issue
Block a user