self.KeyAI_timer = osTimer()
self.KeySOS_timer = osTimer()
self.KeySOS_timer_count = 0
+ self.KeySOS_timer_flag = 0
if dev_type == "G10" :
self.extint_AI = ExtInt(ExtInt.GPIO19,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb)
self.pwk_key = ExtInt(ExtInt.GPIO26, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb)
print("AI_key_press")
EventMesh.publish("AI_key_press")
def KeySos_timer_cb(self,*argc):
+ self.KeySOS_timer_flag = 0
if self.KeySOS_timer_count >= 3:
self.KeySOS_timer_count = 0
get_sos_flag = EventMesh.publish("get_sos_flag")
if get_sos_flag == 0:
EventMesh.publish("set_sos_info_call")
+ self.KeySOS_timer_count = 0
pass
def AI_key_long_press(self):
self.check_rest_timer_count = 0
def AI_key_release(self):
print("AI_key_release")
+ if self.KeySOS_timer_flag == 0:
+ self.KeySOS_timer_flag = 1
+ self.KeySOS_timer_count=0
+ self.KeySOS_timer.start(2000, 0, self.KeySos_timer_cb)
self.KeySOS_timer_count +=1
- self.KeySOS_timer.start(500, 0, self.KeySos_timer_cb)
EventMesh.publish("AI_key_release")
def pwk_key_Long_Press(self,event=None,msg=None):
def close_location(self,event,msg):
self.location_flag = 0
if wifiScan.getState() == True:
- print("关闭定位线程失败")
wifiScan.control(0)
# self.timer_read_GPS_info.stop()
+ if self.location_queue.empty() == False:
+ self.location_queue.clear()
if self.location_thread_id == 1:
try:
_thread.stop_thread(self.location_thread_id)
except Exception as e:
pass
self.location_thread_id=0
+ print("close_location:!!!!!!!!!")