Loading files
/*
MIT License
Copyright (c) 2023 Vaclav Mach (Bastl Instruments)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Main stuff
#include "common/core/Kastle2.hpp"
#include "common/testmode/VersionChainGenerator.hpp"
#include "apps/Calibration/AppCalibration.hpp"
#include "samples_calibration.hpp"
#include "version_samples_app.hpp"
using namespace kastle2;
/**
* @file main.cpp
* @brief Main entry point for Kastle 2 firmware.
* @author Vaclav Mach (Bastl Instruments)
* @date 2023-11-28
*/
// You can define this using a version number, eg. "1.6" or other words specified in version_samples.hpp
#define APP_VERSION "draft"
AppCalibration app;
static void process_audio(q15_t *input, q15_t *output, size_t size)
{
app.AudioLoop(input, output, size);
}
int main()
{
// Create the version chain (for announcement in Test Mode)
auto version_chain = VersionChainGenerator::Generate(version::calibration, APP_VERSION);
// Initializes the hardware, passing the version chain
Kastle2::Init(std::span<SamplePlayer16bit::Sample>(version_chain));
// Register it with the Kastle 2
// Clears the EEPROM app space if the ID is different
Kastle2::RegisterApp(&app);
// Initialize the app
app.Init();
// Start I2S
Kastle2::StartAudio(process_audio);
// Infinite program loop
while (true)
{
Kastle2::ReadInputs();
app.UiLoop();
}
return 0;
}
23c2f680aThis file is pinned to the selected release. Download the original to open it in your design tool.