Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit e7ec06f

Browse files
committed
Support boards without FPU
1 parent 10ae1f3 commit e7ec06f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

BlynkLib.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ def disconnect(self):
152152
def process(self, data=b''):
153153
if not (self.state == CONNECTING or self.state == CONNECTED): return
154154
now = gettime()
155-
if now - self.lastRecv > self.heartbeat+(self.heartbeat/2):
155+
if now - self.lastRecv > self.heartbeat+(self.heartbeat//2):
156156
return self.disconnect()
157-
if (now - self.lastPing > self.heartbeat/10 and
157+
if (now - self.lastPing > self.heartbeat//10 and
158158
(now - self.lastSend > self.heartbeat or
159159
now - self.lastRecv > self.heartbeat)):
160160
self._send(MSG_PING)
@@ -227,19 +227,24 @@ def connect(self):
227227
try:
228228
self.conn = socket.socket()
229229
self.conn.connect(socket.getaddrinfo(self.server, self.port)[0][4])
230-
self.conn.settimeout(0.05)
230+
try:
231+
self.conn.settimeout(eval('0.05'))
232+
except:
233+
self.conn.settimeout(0)
231234
BlynkProtocol.connect(self)
232235
except:
233236
raise ValueError('Connection with the Blynk server %s:%d failed' % (self.server, self.port))
234237

235238
def _write(self, data):
239+
#print('<', data.hex())
236240
self.conn.send(data)
237241
# TODO: handle disconnect
238242

239243
def run(self):
240244
data = b''
241245
try:
242246
data = self.conn.recv(self.buffin)
247+
#print('>', data.hex())
243248
except KeyboardInterrupt:
244249
raise
245250
except: # TODO: handle disconnect

0 commit comments

Comments
 (0)