Skip to content
Snippets Groups Projects
Commit efbce0ce authored by ave's avatar ave
Browse files

flow3r/profiling: allow ftop to be turned on in settings

parent b809e893
Branches
No related tags found
No related merge requests found
import sys_kernel import sys_kernel
from st3m import settings
class ftop: class ftop:
auto_enable = (
False # hiii this should be toggleable via settings at some point pls~
)
auto_interval_ms = 5000 # maybe this one too idk~ auto_interval_ms = 5000 # maybe this one too idk~
_auto_countdown_ms = 0 _auto_countdown_ms = 0
_max_name_len = 0 _max_name_len = 0
...@@ -17,7 +15,7 @@ class ftop: ...@@ -17,7 +15,7 @@ class ftop:
if a new report is scheduled and if so saves it in ftop.report. if a new report is scheduled and if so saves it in ftop.report.
Returns True if a new report has been generated, else false. Returns True if a new report has been generated, else false.
""" """
if ftop.auto_enable: if settings.onoff_debug_ftop.value and sys_kernel.usb_console_active():
ftop._auto_countdown_ms -= delta_t_ms ftop._auto_countdown_ms -= delta_t_ms
if ftop._auto_countdown_ms <= 0: if ftop._auto_countdown_ms <= 0:
ftop._auto_countdown_ms = ftop.auto_interval_ms ftop._auto_countdown_ms = ftop.auto_interval_ms
......
...@@ -180,6 +180,7 @@ onoff_button_swap = OnOffTunable("Swap Buttons", "system.swap_buttons", False) ...@@ -180,6 +180,7 @@ onoff_button_swap = OnOffTunable("Swap Buttons", "system.swap_buttons", False)
onoff_show_fps = OnOffTunable("Show FPS", "system.show_fps", False) onoff_show_fps = OnOffTunable("Show FPS", "system.show_fps", False)
onoff_debug = OnOffTunable("Debug Overlay", "system.debug", False) onoff_debug = OnOffTunable("Debug Overlay", "system.debug", False)
onoff_debug_touch = OnOffTunable("Touch Overlay", "system.debug_touch", False) onoff_debug_touch = OnOffTunable("Touch Overlay", "system.debug_touch", False)
onoff_debug_ftop = OnOffTunable("Debug: ftop", "system.ftop_enabled", False)
onoff_show_tray = OnOffTunable("Show Icons", "system.show_icons", True) onoff_show_tray = OnOffTunable("Show Icons", "system.show_icons", True)
onoff_wifi = OnOffTunable("Enable WiFi on Boot", "system.wifi.enabled", False) onoff_wifi = OnOffTunable("Enable WiFi on Boot", "system.wifi.enabled", False)
onoff_wifi_preference = OnOffTunable( onoff_wifi_preference = OnOffTunable(
...@@ -194,6 +195,7 @@ load_save_settings: List[UnaryTunable] = [ ...@@ -194,6 +195,7 @@ load_save_settings: List[UnaryTunable] = [
onoff_show_tray, onoff_show_tray,
onoff_button_swap, onoff_button_swap,
onoff_debug, onoff_debug,
onoff_debug_ftop,
onoff_debug_touch, onoff_debug_touch,
onoff_wifi, onoff_wifi,
onoff_wifi_preference, onoff_wifi_preference,
......
...@@ -218,6 +218,7 @@ settings_menu_structure: "MenuStructure" = [ ...@@ -218,6 +218,7 @@ settings_menu_structure: "MenuStructure" = [
onoff_show_tray, onoff_show_tray,
onoff_button_swap, onoff_button_swap,
onoff_show_fps, onoff_show_fps,
onoff_debug_ftop,
# onoff_debug, # onoff_debug,
# onoff_debug_touch, # onoff_debug_touch,
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment