Skip to content

Commit

Permalink
feat: go to idle mode after data reading
Browse files Browse the repository at this point in the history
  • Loading branch information
redrathnure committed Jan 18, 2025
1 parent 61ffb95 commit 3d6dfe7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/NanoVNASaver/Hardware/litevna_64.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,21 @@ def _exit_usb_mode(self) -> None:
pack("<BBB", _CMD_WRITE, _ADDR_RAW_SAMPLES_MODE, 2)
)
sleep(WRITE_SLEEP)

def readValues(self, value) -> list[complex]:
result = super().readValues(value)
self._exit_usb_mode()
return result

def setSweep(self, start, stop):
# Device loose these value after going to idle mode
# Do not try to cache them locally
step = (stop - start) / (self.datapoints - 1)
self.sweepStartHz = start
self.sweepStepHz = step
logger.info(
"NanoVNAV2: set sweep start %d step %d",
self.sweepStartHz,
self.sweepStepHz,
)
self._updateSweep()

0 comments on commit 3d6dfe7

Please sign in to comment.