starting MCU development
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
@@ -10,6 +10,9 @@ if (DEFINED ENV{IDF_PATH})
|
||||
src/ui/SettingsMenu.cpp
|
||||
src/ui/SplashScreen.cpp
|
||||
INCLUDE_DIRS "include"
|
||||
PRIV_REQUIRES
|
||||
ruth
|
||||
u8g2
|
||||
)
|
||||
return()
|
||||
endif ()
|
||||
|
@@ -7,8 +7,7 @@ MenuItem::MenuItem(const uint8_t id, const uint8_t type, std::string text, Butto
|
||||
}
|
||||
|
||||
// Constructor for menu items with a single value (toggles)
|
||||
MenuItem::MenuItem(const uint8_t id, const uint8_t type, std::string text, std::string value,
|
||||
ButtonCallback callback)
|
||||
MenuItem::MenuItem(const uint8_t id, const uint8_t type, std::string text, std::string value, ButtonCallback callback)
|
||||
: m_id(id), m_type(type), m_text(std::move(text)), m_value(std::move(value)), m_callback(std::move(callback))
|
||||
{
|
||||
}
|
||||
@@ -95,10 +94,6 @@ MenuItem MenuItem::copyWith(const size_t index) const
|
||||
MenuItem copy = *this;
|
||||
|
||||
// Check for potential overflow when converting size_t to int
|
||||
if (index > std::numeric_limits<int>::max())
|
||||
{
|
||||
throw std::overflow_error("index is too large");
|
||||
}
|
||||
copy.m_index = static_cast<int>(index);
|
||||
return copy;
|
||||
}
|
@@ -36,7 +36,7 @@ void LightSettingsMenu::onButtonPressed(const MenuItem &menuItem, const ButtonTy
|
||||
if (m_options && m_options->persistence && m_options->persistence->save)
|
||||
{
|
||||
const auto key = "section_" + std::to_string(menuItem.getId());
|
||||
const auto &value = getItem(menuItem.getId()).getValue();
|
||||
const auto value = getItem(menuItem.getId()).getValue();
|
||||
m_options->persistence->save(key.c_str(), value.c_str());
|
||||
}
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
idf_component_register(SRCS
|
||||
"main.c"
|
||||
"setup.c"
|
||||
"button_handling.c"
|
||||
"main.cpp"
|
||||
"app_task.cpp"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES
|
||||
insa
|
||||
|
7
main/app_task.cpp
Normal file
7
main/app_task.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "app_task.h"
|
||||
#include "ui/SplashScreen.h"
|
||||
|
||||
void app_task(void *args)
|
||||
{
|
||||
///
|
||||
}
|
3
main/app_task.h
Normal file
3
main/app_task.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void app_task(void *args);
|
@@ -1,14 +1,5 @@
|
||||
#include "freertos/idf_additions.h"
|
||||
#include "setup.h"
|
||||
|
||||
void app_task(void *param)
|
||||
{
|
||||
setup();
|
||||
while (1)
|
||||
{
|
||||
loop();
|
||||
}
|
||||
}
|
||||
#include "app_task.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
Reference in New Issue
Block a user