mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-22 07:57:57 -04:00
Code cleanup.
This commit is contained in:
@@ -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) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user