PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
Multicore
Print from Other Core.c
1
/*
2
Print from Other Core.c
3
4
Use print statement in a function running in a different cog.
5
6
http://learn.parallax.com/multicore-approaches/print-different-core
7
*/
8
9
#include "simpletools.h"
// Library include
10
11
void
other();
// Forward declaration
12
int
*otherCog;
// Global pointer for cog_run return
13
14
int
main
()
// Main function
15
{
16
print(
"Cog 0 has the Talking Stick first... \n"
);
17
18
simpleterm_close();
// Close SimpleIDE Terminal for this core
19
otherCog = cog_run(other, 128);
// Run other function in another core
20
}
21
22
void
other()
// other function definition
23
{
24
simpleterm_open();
// Open SimpleIDE Terminal for this core
25
print(
"...and now the other cog has it. \n"
);
26
27
simpleterm_close();
// Close SimpleIDE Terminal
28
cog_end(otherCog);
// Shut down this core
29
}
30
31
32
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12