ban4jp -
/
uIP-1-0_webserver
uIP 1.0 based webserver for LPC1114 + ENC28J60
Diff: uip/pt.h
- Revision:
- 3:a2715e9c7737
- Parent:
- 0:685224d2f66d
diff -r 4da9ed411bdc -r a2715e9c7737 uip/pt.h --- a/uip/pt.h Sat Jun 21 11:54:24 2014 +0000 +++ b/uip/pt.h Mon Jun 30 16:00:08 2014 +0000 @@ -26,11 +26,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack + * This file is part of the Contiki operating system. * * Author: Adam Dunkels <adam@sics.se> * - * $Id: pt.h,v 1.2 2006/06/12 08:00:30 adam Exp $ */ /** @@ -56,9 +55,9 @@ }; #define PT_WAITING 0 -#define PT_EXITED 1 -#define PT_ENDED 2 -#define PT_YIELDED 3 +#define PT_YIELDED 1 +#define PT_EXITED 2 +#define PT_ENDED 3 /** * \name Initialization @@ -112,7 +111,7 @@ * * \hideinitializer */ -#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) +#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; if (PT_YIELD_FLAG) {;} LC_RESUME((pt)->lc) /** * Declare the end of a protothread. @@ -259,7 +258,7 @@ /** * Schedule a protothread. * - * This function shedules a protothread. The return value of the + * This function schedules a protothread. The return value of the * function is non-zero if the protothread is running or zero if the * protothread has exited. * @@ -268,7 +267,7 @@ * * \hideinitializer */ -#define PT_SCHEDULE(f) ((f) == PT_WAITING) +#define PT_SCHEDULE(f) ((f) < PT_EXITED) /** @} */