Skip to content

Commit

Permalink
contrib/rpc_examples: Remove 'ocd_' command prefix
Browse files Browse the repository at this point in the history
The prefix is not necessary anymore.

Change-Id: Ie0df06a70ff51e6719d7564396739d28618b0196
Signed-off-by: Marc Schink <[email protected]>
Reviewed-on: http:https://openocd.zylin.com/5190
Tested-by: jenkins
Reviewed-by: Antonio Borneo <[email protected]>
  • Loading branch information
Marc Schink authored and tom-van committed Jun 10, 2019
1 parent 215f14b commit c8184ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/rpc_examples/ocd_rpc_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ def _recv(self):
return data

def readVariable(self, address):
raw = self.send("ocd_mdw 0x%x" % address).split(": ")
raw = self.send("mdw 0x%x" % address).split(": ")
return None if (len(raw) < 2) else strToHex(raw[1])

def readMemory(self, wordLen, address, n):
self.send("array unset output") # better to clear the array before
self.send("mem2array output %d 0x%x %d" % (wordLen, address, n))

output = [*map(int, self.send("ocd_echo $output").split(" "))]
output = [*map(int, self.send("echo $output").split(" "))]
d = dict([tuple(output[i:i + 2]) for i in range(0, len(output), 2)])

return [d[k] for k in sorted(d.keys())]
Expand All @@ -116,8 +116,8 @@ def show(*args):
with OpenOcd() as ocd:
ocd.send("reset")

show(ocd.send("ocd_echo \"echo says hi!\"")[:-1])
show(ocd.send("capture \"ocd_halt\"")[:-1])
show(ocd.send("echo \"echo says hi!\"")[:-1])
show(ocd.send("capture \"halt\"")[:-1])

# Read the first few words at the RAM region (put starting adress of RAM
# region into 'addr')
Expand Down

0 comments on commit c8184ba

Please sign in to comment.