Code cleanup.

This commit is contained in:
Robert Borzecki
2019-06-26 18:59:07 +02:00
parent d9c4e119f4
commit 5a3085749b
5 changed files with 7 additions and 148 deletions

View File

@@ -18,24 +18,9 @@
#include "ServiceEink.hpp"
#include "service-appmgr/ApplicationManager.hpp"
#include "service-evtmgr/EventManager.hpp"
#include "service-db/ServiceDB.hpp"
#include "service-db/api/DBServiceAPI.hpp"
//module-gui
#include "gui/core/Font.hpp"
#include "gui/core/BoundingBox.hpp"
#include "gui/core/Context.hpp"
#include "gui/core/Renderer.hpp"
#include "gui/core/DrawCommand.hpp"
#include "gui/core/Font.hpp"
#include "gui/widgets/Window.hpp"
#include "gui/widgets/Item.hpp"
#include "gui/widgets/Label.hpp"
#include "gui/widgets/BoxLayout.hpp"
#include "gui/widgets/Image.hpp"
//module-bsp
#include "bsp.hpp"
#include "vfs.hpp"
@@ -46,21 +31,16 @@
class vfs vfs;
class BlinkyService : public sys::Service {
gui::Window* win = nullptr;
uint8_t* mem = nullptr;
public:
BlinkyService(const std::string& name)
: sys::Service(name)
{
mem = new uint8_t[480*600];
timer_id = CreateTimer(100,true);
ReloadTimer(timer_id);
}
~BlinkyService(){
if( win )
delete win;
}
// Invoked upon receiving data message
@@ -71,13 +51,7 @@ public:
// Invoked when timer ticked
void TickHandler(uint32_t id) override{
//auto msg = std::make_shared<sys::DataMessage>(500);
//sys::Bus::SendUnicast(msg,"Blinky",this);
//LOG_DEBUG("Blinky service tick!");
// uint32_t start_tick = xTaskGetTickCount();
// memset( mem, 0, 480*600);
// uint32_t end_tick = xTaskGetTickCount();
// LOG_DEBUG("memset time: %d", end_tick-start_tick);
LOG_DEBUG("Blinky service tick!");
}
// Invoked during initialization
@@ -99,8 +73,6 @@ public:
}
uint32_t timer_id= 0;
};
@@ -113,22 +85,12 @@ int SystemStart(sys::SystemManager* sysmgr)
ret |= sysmgr->CreateService(std::make_shared<ServiceEink>("ServiceEink"),sysmgr);
ret |= sysmgr->CreateService(std::make_shared<EventManager>("EventManager"),sysmgr);
ret |= sysmgr->CreateService(std::make_shared<ServiceDB>(),sysmgr);
ret |= sysmgr->CreateService(std::make_shared<BlinkyService>("Blinky"),sysmgr);
// ret |= sysmgr->CreateService(std::make_shared<BlinkyService>("Blinky"),sysmgr);
//vector with launchers to applications
std::vector< std::unique_ptr<app::ApplicationLauncher> > applications;
//#if 1 // TODO: Robert please clean it up
// //launcher for clock application
// std::unique_ptr<app::ApplicationLauncher> clockLauncher = std::unique_ptr<app::ApplicationClockLauncher>(new app::ApplicationClockLauncher());
// applications.push_back( std::move(clockLauncher) );
//
// //launcher for viewer application
// std::unique_ptr<app::ApplicationLauncher> viewerLauncher = std::unique_ptr<app::ApplicationViewerLauncher>(new app::ApplicationViewerLauncher());
// applications.push_back( std::move(viewerLauncher) );
//launcher for viewer application
//launcher for desktop application
std::unique_ptr<app::ApplicationLauncher> viewerLauncher = std::unique_ptr<app::ApplicationDesktopLauncher>(new app::ApplicationDesktopLauncher());
applications.push_back( std::move(viewerLauncher) );