]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tools/tinyos/misc/tos-storage-at45db.in
storage fix, change in test app. should not impact other users
[tinyos-2.x.git] / tools / tinyos / misc / tos-storage-at45db.in
index aa79f797bf6ed35d72e772107fd2b6c80269d1fb..0fe5872d1e3081c012df5d0b1ef0dddd9b80a02a 100644 (file)
@@ -18,15 +18,22 @@ import string
 import commands
 #New way of handling arguments........
 try:
-  opts, args = getopt(argv[1:], "t", [])
+  opts, args = getopt(argv[1:], "ts:f:", [])
 except GetoptError, err:
   print str(err) # will print something like "option -a not recognized"
-  stderr.write("Usage: tos-storage-at45db [-t] <platform directory>\n")
+  stderr.write("Usage: tos-storage-at45db [-t] [-s <sector size>] [-f <flash size in sectors>] <platform directory>\n")
   
+sector_size = 256
+flash_size = 2048 # in sectors
+
 cthreads = False
 for o, a in opts:
   if o == "-t":
     cthreads = True
+  elif o == "-s":
+    sector_size = int(a)
+  elif o == "-f":
+    flash_size = int(a)
   else:
     assert False, "unhandled option"
 
@@ -45,9 +52,6 @@ def nfail(s):
   stderr.write(s + "\n")
   exit(2)
 
-sector_size = 256
-flash_size = 2048 # in sectors
-
 volumes = {}
 volmap = []
 volumeNames = []