WuMRC / drive

32 stars 22 forks source link

There is a small mistake in AD5933.cpp, line 29 #28

Open wojiaodingsan opened 3 years ago

wojiaodingsan commented 3 years ago

The code in AD5933_Library--AD5933.cpp, Line 29: tTempVal = (tTemp[0] % (12 16)) 16 * 16 + tTemp[1];

I think the author want to extract the lower 5 digits in tTemp[0], which means the D4-D0 in 0x92. However if use tTemp[0] % (1216), it is possible to extract the D5-D7 digits. For example, if the tTemp[0] = 0100 0000, the tTemp[0] % (1216) = 0100 0000, more than lower 5 digits. I think this might be better: "tTempVal = (tTemp[0] % (416)) 1616 + tTemp[1]" or "tTempVal = (tTemp[0] & 0x1F)16*16 + tTemp[1]".