123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /*
- * main.c
- *
- * Copyright (c) 2022 - 2023 Thomas Buck (thomas@xythobuz.de)
- *
- * 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.
- *
- * See <http://www.gnu.org/licenses/>.
- */
-
- #include "pico/stdlib.h"
- #include "hardware/watchdog.h"
-
- #include "config.h"
- #include "util.h"
- #include "console.h"
- #include "log.h"
- #include "usb.h"
- #include "buttons.h"
- #include "lcd.h"
- #include "main.h"
-
- void main_loop_hw(void) {
- watchdog_update();
- usb_run();
- heartbeat_run();
- }
-
- int main(void) {
- watchdog_enable(WATCHDOG_PERIOD_MS, 1);
-
- // detect hardware type
- // TODO
-
- // required for debug console
- cnsl_init();
- usb_init();
- debug("init");
-
- if (watchdog_caused_reboot()) {
- debug("reset by watchdog");
- }
-
- buttons_init();
-
- debug("go");
-
- while (1) {
- main_loop_hw();
- buttons_run();
- cnsl_run();
- }
-
- return 0;
- }
|