COSA
An Object-Oriented Platform for Arduino Programming
|
Go to the source code of this file.
Classes | |
class | ProtoThread |
Macros | |
#define | PROTO_THREAD_BEGIN() if (m_ip != 0) goto *m_ip |
#define | PROTO_THREAD_YIELD() |
#define | PROTO_THREAD_SLEEP() |
#define | PROTO_THREAD_WAKE(thread) |
#define | PROTO_THREAD_AWAIT(condition) |
#define | PROTO_THREAD_DELAY(ms) |
#define | PROTO_THREAD_END() |
Copyright (C) 2012-2015, Mikael Patel
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
This file is part of the Arduino Che Cosa project.
Definition in file ProtoThread.hh.
#define PROTO_THREAD_AWAIT | ( | condition | ) |
Check if the given condition is true(1). If not the thread will yield. The condition is rechecked when the thread is activated again.
[in] | condition | to evaluate. |
Definition at line 240 of file ProtoThread.hh.
#define PROTO_THREAD_BEGIN | ( | ) | if (m_ip != 0) goto *m_ip |
First statement in the thread body, run(). Last statement should be PROTO_THREAD_END();
Definition at line 198 of file ProtoThread.hh.
#define PROTO_THREAD_DELAY | ( | ms | ) |
Delay the thread for the given ms time period. This is a short form for set_timer() and THREAD_AWAIT(timer_expired());
[in] | ms | milli-seconds to delay. |
Definition at line 255 of file ProtoThread.hh.
#define PROTO_THREAD_END | ( | ) |
Marks the running thread as TERMINATED and detach from any queue. Should be the last statement in the thread run() function.
Definition at line 265 of file ProtoThread.hh.
#define PROTO_THREAD_SLEEP | ( | ) |
Yield execution and detach from the run queue. Must be activated with PROTO_THREAD_WAkE().
Definition at line 217 of file ProtoThread.hh.
#define PROTO_THREAD_WAKE | ( | thread | ) |
Schedule the given thread if SLEEPING.
[in] | thread | to wake. |
Definition at line 228 of file ProtoThread.hh.
#define PROTO_THREAD_YIELD | ( | ) |
Yield execution to other threads ane event handlers. Remains in the run queue.
Definition at line 205 of file ProtoThread.hh.