Implement the SHR16::SetTMCDir stub for testing

pull/47/head
Yuri D'Elia 2021-07-11 20:33:59 +02:00
parent b01a819644
commit 5250cfd4fe
1 changed files with 10 additions and 1 deletions

View File

@ -6,20 +6,29 @@ namespace shr16 {
SHR16 shr16; SHR16 shr16;
uint16_t shr16_v_copy; uint16_t shr16_v_copy;
uint8_t shr16_tmc_dir;
void SHR16::Init() { void SHR16::Init() {
shr16_v_copy = 0; shr16_v_copy = 0;
shr16_tmc_dir = 0;
} }
void SHR16::SetLED(uint16_t led) { void SHR16::SetLED(uint16_t led) {
shr16_v_copy = ((led & 0x00ff) << 8) | ((led & 0x0300) >> 2); shr16_v_copy = ((led & 0x00ff) << 8) | ((led & 0x0300) >> 2);
} }
void SHR16::SetTMCEnabled(uint8_t index, bool ena) { void SHR16::SetTMCEnabled(uint8_t index, bool ena) {
// do nothing right now // do nothing right now
} }
void SHR16::SetTMCDir(uint8_t index, bool dir) { void SHR16::SetTMCDir(uint8_t index, bool dir) {
// do nothing right now // this is using another array for testing convenience
if (dir)
shr16_tmc_dir |= (1 << index);
else
shr16_tmc_dir &= ~(1 << index);
} }
void SHR16::Write(uint16_t v) { void SHR16::Write(uint16_t v) {
// do nothing right now // do nothing right now
} }