chiark / gitweb /
Updated all lineends for py files to unix style.
[cura.git] / Cura / avr_isp / ispBase.py
index 5330d53e5205891bfc50a1535b27e0d62a735578..6c3537216d2244fcee404f9da588d6471039b117 100644 (file)
@@ -1,35 +1,35 @@
-import os, struct, sys, time\r
-\r
-from serial import Serial\r
-\r
-import chipDB\r
-\r
-class IspBase():\r
-       def programChip(self, flashData):\r
-               self.curExtAddr = -1\r
-               self.chip = chipDB.getChipFromDB(self.getSignature())\r
-               if self.chip == False:\r
-                       raise IspError("Chip with signature: " + str(self.getSignature()) + "not found")\r
-               self.chipErase()\r
-               \r
-               print("Flashing %i bytes" % len(flashData))\r
-               self.writeFlash(flashData)\r
-               print("Verifying %i bytes" % len(flashData))\r
-               self.verifyFlash(flashData)\r
-\r
-       #low level ISP commands\r
-       def getSignature(self):\r
-               sig = []\r
-               sig.append(self.sendISP([0x30, 0x00, 0x00, 0x00])[3])\r
-               sig.append(self.sendISP([0x30, 0x00, 0x01, 0x00])[3])\r
-               sig.append(self.sendISP([0x30, 0x00, 0x02, 0x00])[3])\r
-               return sig\r
-       \r
-       def chipErase(self):\r
-               self.sendISP([0xAC, 0x80, 0x00, 0x00])\r
-\r
-class IspError():\r
-       def __init__(self, value):\r
-               self.value = value\r
-       def __str__(self):\r
-               return repr(self.value)\r
+import os, struct, sys, time
+
+from serial import Serial
+
+import chipDB
+
+class IspBase():
+       def programChip(self, flashData):
+               self.curExtAddr = -1
+               self.chip = chipDB.getChipFromDB(self.getSignature())
+               if self.chip == False:
+                       raise IspError("Chip with signature: " + str(self.getSignature()) + "not found")
+               self.chipErase()
+               
+               print("Flashing %i bytes" % len(flashData))
+               self.writeFlash(flashData)
+               print("Verifying %i bytes" % len(flashData))
+               self.verifyFlash(flashData)
+
+       #low level ISP commands
+       def getSignature(self):
+               sig = []
+               sig.append(self.sendISP([0x30, 0x00, 0x00, 0x00])[3])
+               sig.append(self.sendISP([0x30, 0x00, 0x01, 0x00])[3])
+               sig.append(self.sendISP([0x30, 0x00, 0x02, 0x00])[3])
+               return sig
+       
+       def chipErase(self):
+               self.sendISP([0xAC, 0x80, 0x00, 0x00])
+
+class IspError():
+       def __init__(self, value):
+               self.value = value
+       def __str__(self):
+               return repr(self.value)