21 pwSyncOut.
printf(
"Hello from cog %u (0x%08X)! %u\n", cogid(), (
unsigned int)
this, CNT);
22 waitcnt(250 * MILLISECOND + CNT);
39 waitcnt(250 * MILLISECOND + CNT);
55 int main(
int argc,
char *argv[]) {
56 uint32_t stack[3][70];
62 pwSyncOut.
printf(
"Talking thread (0x%08X) started in cog %d\n", (
unsigned int) &talkingThread, cog);
65 pwSyncOut.
printf(
"Blink16 thread (0x%08X) started in cog %d\n", (
unsigned int) &blink16, cog);
68 pwSyncOut.
printf(
"Blink17 thread (0x%08X) started in cog %d\n", (
unsigned int) &blink17, cog);
72 waitcnt(250 * MILLISECOND + CNT);
Utility class to handle general purpose I/O pins.
static int8_t invoke(T &runnable)
Start a new cog running the given object.
void run()
Invoked in the new cog, this method should be the root of the business logic.
const PropWare::SynchronousPrinter pwSyncOut
Global and shared instance for easy printing to the terminal (thread safe)
void toggle() const
Toggle the output value of a port.
void printf(const char fmt[]) const
Helper class for creating easy parallel applications.
void run()
Invoked in the new cog, this method should be the root of the business logic.