Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eeb2790243e9
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8ea21f544d55
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Dec 20, 2014

  1. Copy the full SHA
    e489713 View commit details
  2. update dependencies

    sbourdeauducq committed Dec 20, 2014

    Verified

    This commit was signed with the committer’s verified signature.
    Mic92 Jörg Thalheim
    Copy the full SHA
    8ea21f5 View commit details
Showing with 7 additions and 21 deletions.
  1. +5 −19 artiq/coredevice/comm_serial.py
  2. +1 −1 doc/manual/installing.rst
  3. +1 −1 setup.py
24 changes: 5 additions & 19 deletions artiq/coredevice/comm_serial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import termios
import serial
import struct
import zlib
from enum import Enum
@@ -66,27 +65,14 @@ class Comm(AutoContext):
implicit_core = False

def build(self):
self._fd = os.open(self.serial_dev, os.O_RDWR | os.O_NOCTTY)
self.port = os.fdopen(self._fd, "r+b", buffering=0)
self.set_baud(115200)
self.port = serial.Serial(self.serial_dev, baudrate=115200)
self.port.flush()
self.set_remote_baud(self.baud_rate)
self.set_baud(self.baud_rate)

def set_baud(self, baud):
iflag, oflag, cflag, lflag, ispeed, ospeed, cc = \
termios.tcgetattr(self._fd)
iflag = termios.IGNBRK | termios.IGNPAR
oflag = 0
cflag |= termios.CLOCAL | termios.CREAD | termios.CS8
lflag = 0
ispeed = ospeed = getattr(termios, "B"+str(baud))
cc[termios.VMIN] = 1
cc[termios.VTIME] = 0
termios.tcsetattr(self._fd, termios.TCSANOW, [
iflag, oflag, cflag, lflag, ispeed, ospeed, cc])
termios.tcdrain(self._fd)
termios.tcflush(self._fd, termios.TCOFLUSH)
termios.tcflush(self._fd, termios.TCIFLUSH)
self.port.baudrate = baud
self.port.flush()
logger.debug("baud rate set to".format(baud))

def set_remote_baud(self, baud):
2 changes: 1 addition & 1 deletion doc/manual/installing.rst
Original file line number Diff line number Diff line change
@@ -164,7 +164,7 @@ Xubuntu 14.04 specific instructions

This command installs all the required packages: ::

$ sudo apt-get install build-essential autotools-dev file git patch perl xutils-devs python3-pip texinfo flex bison libmpc-dev python3-setuptools python3-numpy python3-scipy python3-sphinx python3-dev python-dev subversion cmake libusb-dev libftdi-dev pkg-config
$ sudo apt-get install build-essential autotools-dev file git patch perl xutils-devs python3-pip texinfo flex bison libmpc-dev python3-serial python3-prettytable python3-setuptools python3-numpy python3-scipy python3-sphinx python3-dev python-dev subversion cmake libusb-dev libftdi-dev pkg-config

Note that ARTIQ requires Python 3.4 or above.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
long_description = open("README.rst").read(),
license = "BSD",
install_requires = [
"sphinx", "numpy", "scipy", "prettytable"
"sphinx", "pyserial", "numpy", "scipy", "prettytable"
],
extras_require = {},
dependency_links = [],