Sygaldry
Loading...
Searching...
No Matches
sygbe-runtime.hpp
1#pragma once
2/*
3Copyright 2023 Travis J. West, Input Devices and Music Interaction Laboratory
4(IDMIL), Centre for Interdisciplinary Research in Music Media and Technology
5(CIRMMT), McGill University, Montréal, Canada, and Univ. Lille, Inria, CNRS,
6Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
7
8SPDX-License-Identifier: MIT
9*/
10
11#include <stdio.h>
12#include <freertos/FreeRTOS.h>
13#include <freertos/task.h>
14#include "sygac-runtime.hpp"
15#include "sygsa-two_wire.hpp"
16#include "syghe-pins.hpp"
17#include "sygbe-spiffs.hpp"
18#include "sygbe-wifi.hpp"
19#include "sygbp-liblo.hpp"
20#include "sygbp-cstdio_cli.hpp"
21
22namespace sygaldry { namespace sygbe {
23
27
31
39template<typename InnerInstrument>
41{
42 struct Instrument {
50 Components components;
51 #if defined SYGALDRY_ESP32S3
52 // TODO: enable usb CDC
53 #endif
55 };
56
57 static_assert(Assembly<Instrument>);
58
59 static inline Instrument instrument{};
60
61 void app_main()
62 {
63 constexpr auto runtime = Runtime{instrument};
64 // give electrical conditions a moment to settle in
65 vTaskDelay(pdMS_TO_TICKS(1000));
66 printf("initializing\n");
67 runtime.init();
68 // give IDF processes time to finish up init business
69 vTaskDelay(pdMS_TO_TICKS(100));
70 printf("looping\n");
71 while (true)
72 {
73 runtime.tick();
74 vTaskDelay(pdMS_TO_TICKS(10));
75 }
76 }
77};
78
81
82} }
Definition sygac-components.hpp:161
Cli< CstdioReader, sygup::CstdioLogger, Components > CstdioCli
Definition sygbp-cstdio_cli.hpp:24
Wrapper for a component assemblage that calls init and main of all subcomponents that aren't parts.
Definition sygac-runtime.hpp:150
Definition sygbe-runtime.hpp:42
Runtime wrapper for ESP32 platform.
Definition sygbe-runtime.hpp:41
Definition sygbe-spiffs.hpp:49
Definition sygbe-wifi.hpp:40
Definition sygbp-liblo.hpp:35
Definition sygsa-two_wire.hpp:29