def readBits(self, reg, bitStart, length):
        # 01101001 read byte
        # 76543210 bit numbers
        #    xxx   args: bitStart=4, length=3
        #    010   masked
        #   -> 010 shifted  
        
        b = self.readU8(reg)
        mask = ((1 << length) - 1) << (bitStart - length + 1)
        b &= mask
        b >>= (length + 1 - bitStart)
        
        return b
dataset/ETHPy150Open cTn-dev/PyComms/PyComms/pycomms.py/PyComms.readBits/swapped operands of `-`