Revision: 1643
Author: [email protected]
Date: Fri Jan 29 16:06:36 2010
Log: fixed bootloader exception issue, and change default start address to 0x800 (avoids accidental erasing/writing bootloader)
http://code.google.com/p/jallib/source/detail?r=1643

Modified:
/trunk/project/pic18f14k50_usb_io/bootloader/host_bootloader_application/UsbBootLoader.py /trunk/project/pic18f14k50_usb_io/bootloader/host_bootloader_application/UsbBootLoaderDriver.py

=======================================
--- /trunk/project/pic18f14k50_usb_io/bootloader/host_bootloader_application/UsbBootLoader.py Mon Sep 28 14:09:16 2009 +++ /trunk/project/pic18f14k50_usb_io/bootloader/host_bootloader_application/UsbBootLoader.py Fri Jan 29 16:06:36 2010
@@ -2,7 +2,7 @@
 #
 #
 # Title: jallib USB bootloader (auto start) application
-# Author: Albert Faber, Copyright (c) 2009, all rights reserved.
+# Author: Albert Faber, Copyright (c) 2009 - 2010, all rights reserved.
 # Adapted-by:
 # Compiler:
 #
@@ -226,7 +226,7 @@
                self.flash_hex = intelhex.IntelHex()

                if ( start_address == None ) :
-                       start_address = 0
+                       start_address = 0x800

                if ( end_address == None ) :
                        end_address = self.program_flash_size
@@ -450,11 +450,17 @@
        reset = False

        try:
+               # print "args "
+               # print sys.argv[1:]
                opts, args = getopt.getopt(sys.argv[1:], "hceir:vx",
["help", "configuration", "eeprom", "id-location", "range=",
                                          "verbose","reset"])

+               # print opts
+               # print args
+
                for o, a in opts:
+                       # print "o is " + o
                        if o in ("-h", "--help"):
                                print usage
                                sys.exit(0)
@@ -485,6 +491,8 @@
                                                start = int(l[0], 16)
                                                if l[1] != '':
                                                        end = int(l[1], 16)
+                                       # print "start %d" & start
+                                       # print "end %d" & end
                                except:
                                        raise getopt.GetoptError, 'Bad range 
value(s)'
                        elif o in ("-v", "--verbose"):
=======================================
--- /trunk/project/pic18f14k50_usb_io/bootloader/host_bootloader_application/UsbBootLoaderDriver.py Mon Sep 28 14:09:16 2009 +++ /trunk/project/pic18f14k50_usb_io/bootloader/host_bootloader_application/UsbBootLoaderDriver.py Fri Jan 29 16:06:36 2010
@@ -2,7 +2,7 @@
 #
 #
 # Title: jallib USB bootloader driver
-# Author: Albert Faber, Copyright (c) 2009, all rights reserved.
+# Author: Albert Faber, Copyright (c) 2009 - 2010, all rights reserved.
 # Adapted-by:
 # Compiler:
 #
@@ -44,9 +44,11 @@
                  return None


-class UsbBootLoaderDriverError( IOError ):
-       "errors raised by UsbBootLoaderDriver, derived from IOError"
-       pass
+class UsbBootLoaderDriverError(Exception):
+    def __init__(self, value):
+        self.value = value
+    def __str__(self):
+        return repr(self.value)


 class UsbBootLoaderDriver():
@@ -77,17 +79,13 @@
        tx_buffer = []
        rx_buffer = []

-       Error_Prefix = ''
-
        # make device descriptor
        device_descriptor = DeviceDescriptor(VENDOR_ID, PRODUCT_ID, 
INTERFACE_ID )


        def Raise( self, Message ):
                """raise a UsbBootLoaderDriver with suitable prefix"""
-               # print "RAISE EXCEPTION"
-               #raise UsbBootLoaderDriverError, self.Error_Prefix + Message
-               raise Message
+               UsbBootLoaderDriverError( Message )


        def __init__(self,) :

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to