1
0

More documentation cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-11-03 12:00:05 +00:00
parent b8eccbe162
commit 737e3b8225
6 changed files with 45 additions and 130 deletions

View File

@ -12,8 +12,8 @@ bool CommandHandler::parseJSON(const char *cmd)
{
Serial.print("Handling: ");
Serial.println(cmd);
StaticJsonDocument<32> doc;
DeserializationError error = deserializeJson(doc, cmd);
StaticJsonDocument<32> json;
DeserializationError error = deserializeJson(json, cmd);
// Test if parsing succeeds.
if (error)
@ -23,12 +23,12 @@ bool CommandHandler::parseJSON(const char *cmd)
return false;
}
const char *command = doc["cmd"];
if (strcmp("write", command) == 0 && doc["text"].is<const char*>() && doc["x"].is<int>() && doc["y"].is<int>())
const char *command = json["cmd"];
if (strcmp("write", command) == 0 && json["text"].is<const char*>() && json["x"].is<int>() && json["y"].is<int>())
{
const char *text = doc["text"];
int x = doc["x"];
int y = doc["y"];
const char *text = json["text"];
int x = json["x"];
int y = json["y"];
this->debugWrite(x, y, text);
this->display->write(x, y, text);
@ -42,8 +42,9 @@ bool CommandHandler::parseJSON(const char *cmd)
if (strcmp("offset", command) == 0)
{
int x = doc["x"];
int y = doc["y"];
int x = json["x"];
int y = json["y"];
debugWrite(x,y,"offset unhandled");
//this->display->setOffset(x, y);
}

View File

@ -1,8 +1,8 @@
#include "DisplayProxyMAX7456.h"
DisplayProxyMAX7456::DisplayProxyMAX7456(Max7456 *osd)
DisplayProxyMAX7456::DisplayProxyMAX7456()
{
this->osd = osd;
this->osd = new Max7456();
this->osd->init(6);
clear();
this->osd->setBlinkParams(_8fields, _BT_3BT);
@ -11,7 +11,6 @@ DisplayProxyMAX7456::DisplayProxyMAX7456(Max7456 *osd)
onScreenDisplay(true);
}
bool DisplayProxyMAX7456::on()
{
onScreenDisplay(true);
@ -25,8 +24,6 @@ bool DisplayProxyMAX7456::off()
return true;
}
bool DisplayProxyMAX7456::write(int x, int y, const char *text)
{
this->osd->print(text, x, y);
@ -39,7 +36,6 @@ bool DisplayProxyMAX7456::clear()
return true;
}
bool DisplayProxyMAX7456::setOffset(int x, int y)
{
this->osd->setDisplayOffsets(x, y);

View File

@ -19,14 +19,14 @@ class DisplayProxyMAX7456 : public DisplayProxy
{
public:
/**
* Initalize a Max7456 Style display
* Initalize a MAX7456 Style display
* - Initialize with CS on Pin 6.
* - Clear the display
* - Initialize blinking frequency.
* - Disable external video
* - Enable OSD.
*/
explicit DisplayProxyMAX7456(Max7456 *osd);
explicit DisplayProxyMAX7456();
/**
* OSD on, external video left untouched.

View File

@ -1,46 +0,0 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html