else:
print('GNSS init failed.')
- self.i2c0 = I2C(I2C.I2C0, I2C.STANDARD_MODE)
+ self.i2c0 = I2C(I2C.I2C0, I2C.FAST_MODE)
self.stop_temp( None, None)
def post_processor_after_instantiation(self):
EventMesh.publish("load_screen", {"screen": "message_full"})
- if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 or battery[1] != 1:
+ if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 and battery[1] != 1:
get_temp_time = EventMesh.publish("get_temp_time")
get_temp_state = EventMesh.publish("get_temp_state")
elif self.get_spo2_state != 0:
EventMesh.publish("set_spo2_state",0)#2代表后台进入测试
EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
+ if get_temp_state != 0:
+ self.temp_one_state = 0
+ self.temp_state = 0
+ temp = EventMesh.publish(constants.EVENT.GET_TEMP)
+ tmp_f = str(temp).split('.')[0]
+ tmp_f_tmp = int(tmp_f)
+
+ tmp_d = str(temp).split('.')[1][:1]
+ tmp_d_tmp = int(tmp_d)
+ EventMesh.publish("set_temp_state",0)
+ EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
+ EventMesh.publish(constants.EVENT.STOP_TEMP)
self.SENSOR_time = time_tmp
self.HR_Onestate = 0
self.HR_OneTime = 0
def Close(self):
pass
-
+ def lcd_on(self):
+ pass
+ def lcd_off(self):
+ pass
def done_left_to_right(self):
pass
self.phone_list = []
self.button = 0
self.timer = osTimer()
+ self.timer_cb = 0
self.count = 0
self.count = 0
phone_label.set_text(" ")
# print("self.phone_list :{} self.phone_num:{}".format(self.phone_list,self.phone_num))
- self.timer.start(1000,1,self.refresh_line)
+ if self.timer_cb == 0:
+ self.timer_cb = 1
+ self.timer.start(1000,1,self.refresh_line)
+
def refresh_line(self,e):
-
if self.count > 2 :
self.count = 1
- if (self.count%2) == 0:
+ if self.count%2 == 0:
phone_line.clear_flag(lv.obj.FLAG.HIDDEN)
else:
phone_line.add_flag(lv.obj.FLAG.HIDDEN)
def pressed_start(self,e):
self.button = 1
+ def Close(self):
+ self.timer_cb = 0
+ self.timer.stop()
def endpressed_start(self,e):
if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字
phone_label.set_size(len_t,48)
phone_label.set_pos(230-len_t,14)
phone_label.set_text(self.phone_num)
+
+ def lcd_on(self):
+ if self.timer_cb != 0:
+ self.timer_cb = 0
+ self.timer.start(1000,1,self.refresh_line)
+
+ def lcd_off(self):
+ self.timer_cb = 1
+ self.timer.stop()
+
def done_return(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
def refresh(self,e):
+ # print("call_in")
global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup
min = self.count_sec/60
sec = self.count_sec%60
def hangup(self,e):
EventMesh.publish("set_UI_high_priority", 0)
+ self.timer.stop()
voiceCall.callEnd()
+ def Close(self):
+ self.timer.stop()
def btn1_release(self):
pass
EventMesh.publish(constants.EVENT.STOP_TEMP)
def Close(self):
self.count = 0
+ self.temp_timer.stop()
EventMesh.publish("set_temp_state",0)
EventMesh.publish(constants.EVENT.STOP_TEMP)
- self.temp_timer.stop()
+
def done_return(self):
EventMesh.publish("load_screen", {"screen": "main_menu"})
countdown_sec.set_text(str("%02d"%(self.sec)))
countdown_min.set_text(str("%02d"%(self.min)))
countdown_hour.set_text(str("%02d"%(self.hour)))
-
+
+
def done_return(self):
if self.g_state == 0:
self.PWM_backlight = PWM(PWM.PWM1, PWM.ABOVE_MS, self.level, 10)
self.PWM_backlight.open()
self.sleep_lock = 0
+ self.screen.lcd_on()
def publish_call_in(self, event, msg):
EventMesh.publish("load_screen", {"screen": "dialing", "meta": msg})
utime.sleep_ms(100)
EventMesh.publish("set_lcd_state",self.sleep_flag)
self.sleep_lock = 0
+ self.screen.lcd_off()
def system_sleep(self, event, msg) :
self.__lcd_off()