""" uv-belichter-software - The main program run at the Pi Picos startup Copyright (C) 2024 Benjamin Burkhardt This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . """ import utils from lcdMenu import lcdMenu from WelcomeScreen import WelcomeScreen from gc import collect # garbage collector for better memory performance config = utils.Config() btn_mapping = {"ok_btn": config.PIN_IN_BTN_1, "next_btn": config.PIN_IN_BTN_2} # the btn mapping for all lcdMenus # extra functions to access the garbage collector def timers(): import programs.timers as t t.run(config, btn_mapping, utils.log, lcdMenu) del t collect() return True def manual(): import programs.manual as m m.run(config) del m collect() return True def demos(): import programs.demos as d d.run(config, btn_mapping, utils.log, lcdMenu) del d collect() return True def settings(): import programs.settings as s s.run(config, btn_mapping, utils.log, lcdMenu) del s collect() return True # create the main menu main_menu = lcdMenu(config.LCD, btn_mapping, scroll_direction=True, cycle=True, hide_menu_name=False, name="PROGRAMS") main_programs = [("Timers", timers), ("Manual", manual), ("Demos", demos), ("Settings", settings)] main_menu.setup(main_programs) # give it the callback list # ------- # run the welcome screen as defined in the config file if config.STARTUP_WELCOME_SHOW: ws = WelcomeScreen(config.LCD, interrupt_pins=[config.PIN_IN_BTN_1, config.PIN_IN_BTN_2, config.PIN_IN_SWITCH], subtitle=config.STARTUP_PROJECT_NAME, starting_msg=config.STARTUP_MESSAGE_STARTING, started_msg=config.STARTUP_MESSAGE_FINISHED) ws.show(cycles=config.STARTUP_WELCOME_CYCLES) del ws collect() # and run the main menu (will be an endless loop) main_menu.run()