Skip to content

Commit

Permalink
Merge pull request #2 from JoeSc/modifications
Browse files Browse the repository at this point in the history
Add git ignore and Fix issue with program command
  • Loading branch information
dberenguer committed Dec 4, 2015
2 parents 24acf10 + 803e3b3 commit 0789338
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
31 changes: 17 additions & 14 deletions swapdmt-cmd/swapmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,23 @@ def dispatch_command(self, command):
else:
# Program node
if command[2] == "program":
# Create progress bar
self.progress = AnimatedProgressBar(end=self.hexfile.nbof_data_lines, width=50)
# Save address of node being programmed
self.prog_address = addr
# Transmit product code
self.transmit_product_code()

# Put node in upgrade mode
val = SwapValue(SwapState.UPGRADE, 1)
if mote.cmdRegisterWack(SwapRegId.ID_SYSTEM_STATE, val):
print "Node now in programming mode"
elif self.hexfile_line == 0:
print "Unable to put node in progamming mode"
self.prog_address = None
if (self.hexfile == None):
print "Please set a hexfile before running \"program\""
else:
# Create progress bar
self.progress = AnimatedProgressBar(end=self.hexfile.nbof_data_lines, width=50)
# Save address of node being programmed
self.prog_address = addr
# Transmit product code
self.transmit_product_code()

# Put node in upgrade mode
val = SwapValue(SwapState.UPGRADE, 1)
if mote.cmdRegisterWack(SwapRegId.ID_SYSTEM_STATE, val):
print "Node now in programming mode"
elif self.hexfile_line == 0:
print "Unable to put node in progamming mode"
self.prog_address = None
# Restart node (if not sleeping)
elif command[2] == "restart":
if mote.restart():
Expand Down

0 comments on commit 0789338

Please sign in to comment.