Skip to content

Commit

Permalink
fixed menu
Browse files Browse the repository at this point in the history
  • Loading branch information
robsoncouto committed Dec 18, 2016
1 parent 6b1c02c commit 722d9a1
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions eprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
print(" www.dragaosemchama.com.br")
print(" github.com/robsoncouto/eprom\n")

#Default value, 1MB chip:
romsize=1*1024*1024
numsectors=int(romsize/128) # I am sending data in 128 byte chunks


while True:
Expand All @@ -27,12 +30,13 @@
print(" 1-Read eprom ")
print(" 2-burn eprom ")
print(" 3-about this script ")
print(" 4-quit \n")
print(" 4-blank check ")
print(" 5-select chip size ")
print(" ")
print(" 6-quit \n")

option=int(input("Please insert a number:"))
romsize=1*1024*1024
numsectors=int(romsize/128) # I am sending data in 128 byte chunks
block=0

if(option==1):
name=input("What the name of the file?")

Expand Down Expand Up @@ -88,17 +92,14 @@
if response!=CHK:
print("wrong checksum, sending chunk again\n")
f.close()
if(option==4):
print("See ya!")
break

if(option==3):

print("\nA more detailed write up about this project is available at www.dragaosemchama.com.br")
print("This script goes together with a Arduino sketch, both are used to read and program")
print("eproms on the cheap.")
print("Written by Robson Couto\n")
if(option==5):
if(option==4):
ser.flushInput()
ser.write(b"\x55")
ser.write(bytes("r","ASCII"))
Expand All @@ -118,3 +119,14 @@
else:
print("\nThe chip seems to contain data\n")
print("Done\n")
if(option==5):
print("Current eprom size:",romsize/(1024*1024),"MB\n")
megs=float(input("Please insert the size of the eprom in Megabytes"))
romsize=megs*1024*1024
numsectors=int(romsize/128) # I am sending data in 128 byte chunks
print("Eprom size changed to ",romsize/(1024*1024),"MB\n")


if(option==6):
print("See ya!")
break

0 comments on commit 722d9a1

Please sign in to comment.