From e2c33faf7967277caef91af445110afa95b2fc34 Mon Sep 17 00:00:00 2001 From: Alistair MacDonald Date: Wed, 29 Aug 2018 12:14:03 +0100 Subject: [PATCH] Small bug fix relating to interrupts afecting file transfer --- lib/sim800.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sim800.py b/lib/sim800.py index 518ad86..caa7893 100644 --- a/lib/sim800.py +++ b/lib/sim800.py @@ -676,6 +676,7 @@ def btsppwrite(connection, data): # Receive data from a Bluetooth serial connection def btsppread(connection): command() + global holdoffirq # Don't let the interupt process the buffer mid command holdoffirq = True request = "AT+BTSPPGET=3," + str(connection) + "\n" @@ -778,6 +779,7 @@ def fscreate(filename): # Read a chunk of data from a file on the flash storage def fsreadpart(filename, size=256, start=0): + global holdoffirq mode=int(start>0) command() # Don't let the interupt process the buffer mid command @@ -846,8 +848,8 @@ def callbuttonpressed_internal(nullparam=None): def endbuttonpressed_internal(nullparam=None): hangup() -# Startup... +# Startup... # Start turning on the SIM800 asynchronously onatstart = poweron(True)