]> Repositories - Adafruit_Blinka-hackapet.git/blob - src/adafruit_blinka/microcontroller/ft232h/url.py
ee2cb62fb6852507d3166133b4786b07c00cf676
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / ft232h / url.py
1 """Support for getting the URL from the BLINKA_FT232H variable."""
2
3 import os
4
5 def get_ftdi_url():
6     """
7     Return the FTDI url to use. If BLINKA_FT232H starts with ftdi:, returns
8     that. Otherwise, returns a default value.  
9     """
10
11     url = os.environ.get("BLINKA_FT232H", "1")
12
13     if url.startswith("ftdi:"):
14         return url
15     else:
16         return "ftdi://ftdi:ft232h/1"