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:
Peter Siegmund
2024-05-18 23:08:15 +02:00
parent 625e806cbe
commit 290a4d2722
23 changed files with 468 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "timber.cpp" "tree.cpp" "tree_esp32.cpp"
INCLUDE_DIRS "include")

View 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);
};

View File

@@ -0,0 +1,6 @@
#pragma once
class Tree {
public:
virtual ~Tree();
};

View File

@@ -0,0 +1,7 @@
#pragma once
#include "tree.h"
class TreeESP32 : public Tree {
public:
~TreeESP32();
};

View 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);
}

View File

@@ -0,0 +1,6 @@
#include "tree.h"
#include <stdio.h>
Tree::~Tree() {
printf("Tree destructor\n");
};

View File

@@ -0,0 +1,7 @@
#include "tree_esp32.h"
#include <stdio.h>
TreeESP32::~TreeESP32() {
printf("TreeESP32 destructor\n");
};