code: def dec_ptr(self, ptr):
          
          result = ptr - self.reading_len[self.ws_type]
          if result < self.data_start:
              result = 0x10000 - self.reading_len[self.ws_type]
          return result
docs: Get previous circular buffer data pointer.