C++ conversions (#111)

* Remove version from artifact name
* Target C++ 20 and higher
* Use cpp string
* Better crash implementation
* String utils in cpp style
* Replace parameter methods with start() method
* MutexType to Mutex::Type
* Kernel c to cpp style
* Cleanup event flag
* More cpp conversions
* Test fixes
* Updated ideas docs
This commit is contained in:
Ken Van Hoeylandt
2024-12-07 12:24:28 +01:00
committed by GitHub
parent d52fe52d96
commit 42e843b463
66 changed files with 272 additions and 258 deletions
@@ -43,7 +43,7 @@ ScreenshotTask* alloc() {
auto* data = static_cast<ScreenshotTaskData*>(malloc(sizeof(ScreenshotTaskData)));
*data = (ScreenshotTaskData) {
.thread = nullptr,
.mutex = tt_mutex_alloc(MutexTypeRecursive),
.mutex = tt_mutex_alloc(Mutex::TypeRecursive),
.interrupted = false
};
return data;
@@ -76,7 +76,7 @@ static int32_t screenshot_task(void* context) {
if (data->work.type == TASK_WORK_TYPE_DELAY) {
// Splitting up the delays makes it easier to stop the service
for (int i = 0; i < (data->work.delay_in_seconds * 10) && !is_interrupted(data); ++i){
delay_ms(100);
kernel::delayMillis(100);
}
if (is_interrupted(data)) {
@@ -102,7 +102,7 @@ static int32_t screenshot_task(void* context) {
if (app) {
const app::AppManifest& manifest = app->getManifest();
if (manifest.id != last_app_id) {
delay_ms(100);
kernel::delayMillis(100);
last_app_id = manifest.id;
char filename[SCREENSHOT_PATH_LIMIT + 32];
@@ -116,7 +116,7 @@ static int32_t screenshot_task(void* context) {
lvgl::unlock();
}
}
delay_ms(250);
kernel::delayMillis(250);
}
}