Boot splash and more (#98)

* Boot splash and more

- Added developer sdkconfig
- Refactored the way FreeRTOS includes are included
- Improved Gui/Loader logic
- Implemented boot app with splash screen

* Updated naming for Gui and Loader services

* Renamed Screenshot service methods

* Renames

* Service renames
This commit is contained in:
Ken Van Hoeylandt
2024-11-30 15:37:16 +01:00
committed by GitHub
parent 3f62ec2efa
commit 0188ce721c
60 changed files with 726 additions and 307 deletions
+1 -8
View File
@@ -2,14 +2,7 @@
#include "CoreDefines.h"
#include "Log.h"
#ifdef ESP_TARGET
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#else
#include "FreeRTOS.h"
#include "task.h"
#endif
#include "RtosCompatTask.h"
#define TAG "kernel"
+1 -8
View File
@@ -1,14 +1,7 @@
#pragma once
#include "CoreTypes.h"
#ifdef ESP_TARGET
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#else
#include "FreeRTOS.h"
#include "event_groups.h"
#endif
#include "RtosCompatEventGroups.h"
namespace tt {
+9 -16
View File
@@ -2,14 +2,7 @@
#include "Check.h"
#include "CoreDefines.h"
#include "CoreTypes.h"
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#else
#include "FreeRTOS.h"
#include "task.h"
#endif
#include "RtosCompatTask.h"
#ifdef ESP_PLATFORM
#include "rom/ets_sys.h"
@@ -118,7 +111,7 @@ uint32_t kernel_get_tick_frequency() {
return (configTICK_RATE_HZ);
}
void delay_tick(uint32_t ticks) {
void delay_ticks(TickType_t ticks) {
tt_assert(!kernel_is_irq());
if (ticks == 0U) {
taskYIELD();
@@ -127,7 +120,7 @@ void delay_tick(uint32_t ticks) {
}
}
TtStatus delay_until_tick(uint32_t tick) {
TtStatus delay_until_tick(TickType_t tick) {
tt_assert(!kernel_is_irq());
TickType_t tcnt, delay;
@@ -154,7 +147,7 @@ TtStatus delay_until_tick(uint32_t tick) {
return (stat);
}
uint32_t get_tick() {
TickType_t get_ticks() {
TickType_t ticks;
if (kernel_is_irq() != 0U) {
@@ -166,11 +159,11 @@ uint32_t get_tick() {
return ticks;
}
uint32_t ms_to_ticks(uint32_t milliseconds) {
TickType_t ms_to_ticks(uint32_t milliseconds) {
#if configTICK_RATE_HZ == 1000
return milliseconds;
return (TickType_t)milliseconds;
#else
return (uint32_t)((float)configTICK_RATE_HZ) / 1000.0f * (float)milliseconds;
return (TickType_t)((float)configTICK_RATE_HZ) / 1000.0f * (float)milliseconds;
#endif
}
@@ -182,7 +175,7 @@ void delay_ms(uint32_t milliseconds) {
#if configTICK_RATE_HZ_RAW == 1000
tt_delay_tick(milliseconds);
#else
delay_tick(ms_to_ticks(milliseconds));
delay_ticks(ms_to_ticks(milliseconds));
#endif
} else if (milliseconds > 0) {
delay_us(milliseconds * 1000);
@@ -201,7 +194,7 @@ Platform get_platform() {
#ifdef ESP_PLATFORM
return PlatformEsp;
#else
return PlatformPc;
return PlatformSimulator;
#endif
}
+11 -3
View File
@@ -2,11 +2,17 @@
#include "CoreTypes.h"
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#else
#include "FreeRTOS.h"
#endif
namespace tt {
typedef enum {
PlatformEsp,
PlatformPc
PlatformSimulator
} Platform;
/** Check if CPU is in IRQ or kernel running and IRQ is masked
@@ -64,6 +70,8 @@ int32_t kernel_restore_lock(int32_t lock);
*/
uint32_t kernel_get_tick_frequency();
TickType_t get_ticks();
/** Delay execution
*
* @warning This should never be called in interrupt request context.
@@ -72,7 +80,7 @@ uint32_t kernel_get_tick_frequency();
*
* @param[in] ticks The ticks count to pause
*/
void delay_tick(uint32_t ticks);
void delay_ticks(TickType_t ticks);
/** Delay until tick
*
@@ -89,7 +97,7 @@ TtStatus delay_until_tick(uint32_t tick);
* @param[in] milliseconds time in milliseconds
* @return time in ticks
*/
uint32_t ms_to_ticks(uint32_t milliseconds);
TickType_t ms_to_ticks(uint32_t milliseconds);
/** Delay in milliseconds
*
+1 -8
View File
@@ -6,14 +6,7 @@
#include "CoreTypes.h"
#include "Thread.h"
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#else
#include "FreeRTOS.h"
#include "semphr.h"
#endif
#include "RtosCompatSemaphore.h"
namespace tt {
+13
View File
@@ -0,0 +1,13 @@
#pragma once
/**
* Compatibility includes for FreeRTOS.
* Custom FreeRTOS from ESP-IDF prefixes paths with "freertos/",
* but this isn't the normal behaviour for the regular FreeRTOS project.
*/
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#else
#include "FreeRTOS.h"
#endif
@@ -0,0 +1,14 @@
#pragma once
/**
* See explanation in RtosCompat.h
*/
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#else
#include "FreeRTOS.h"
#include "event_groups.h"
#endif
@@ -0,0 +1,14 @@
#pragma once
/**
* See explanation in RtosCompat.h
*/
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#else
#include "FreeRTOS.h"
#include "semphr.h"
#endif
+14
View File
@@ -0,0 +1,14 @@
#pragma once
/**
* See explanation in RtosCompat.h
*/
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#else
#include "FreeRTOS.h"
#include "task.h"
#endif
+13
View File
@@ -0,0 +1,13 @@
#pragma once
/**
* See explanation in RtosCompat.h
*/
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
#else
#include "FreeRTOS.h"
#include "timers.h"
#endif
+2 -1
View File
@@ -1,6 +1,7 @@
#include "Timer.h"
#include "Check.h"
#include "Kernel.h"
#include "RtosCompat.h"
namespace tt {
@@ -73,7 +74,7 @@ uint32_t Timer::getExpireTime() {
return (uint32_t)xTimerGetExpiryTime(timerHandle);
}
void Timer::pendingCallback(PendigCallback callback, void* callbackContext, uint32_t arg) {
void Timer::pendingCallback(PendingCallback callback, void* callbackContext, uint32_t arg) {
BaseType_t ret = pdFAIL;
if (kernel_is_irq()) {
ret = xTimerPendFunctionCallFromISR(callback, callbackContext, arg, nullptr);
+3 -15
View File
@@ -2,24 +2,17 @@
#include "CoreTypes.h"
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
#else
#include "FreeRTOS.h"
#include "timers.h"
#endif
#include "RtosCompatTimers.h"
namespace tt {
class Timer {
private:
TimerHandle_t timerHandle;
public:
typedef void (*Callback)(void* context);
typedef void (*PendigCallback)(void* context, uint32_t arg);
typedef void (*PendingCallback)(void* context, uint32_t arg);
Callback callback;
@@ -88,7 +81,7 @@ public:
*/
uint32_t getExpireTime();
void pendingCallback(PendigCallback callback, void* callbackContext, uint32_t arg);
void pendingCallback(PendingCallback callback, void* callbackContext, uint32_t arg);
typedef enum {
TimerThreadPriorityNormal, /**< Lower then other threads */
@@ -102,9 +95,4 @@ public:
void setThreadPriority(TimerThreadPriority priority);
};
} // namespace
+1 -8
View File
@@ -1,13 +1,6 @@
#include "Critical.h"
#include "CoreDefines.h"
#ifdef ESP_PLATFORM
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#else
#include "FreeRTOS.h"
#include "task.h"
#endif
#include "RtosCompatTask.h"
#ifdef ESP_PLATFORM
static portMUX_TYPE critical_mutex;