Created
May 22, 2017 02:34
-
-
Save ChristopherRabotin/75482a472e7369d5b947cac464b9d4d8 to your computer and use it in GitHub Desktop.
Zephyr cpp demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2012-2014 Wind River Systems, Inc. | |
* | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
#include <zephyr.h> | |
#include <misc/printk.h> | |
#include "test.hpp" | |
void main(void) | |
{ | |
printk("Hello World! %s\n", CONFIG_ARCH); | |
hi_from_cpp(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "test.hpp" | |
#include <misc/printk.h> | |
Demo::say_hi(void){ | |
printk("Hello from C++!\n"); | |
}; | |
void hi_from_cpp(void){ | |
Demo d; | |
d.say_hi(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _TEST_HPP | |
#define _TEST_HPP | |
class Demo{ | |
public: | |
void say_hi(void); | |
}; | |
void hi_from_cpp(void); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment