13 const uint16_t COGS = 8;
14 const uint16_t STACK_SIZE = 128;
15 const unsigned int DELAY_IN_SECONDS = 2;
16 const uint32_t WAIT_TIME = DELAY_IN_SECONDS * SECOND;
30 nextCnt = WAIT_TIME + CNT;
36 nextCnt = waitcnt2(nextCnt, WAIT_TIME);
48 int main(
int argc,
char *argv[]) {
49 const uint32_t stacks[COGS][STACK_SIZE] = {{0}};
66 for (uint8_t n = 1; n < COGS; n++)
69 syncedPrinterCogs[0].
run();
static int8_t invoke(T &runnable)
Start a new cog running the given object.
static void flash_pin(const Pin::Mask pinMask, const uint32_t iterations=10)
Great for quick debugging to ensure a line of code is executed, this will quickly flash a given pin a...
const PropWare::SynchronousPrinter pwSyncOut
Global and shared instance for easy printing to the terminal (thread safe)
virtual void run()
Invoked in the new cog, this method should be the root of the business logic.
bool has_lock() const
Determine if an instance of a SynchronousPrinter successfully retrieved a lock.
void printf(const char fmt[]) const
Helper class for creating easy parallel applications.
static void flash_port(const uint32_t pinMask, uint32_t iterations=10)
Great for quick debugging to ensure a line of code is executed, this will quickly flash a given set o...