diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-14 16:35:14 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-14 16:35:14 +0100 |
commit | ec070c835af53174d4780ee395107fb60329a065 (patch) | |
tree | fcd0a6085cc1a05c8644150dc3685f8fcbd31461 /bin | |
parent | 62eccea6ba50cac4ce280137f5e272f7ec09f9d2 (diff) |
explain defaults
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/msp430-etv | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/msp430-etv b/bin/msp430-etv index 98b6893..075426a 100755 --- a/bin/msp430-etv +++ b/bin/msp430-etv @@ -7,16 +7,21 @@ import matplotlib.pyplot as plt import numpy as np import os import re +from shutil import which import subprocess import sys opt = dict() def measure_data(time): + # libmsp430.so must be available if not 'LD_LIBRARY_PATH' in os.environ: os.environ['LD_LIBRARY_PATH'] = '{}/var/projects/msp430/MSP430Flasher_1.3.7'.format(os.environ['HOME']) - energytrace_cmd = '{}/var/source/energytrace-util/energytrace'.format(os.environ['HOME']) + # https://github.com/carrotIndustries/energytrace-util must be available + energytrace_cmd = 'energytrace' + if which(energytrace_cmd) is None: + energytrace_cmd = '{}/var/source/energytrace-util/energytrace'.format(os.environ['HOME']) res = subprocess.run([energytrace_cmd, str(duration)], stdout = subprocess.PIPE, universal_newlines = True) |