From 573e33ccf4bdf4e0185eac36eb8b931dc5a665f9 Mon Sep 17 00:00:00 2001 From: anschrammh Date: Sat, 19 Dec 2020 20:52:59 +0100 Subject: [PATCH] Added ViewLink structure taken from definition.h --- src/app/ScreenManager.cpp | 2 +- src/app/ScreenManager.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/ScreenManager.cpp b/src/app/ScreenManager.cpp index 93836a4..ddb30a8 100644 --- a/src/app/ScreenManager.cpp +++ b/src/app/ScreenManager.cpp @@ -196,7 +196,7 @@ void ScreenManager::iterateThroughList() } } -ViewLink* ScreenManager::getLinkByUID(ViewLinkedList viewLinkedList, const unsigned char UID) +ScreenManager::ViewLink* ScreenManager::getLinkByUID(ViewLinkedList viewLinkedList, const unsigned char UID) { if(isListEmpty(viewLinkedList)) return NULL; diff --git a/src/app/ScreenManager.h b/src/app/ScreenManager.h index 9b6a400..2513600 100644 --- a/src/app/ScreenManager.h +++ b/src/app/ScreenManager.h @@ -2,7 +2,6 @@ #define SCREENMANAGER_H #include -#include "definition.h" #include "SDCardManager.h" #include "CFGFileParser.h" #include "CFGDictionary.h" @@ -13,6 +12,14 @@ class ScreenManager friend class SAB; public: enum Error {OK, MALLOC_FAILED, VIEW_NOT_FOUND, VIEW_FUNC_UNDEFINED, VIEW_FAILED_TO_EXECUTE, CURRENT_VIEW_UNDEFINED}; + //Data structure for the view handling + typedef struct viewLink + { + boolean (*viewLogicFunction)(Adafruit_SSD1306&, void*); + void *pData; + const int UID; + struct viewLink *next, *previous; + } ViewLink, *ViewLinkedList; boolean addView(boolean (*viewLogicFunction)(Adafruit_SSD1306&, void*), void *pData, const unsigned char UID); boolean removeView(const unsigned char UID);