starting with ESP-IDF
- initial ESP-IDF project - starting custom component (Timber) Signed-off-by: Peter Siegmund <peter@rdkr.com>
This commit is contained in:
2
ePaper-ESP-IDF/components/timber/CMakeLists.txt
Normal file
2
ePaper-ESP-IDF/components/timber/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
idf_component_register(SRCS "timber.cpp" "tree.cpp" "tree_esp32.cpp"
|
||||
INCLUDE_DIRS "include")
|
15
ePaper-ESP-IDF/components/timber/include/timber.h
Normal file
15
ePaper-ESP-IDF/components/timber/include/timber.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "tree.h"
|
||||
#include "tree_esp32.h"
|
||||
|
||||
class Timber {
|
||||
public:
|
||||
static void tag(char* tag);
|
||||
static void plant(Tree tree);
|
||||
static void d(char* message);
|
||||
static void i(char* message);
|
||||
static void w(char* message);
|
||||
static void e(char* message);
|
||||
static void v(char* message);
|
||||
};
|
6
ePaper-ESP-IDF/components/timber/include/tree.h
Normal file
6
ePaper-ESP-IDF/components/timber/include/tree.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
class Tree {
|
||||
public:
|
||||
virtual ~Tree();
|
||||
};
|
7
ePaper-ESP-IDF/components/timber/include/tree_esp32.h
Normal file
7
ePaper-ESP-IDF/components/timber/include/tree_esp32.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "tree.h"
|
||||
|
||||
class TreeESP32 : public Tree {
|
||||
public:
|
||||
~TreeESP32();
|
||||
};
|
30
ePaper-ESP-IDF/components/timber/timber.cpp
Normal file
30
ePaper-ESP-IDF/components/timber/timber.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "timber.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void Timber::tag(char* tag) {
|
||||
printf("Tag: %s\n", tag);
|
||||
}
|
||||
|
||||
void Timber::plant(Tree tree) {
|
||||
printf("Planting tree\n");
|
||||
}
|
||||
|
||||
void Timber::d(char* message) {
|
||||
printf("Debug: %s\n", message);
|
||||
}
|
||||
|
||||
void Timber::i(char* message) {
|
||||
printf("Info: %s\n", message);
|
||||
}
|
||||
|
||||
void Timber::w(char* message) {
|
||||
printf("Warning: %s\n", message);
|
||||
}
|
||||
|
||||
void Timber::e(char* message) {
|
||||
printf("Error: %s\n", message);
|
||||
}
|
||||
|
||||
void Timber::v(char* message) {
|
||||
printf("Verbose: %s\n", message);
|
||||
}
|
6
ePaper-ESP-IDF/components/timber/tree.cpp
Normal file
6
ePaper-ESP-IDF/components/timber/tree.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "tree.h"
|
||||
#include <stdio.h>
|
||||
|
||||
Tree::~Tree() {
|
||||
printf("Tree destructor\n");
|
||||
};
|
7
ePaper-ESP-IDF/components/timber/tree_esp32.cpp
Normal file
7
ePaper-ESP-IDF/components/timber/tree_esp32.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "tree_esp32.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
TreeESP32::~TreeESP32() {
|
||||
printf("TreeESP32 destructor\n");
|
||||
};
|
Reference in New Issue
Block a user