More buffer time
This commit is contained in:
@ -10,18 +10,6 @@ class ImtqHandler;
|
||||
|
||||
namespace imtq {
|
||||
|
||||
enum ComStep : uint8_t {
|
||||
DHB_OP = 0,
|
||||
START_MEASURE_SEND = 1,
|
||||
START_MEASURE_GET = 2,
|
||||
READ_MEASURE_SEND = 3,
|
||||
READ_MEASURE_GET = 4,
|
||||
START_ACTUATE_SEND = 5,
|
||||
START_ACTUATE_GET = 6,
|
||||
READ_ACTUATE_SEND = 7,
|
||||
READ_ACTUATE_GET = 8,
|
||||
};
|
||||
|
||||
enum class RequestType : uint8_t { MEASURE_NO_ACTUATION, ACTUATE, DO_NOTHING };
|
||||
|
||||
enum class SpecialRequest : uint8_t {
|
||||
@ -35,6 +23,26 @@ enum class SpecialRequest : uint8_t {
|
||||
GET_SELF_TEST_RESULT = 7
|
||||
};
|
||||
|
||||
struct Request {
|
||||
imtq::RequestType request = imtq::RequestType::MEASURE_NO_ACTUATION;
|
||||
imtq::SpecialRequest specialRequest = imtq::SpecialRequest::NONE;
|
||||
uint8_t integrationTimeSel = 3;
|
||||
int16_t dipoles[3]{};
|
||||
uint16_t torqueDuration = 0;
|
||||
};
|
||||
|
||||
enum ComStep : uint8_t {
|
||||
DHB_OP = 0,
|
||||
START_MEASURE_SEND = 1,
|
||||
START_MEASURE_GET = 2,
|
||||
READ_MEASURE_SEND = 3,
|
||||
READ_MEASURE_GET = 4,
|
||||
START_ACTUATE_SEND = 5,
|
||||
START_ACTUATE_GET = 6,
|
||||
READ_ACTUATE_SEND = 7,
|
||||
READ_ACTUATE_GET = 8,
|
||||
};
|
||||
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::IMTQ_HANDLER;
|
||||
|
||||
static constexpr ReturnValue_t INVALID_COMMAND_CODE = MAKE_RETURN_CODE(0);
|
||||
@ -1124,25 +1132,21 @@ class NegZSelfTestSet : public StaticLocalDataSet<SELF_TEST_DATASET_ENTRIES> {
|
||||
|
||||
} // namespace imtq
|
||||
|
||||
struct ImtqRequest {
|
||||
imtq::RequestType request = imtq::RequestType::MEASURE_NO_ACTUATION;
|
||||
imtq::SpecialRequest specialRequest = imtq::SpecialRequest::NONE;
|
||||
int16_t dipoles[3]{};
|
||||
uint16_t torqueDuration = 0;
|
||||
};
|
||||
|
||||
struct ImtqRepliesDefault {
|
||||
friend class ImtqPollingTask;
|
||||
|
||||
public:
|
||||
static constexpr size_t BASE_LEN =
|
||||
imtq::replySize::DEFAULT_MIN_LEN + 1 + imtq::replySize::SYSTEM_STATE + 1 +
|
||||
1 + imtq::replySize::DEFAULT_MIN_LEN + 1 + imtq::replySize::SYSTEM_STATE + 1 +
|
||||
+imtq::replySize::DEFAULT_MIN_LEN + 1 + imtq::replySize::RAW_MTM_MEASUREMENT + 1 +
|
||||
imtq::replySize::ENG_HK_DATA_REPLY + 1 + imtq::replySize::CAL_MTM_MEASUREMENT + 1;
|
||||
ImtqRepliesDefault(const uint8_t* rawData) : rawData(const_cast<uint8_t*>(rawData)) {
|
||||
initPointers();
|
||||
}
|
||||
|
||||
void setConfigured() { rawData[0] = true; }
|
||||
bool devWasConfigured() const { return rawData[0]; }
|
||||
|
||||
uint8_t* getCalibMgmMeasurement() const { return calibMgmMeasurement + 1; }
|
||||
bool wasCalibMgmMeasurementRead() const { return calibMgmMeasurement[0]; };
|
||||
|
||||
@ -1164,7 +1168,7 @@ struct ImtqRepliesDefault {
|
||||
|
||||
private:
|
||||
void initPointers() {
|
||||
swReset = rawData;
|
||||
swReset = rawData + 1;
|
||||
systemState = swReset + imtq::replySize::DEFAULT_MIN_LEN + 1;
|
||||
startMtmMeasurement = systemState + imtq::replySize::SYSTEM_STATE + 1;
|
||||
rawMgmMeasurement = startMtmMeasurement + imtq::replySize::DEFAULT_MIN_LEN + 1;
|
||||
@ -1172,6 +1176,7 @@ struct ImtqRepliesDefault {
|
||||
calibMgmMeasurement = engHk + imtq::replySize::ENG_HK_DATA_REPLY + 1;
|
||||
specialRequestReply = calibMgmMeasurement + imtq::replySize::CAL_MTM_MEASUREMENT + 1;
|
||||
}
|
||||
|
||||
uint8_t* rawData;
|
||||
uint8_t* swReset;
|
||||
uint8_t* systemState;
|
||||
|
Reference in New Issue
Block a user