1
0

OO redesign
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jens Christian True
2019-09-04 15:28:38 +02:00
parent 96fd2967b3
commit 3815d2ed5f
7 changed files with 140 additions and 42 deletions

View File

@ -0,0 +1,10 @@
#ifndef DISPLAYPROXY_H
#define DISPLAYPROXY_H
class DisplayProxy
{
public:
virtual bool write(int x, int y, const char *text) = 0;
virtual bool clear() = 0;
virtual bool setOffset(int x, int y) = 0;
};
#endif

View File

@ -0,0 +1,24 @@
#include "DisplayProxyMAX7456.h"
DisplayProxyMAX7456::DisplayProxyMAX7456(Max7456 *osd)
{
this->osd = osd;
}
bool DisplayProxyMAX7456::write(int x, int y, const char *text)
{
this->osd->print(text, x, y);
return true;
}
bool DisplayProxyMAX7456::clear()
{
this->osd->clearScreen();
return true;
}
bool DisplayProxyMAX7456::setOffset(int x, int y)
{
this->osd->setDisplayOffsets(x, y);
return true;
}

View File

@ -0,0 +1,19 @@
#ifndef DISPLAYPROXYMAX7456_H
#define DISPLAYPROXYMAX7456_H
#include "DisplayProxy.h"
#include "max7456.h"
class DisplayProxyMAX7456 : public DisplayProxy
{
public:
DisplayProxyMAX7456(Max7456 *osd);
bool write(int x, int y, const char *text);
bool clear() ;
bool setOffset(int x, int y);
private:
Max7456 *osd;
};
#endif