Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example of how to include files in OOT apps #1001

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/app_hello_world/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
#
CRAZYFLIE_BASE := ../..

#
# To include header files from another dir
#
EXTRA_CFLAGS += -I$(PWD)/other

#
# We override the default OOT_CONFIG here, we could also name our config
# to oot-config and that would be the default.
Expand Down
3 changes: 3 additions & 0 deletions examples/app_hello_world/other/headerInOtherDir.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

#define EXAMPLE_OF_HOW_TO_INCLUDE_HEADER_FILE_FROM_OTHER_DIR 4711
6 changes: 4 additions & 2 deletions examples/app_hello_world/src/hello_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
*
* hello_world.c - App layer application of a simple hello world debug print every
* 2 seconds.
* 2 seconds.
*/


Expand All @@ -36,6 +36,8 @@
#include "FreeRTOS.h"
#include "task.h"

#include "headerInOtherDir.h"

#include "debug.h"

#define DEBUG_MODULE "HELLOWORLD"
Expand All @@ -48,4 +50,4 @@ void appMain()
vTaskDelay(M2T(2000));
DEBUG_PRINT("Hello World!\n");
}
}
}