Skip to content

Commit

Permalink
Node: Showcase Test Folder Example (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnsAnns authored May 13, 2024
2 parents 8dcc9d2 + 29f739c commit 6db9f6c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node/code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ RIOTBASE ?= $(CURDIR)/RIOT
# development process:
DEVELHELP ?= 1

# Include test_folder example to showcase directories being included
DIR += test_folder

FEATURES_REQUIRED += cpp
FEATURES_REQUIRED += libstdcpp

Expand Down
4 changes: 4 additions & 0 deletions node/code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
// Example Module Import
#include "external_module.h"

#include "test_folder/test_hello.h"

using namespace std;
using namespace riot;

Expand All @@ -35,6 +37,8 @@ int main() {
// Show the example module function
cout << "Example Module Init: " << external_module_initialized << endl;

hello();

cout << "Sleeping for 5 seconds...\n" << endl;
riot::this_thread::sleep_for(chrono::seconds(5));
cout << "Done sleeping.\n" << endl;
Expand Down
1 change: 1 addition & 0 deletions node/code/test_folder/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base
15 changes: 15 additions & 0 deletions node/code/test_folder/test_hello.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

void hello() {
printf("Hello, World from test_dir!\n");
}

#ifdef __cplusplus
}
#endif

0 comments on commit 6db9f6c

Please sign in to comment.