double check disabling ertm

This commit is contained in:
dekunukem
2022-01-28 10:03:15 +00:00
parent c77ea2a4ac
commit 6a7ea24052
4 changed files with 38 additions and 28 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,6 @@
scp ./* pi@192.168.1.56:~/usb4vc/rpi_app # scp ./* pi@192.168.1.65:~/usb4vc/rpi_app
# sh sync.sh; ssh -t pi@192.168.1.67 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_main.py"
scp ./* pi@192.168.1.65:~/usb4vc/rpi_app
ssh -t pi@192.168.1.65 "pkill python3;cd ~/usb4vc/rpi_app;python3 usb4vc_main.py"

View File

@@ -8,6 +8,7 @@ import usb4vc_ui
# usb4vc_ui.reset_pboard() # usb4vc_ui.reset_pboard()
os.system('echo 1 > /sys/module/bluetooth/parameters/disable_ertm')
os.system('sudo bash -c "echo 1 > /sys/module/bluetooth/parameters/disable_ertm"') os.system('sudo bash -c "echo 1 > /sys/module/bluetooth/parameters/disable_ertm"')
usb4vc_ui.ui_init() usb4vc_ui.ui_init()

View File

@@ -118,8 +118,8 @@ IBM_GGP_DEAULT_MAPPING = {
'ABS_RY': {'code':'IBM_GGP_JS2_Y'}, 'ABS_RY': {'code':'IBM_GGP_JS2_Y'},
'ABS_Z': {'code':'IBM_GGP_JS2_X'}, 'ABS_Z': {'code':'IBM_GGP_JS2_X'},
'ABS_RZ': {'code':'IBM_GGP_JS2_Y'}, 'ABS_RZ': {'code':'IBM_GGP_JS2_Y'},
# 'ABS_GAS':{'code':'IBM_GGP_JS2_YN'}, 'ABS_GAS':{'code':'IBM_GGP_JS2_YN'},
# 'ABS_BRAKE':{'code':'IBM_GGP_JS2_YP'}, 'ABS_BRAKE':{'code':'IBM_GGP_JS2_YP'},
} }
PROTOCOL_OFF = {'pid':0, 'display_name':"OFF"} PROTOCOL_OFF = {'pid':0, 'display_name':"OFF"}
@@ -623,10 +623,10 @@ class usb4vc_menu(object):
oled_print_centered("Power Down", font_medium, 10, draw) oled_print_centered("Power Down", font_medium, 10, draw)
if page == 1: if page == 1:
with canvas(oled_device) as draw: with canvas(oled_device) as draw:
oled_print_centered("Reboot", font_medium, 10, draw) oled_print_centered("Relaunch", font_medium, 10, draw)
if page == 2: if page == 2:
with canvas(oled_device) as draw: with canvas(oled_device) as draw:
oled_print_centered("Relaunch", font_medium, 10, draw) oled_print_centered("Reboot", font_medium, 10, draw)
if page == 3: if page == 3:
with canvas(oled_device) as draw: with canvas(oled_device) as draw:
oled_print_centered("Exit to Linux", font_medium, 10, draw) oled_print_centered("Exit to Linux", font_medium, 10, draw)
@@ -732,6 +732,8 @@ class usb4vc_menu(object):
self.goto_level(0) self.goto_level(0)
if level == 2: if level == 2:
if page == 0: if page == 0:
os.system('echo 1 > /sys/module/bluetooth/parameters/disable_ertm')
os.system('sudo bash -c "echo 1 > /sys/module/bluetooth/parameters/disable_ertm"')
self.switch_page(1) self.switch_page(1)
if page == 2: if page == 2:
self.goto_level(0) self.goto_level(0)
@@ -763,19 +765,21 @@ class usb4vc_menu(object):
if level == 5: if level == 5:
if page == 0: if page == 0:
with canvas(oled_device) as draw: with canvas(oled_device) as draw:
oled_print_centered("Shutting down...", font_medium, 10, draw) oled_print_centered("Wait Until Green", font_medium, 0, draw)
oled_print_centered("LED Turns Off", font_medium, 15, draw)
time.sleep(1)
os.system("sudo halt") os.system("sudo halt")
while 1: while 1:
time.sleep(1) time.sleep(1)
if page == 1: if page == 1:
oled_device.clear()
os._exit(0)
if page == 2:
with canvas(oled_device) as draw: with canvas(oled_device) as draw:
oled_print_centered("Rebooting...", font_medium, 10, draw) oled_print_centered("Rebooting...", font_medium, 10, draw)
os.system("sudo reboot") os.system("sudo reboot")
while 1: while 1:
time.sleep(1) time.sleep(1)
if page == 2:
oled_device.clear()
os._exit(0)
if page == 3: if page == 3:
oled_device.clear() oled_device.clear()
os._exit(169) os._exit(169)