Sygaldry
Loading...
Searching...
No Matches
sygbr-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 "pico/stdlib.h"
13#include "hardware/gpio.h"
14#include "sygac-runtime.hpp"
15#include "sygbr-cli.hpp"
16
17namespace sygaldry { namespace sygbr {
18
22
26
34template<typename InnerInstrument>
36{
37 struct Instrument {
38 struct Components {
39 InnerInstrument instrument;
40 //sygbr::WiFi wifi;
41 //sygbp::LibloOsc<InnerInstrument> osc;
42 };
43 //sygbr::FlashSessionStorage<Components> session_storage;
44 Components components;
46 };
47
48 static inline Instrument instrument{};
49
50 void main()
51 {
52 constexpr auto runtime = Runtime{instrument};
53 const uint LED_PIN = 25;
54
55 stdio_init_all();
56 sleep_ms(1000);
57 puts("initializing\n");
58 runtime.init();
59
60 gpio_init(LED_PIN);
61 gpio_set_dir(LED_PIN, GPIO_OUT);
62
63 puts("looping\n");
64 while (true)
65 {
66 runtime.tick();
67
68 gpio_put(LED_PIN, 0);
69 sleep_ms(250);
70 gpio_put(LED_PIN, 1);
71 sleep_ms(250);
72 }
73 }
74};
75
78
79} }
sygbp::Cli< PicoReader, sygup::CstdioLogger, Components > PicoCli
Definition sygbr-cli.hpp:47
Wrapper for a component assemblage that calls init and main of all subcomponents that aren't parts.
Definition sygac-runtime.hpp:150
Definition sygbr-runtime.hpp:37
Runtime wrapper for Raspberry Pi Pico SDK platform.
Definition sygbr-runtime.hpp:36