Browse Source

Tweak install

pull/2/head
Fernando Trias 4 years ago
parent
commit
79c24dd644
  1. 2
      README.md
  2. 24
      teensy_debug
  3. BIN
      teensy_debug.exe

2
README.md

@ -165,7 +165,7 @@ These are the commands implemented so far:
* `analogRead(pin)` -> returns analog input from pin
* `analogWrite(pin, value)`
* `restart` -> reboot Teensy
* `call(addr [,p1 [,p2 [,p3]]])` -> call a function at address. The function takes only integers (or pointers) as parameters (up to 3) and returns an integer that is displayed back to the user. Address must be numeric. You can get the address of a function with the `p` command as in `p funcname`. For example if `int fx(int x)` is located at `0xc8`, the command would be `monitor call(0xc8,1)`.
* `call(addr [,p1 [,p2 [,p3]]])` -> call a function at address. The function takes only integers (or pointers) as parameters (up to 3) and returns an integer that is displayed back to the user. Address must be numeric. You can get the address of a function with the `p` command as in `p funcname`. For example if `int fx(int x)` is located at `0xc8`, as shown by `p fx`, then the command to return `fx(5)` would be `monitor call(0xc8,5)`.
File IO command
-------------------------------------------

24
teensy_debug

@ -59,7 +59,7 @@ def parseCommandLine(x=None):
def askUser(question):
print(question)
print("[y/n] ? ", end='')
print("[y/N]? ", end='')
ask = input()
if ask[0] == 'y' or ask[0] == 'Y':
return True
@ -72,11 +72,6 @@ def pauseUser():
def installGDB():
global args
ask = askUser("Do you want to install GDB support for Teensyduino?")
if not ask:
return 0
print("Install GDB in Teensyduino")
if os.name == 'nt':
@ -99,7 +94,7 @@ def installGDB():
else:
DIR = APPDIR + "Arduino.app/"
else:
DIR = "~/arduino/"
DIR = expanduser("~") + "/arduino/"
while(True):
if os.path.exists(DIR + "hardware"):
@ -122,7 +117,7 @@ def installGDB():
while(not os.path.exists(DEST)):
print("Custom library folder not found in %s" % DEST)
print("Where is Arduino installed? ")
print("Where are custom libraries installed? ")
print("? ", end='')
DEST = input()
DEST = DEST.strip() + "/"
@ -163,6 +158,7 @@ def installGDB():
print("Copy %s to %s" % (i, dest))
shutil.copy(i, dest)
print("Copy examples to %s" % (dest))
try:
shutil.rmtree(dest + '/examples')
except:
@ -175,7 +171,7 @@ def createFiles(AVR):
print("Create %s/boards.local.txt" % (AVR))
with open(AVR + "boards.local.txt", "w+") as f:
f.write("menu.gdb=GDB\n")
for ver in ('41','40','32'):
for ver in ('41','40'):
f.write("""
teensy%s.menu.gdb.serial=Take over Serial
teensy%s.menu.gdb.serial.build.gdb=2
@ -245,11 +241,12 @@ def getPort():
devs.append(dev)
if len(devs) <= 0:
print("Could not find a extra Serial device. Did you compile one?")
exit(1)
print("Could not find an extra Serial device. Did you compile one?")
return None
# get the last port found
usedev = sorted(devs)[-1]
print("Found devices", usedev)
return usedev
def runGDB(arguments):
@ -290,6 +287,9 @@ def runGDB(arguments):
usedev = getPort()
if usedev is None:
return
gpath=args.tools + "/arm/bin/"
GDB=convertPathSlashes("%s/arm-none-eabi-gdb" % gpath)
@ -334,7 +334,7 @@ def runOnWindows(command):
# run in separate terminal
# print("batch file is %s" % f.name)
os.system("start %s" % f.name)
# os.system("start %s" % command)
# os.system(command)
# subprocess.run(["cmd.exe", "/k", f.name])
def runCommand(command):

BIN
teensy_debug.exe

Binary file not shown.
Loading…
Cancel
Save