Code
Consider this code fragment in your version v0.2.2:
|
uint8_t MSB = (Duration & 0xFF) >> 8; |
|
uint8_t LSB = Duration & 0xFF; |
|
|
|
// 1st bit, set 3D or Dual |
|
if(mode == eRunMode::Mode3D) MSB |= (1 << 4); |
|
// 2nd bit, set Auto or Fixed |
|
if(setAutoDuration == false) MSB |= (1 << 3); |
Problems
Suggested fixes
`
// Reset the highest two bits of Duration and mask out the lower byte,
// then shift right.
uint8_t MSB = (Duration & 0x3F00) >> 8;
uint8_t LSB = Duration & 0xFF;
// 1st bit, set 3D or Dual
if(mode == eRunMode::ModeDual) MSB |= (1 << 7);
// 2nd bit, set Auto or Fixed
if(setAutoDuration == false) MSB |= (1 << 6);
`
Referenced manual
Screenshot from this manual:

Code
Consider this code fragment in your version v0.2.2:
cyglidar_d1/src/cyglidar_pcl.cpp
Lines 69 to 75 in b30e990
Problems
uint8_t MSB = (Duration & 0xFF) >> 8;
Results in MSB = 0 at all times. So the higher part of the duration is lost.
bit adjustment for different modes is on wrong bits with wrong values
Suggested fixes
`
// Reset the highest two bits of Duration and mask out the lower byte,
// then shift right.
uint8_t MSB = (Duration & 0x3F00) >> 8;
uint8_t LSB = Duration & 0xFF;
// 1st bit, set 3D or Dual
if(mode == eRunMode::ModeDual) MSB |= (1 << 7);
// 2nd bit, set Auto or Fixed
if(setAutoDuration == false) MSB |= (1 << 6);
`
Referenced manual

Screenshot from this manual: