|
@ -14,9 +14,9 @@ class TMCReg { |
|
|
private: |
|
|
private: |
|
|
/* data */ |
|
|
/* data */ |
|
|
public: |
|
|
public: |
|
|
uint8_t flag = 0; |
|
|
|
|
|
uint8_t reg = 0; |
|
|
|
|
|
uint8_t val = 0; |
|
|
|
|
|
|
|
|
uint8_t flag = 0; |
|
|
|
|
|
uint8_t reg = 0; |
|
|
|
|
|
int32_t val = 0; |
|
|
|
|
|
|
|
|
void setActiveFlag() { flag = flag | 0x01; } |
|
|
void setActiveFlag() { flag = flag | 0x01; } |
|
|
bool isActive() { return flag & 0x01; } |
|
|
bool isActive() { return flag & 0x01; } |
|
@ -27,7 +27,7 @@ class TMCReg { |
|
|
|
|
|
|
|
|
class TMCRegCache { |
|
|
class TMCRegCache { |
|
|
public: |
|
|
public: |
|
|
TMCReg cache[50]; |
|
|
|
|
|
|
|
|
TMCReg cache[20]; |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
void foreach (function<void(TMCReg* item)> fn) { |
|
|
void foreach (function<void(TMCReg* item)> fn) { |
|
@ -52,7 +52,7 @@ class TMCRegCache { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void setReg(uint8_t reg, uint8_t val) { |
|
|
|
|
|
|
|
|
void setReg(uint8_t reg, int32_t val) { |
|
|
TMCReg* item = findReg(reg); |
|
|
TMCReg* item = findReg(reg); |
|
|
if (item) { |
|
|
if (item) { |
|
|
item->val = val; |
|
|
item->val = val; |
|
|