smartpi 0.1.27__py3-none-any.whl → 0.1.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smartpi/__init__.py +1 -1
- smartpi/base_driver.py +8 -24
- {smartpi-0.1.27.dist-info → smartpi-0.1.28.dist-info}/METADATA +1 -1
- {smartpi-0.1.27.dist-info → smartpi-0.1.28.dist-info}/RECORD +6 -6
- {smartpi-0.1.27.dist-info → smartpi-0.1.28.dist-info}/WHEEL +0 -0
- {smartpi-0.1.27.dist-info → smartpi-0.1.28.dist-info}/top_level.txt +0 -0
smartpi/__init__.py
CHANGED
smartpi/base_driver.py
CHANGED
|
@@ -575,28 +575,8 @@ def shut_down():
|
|
|
575
575
|
serial_lock.release() #释放线程锁
|
|
576
576
|
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
577
577
|
time.sleep(0.5)
|
|
578
|
-
|
|
579
|
-
def shut_down_state() -> bool:
|
|
580
|
-
serial_lock.acquire() #获取线程锁
|
|
581
|
-
fcntl.flock(ser.fileno(), fcntl.LOCK_EX) # 进程锁,阻塞其他进程
|
|
582
|
-
response =process_received_data()
|
|
583
|
-
if response:
|
|
584
|
-
receive_data = response[4:-3]
|
|
585
|
-
if receive_data[0]==0XFF and receive_data[1]==0XFE:
|
|
586
|
-
serial_lock.release() #释放线程锁
|
|
587
|
-
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
588
|
-
return True
|
|
589
|
-
else:
|
|
590
|
-
buffer.clear()
|
|
591
|
-
serial_lock.release() #释放线程锁
|
|
592
|
-
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
593
|
-
return False
|
|
594
|
-
else:
|
|
595
|
-
serial_lock.release() #释放线程锁
|
|
596
|
-
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
597
|
-
return False
|
|
598
578
|
|
|
599
|
-
def
|
|
579
|
+
def power_button_detec() -> bytes:
|
|
600
580
|
serial_lock.acquire() #获取线程锁
|
|
601
581
|
fcntl.flock(ser.fileno(), fcntl.LOCK_EX) # 进程锁,阻塞其他进程
|
|
602
582
|
response =process_received_data()
|
|
@@ -605,16 +585,20 @@ def exit_program() -> bool:
|
|
|
605
585
|
if receive_data[0]==0XFF and receive_data[1]==0XFD:
|
|
606
586
|
serial_lock.release() #释放线程锁
|
|
607
587
|
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
608
|
-
return
|
|
588
|
+
return 1
|
|
589
|
+
elif receive_data[0]==0XFF and receive_data[1]==0XFE:
|
|
590
|
+
serial_lock.release() #释放线程锁
|
|
591
|
+
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
592
|
+
return 2
|
|
609
593
|
else:
|
|
610
594
|
buffer.clear()
|
|
611
595
|
serial_lock.release() #释放线程锁
|
|
612
596
|
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
613
|
-
return
|
|
597
|
+
return 0
|
|
614
598
|
else:
|
|
615
599
|
serial_lock.release() #释放线程锁
|
|
616
600
|
fcntl.flock(ser.fileno(), fcntl.LOCK_UN) # 释放进程锁
|
|
617
|
-
return
|
|
601
|
+
return 0
|
|
618
602
|
|
|
619
603
|
def buf_clear():
|
|
620
604
|
buffer.clear()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
smartpi/__init__.py,sha256=
|
|
2
|
-
smartpi/base_driver.py,sha256=
|
|
1
|
+
smartpi/__init__.py,sha256=jfBxodXnOKynv0a2moORso7YKZjdwbyIjWdR3N3yvsY,55
|
|
2
|
+
smartpi/base_driver.py,sha256=Nup2dkW2mURpl6wazsK1CIjkDdyTI0zR2e94SCwfU1Y,24396
|
|
3
3
|
smartpi/color_sensor.py,sha256=YXJjknYjp7teTZsHYZRAWgi73CH0MhBp1go9y0Inxyo,498
|
|
4
4
|
smartpi/cw2015.py,sha256=1lAF-pi_ye_ya1AZQS1sjbgsDf7MThO5IAskKsNGBzA,5695
|
|
5
5
|
smartpi/flash.py,sha256=-pUqg6FSVoBiLFKqrG9B4dFqn8lICnQsSPJr_MtZLIU,4132
|
|
@@ -14,7 +14,7 @@ smartpi/temperature.py,sha256=VT79CYA41q1d_4AM-Y0eIMeIw7AtCkSXjWVws6Yx5yE,462
|
|
|
14
14
|
smartpi/touch_sensor.py,sha256=P57RRQlqY0KexpMi-ydqwF5albOKCBOGb0Rb6zeVTqk,440
|
|
15
15
|
smartpi/trace.py,sha256=tut7BMbq87ShaR5eNuv7PZtAEz9DS5_BDf0_muIZ-tQ,4577
|
|
16
16
|
smartpi/ultrasonic.py,sha256=kmVpUfvE1oHoqgv92ZU6Fi-sO6DSwm10ssKsImNeOkY,624
|
|
17
|
-
smartpi-0.1.
|
|
18
|
-
smartpi-0.1.
|
|
19
|
-
smartpi-0.1.
|
|
20
|
-
smartpi-0.1.
|
|
17
|
+
smartpi-0.1.28.dist-info/METADATA,sha256=qruw894MPGjH8BBu9H3XtYYzckjRbwcbkVOnv88Bcu4,311
|
|
18
|
+
smartpi-0.1.28.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
19
|
+
smartpi-0.1.28.dist-info/top_level.txt,sha256=PoLhUCmWAiQUg5UeN2fS-Y1iQyBbF2rdUlizXtpHGRQ,8
|
|
20
|
+
smartpi-0.1.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|