summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2016-05-18 20:13:55 +0530
committerDmitry Shmidt <dimitrysh@google.com>2016-05-25 10:06:36 -0700
commit05700adf6b849ce20fa75924e889446d18255384 (patch)
tree1cefe211e195402991122d7dc53c3cb1cede1eab
parent283efca0edb7d101c812623cc8e5888d896ee0df (diff)
downloadhikey-05700adf6b849ce20fa75924e889446d18255384.tar.gz
hikey: hisi-idt.py: remove deprecated setTimeout
Replace Serial.setTimeout method with Serial.timeout property as setTimeout is deprecated. Caught and tested with python v2.7.11 on ubuntu 16.04lts update. This is also tested OK with ubuntu 14.04lts, python version 2.7.6. Change-Id: Ie68449500aff7aaa906830a222db89fd9fa7c540 Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
-rw-r--r--installer/hisi-idt.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/installer/hisi-idt.py b/installer/hisi-idt.py
index 071d4959..832f81c4 100644
--- a/installer/hisi-idt.py
+++ b/installer/hisi-idt.py
@@ -3,6 +3,7 @@
import os
import os.path
+
import serial, time
import array
import sys, getopt
@@ -113,7 +114,7 @@ class bootdownload(object):
print 'failed'
def sendstartframe(self):
- self.s.setTimeout(0.01)
+ self.s.timeout = 0.01
data = array.array('B', self.startframe[self.chip]).tostring()
crc = self.calc_crc(data)
data += chr((crc >> 8)&0xff)
@@ -121,7 +122,7 @@ class bootdownload(object):
self.sendframe(data,10000)
def sendheadframe(self,length,address):
- self.s.setTimeout(0.03)
+ self.s.timeout = 0.03
self.headframe[self.chip][4] = (length>>24)&0xff
self.headframe[self.chip][5] = (length>>16)&0xff
self.headframe[self.chip][6] = (length>>8)&0xff
@@ -141,7 +142,7 @@ class bootdownload(object):
def senddataframe(self,seq,data):
- self.s.setTimeout(0.15)
+ self.s.timeout = 0.15
head = chr(0xDA)
head += chr(seq&0xFF)
head += chr((~seq)&0xFF)