B.3 : THE 6 HOUR PROGRAM WITH 1 PPS SIGNAL THE MASTER TO BE CONNECTED TO 11 PIN.

Dependencies:   mbed

Committer:
manujose
Date:
Tue Dec 14 23:26:02 2010 +0000
Revision:
1:9efda6a3f83c
Parent:
0:e6964ff1bbcc
hello

Who changed what in which revision?

UserRevisionLine numberNew contents of line
manujose 0:e6964ff1bbcc 1 /*
manujose 0:e6964ff1bbcc 2 * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
manujose 0:e6964ff1bbcc 3 * All rights reserved.
manujose 0:e6964ff1bbcc 4 *
manujose 0:e6964ff1bbcc 5 * Redistribution and use in source and binary forms, with or without
manujose 0:e6964ff1bbcc 6 * modification, are permitted provided that the following conditions
manujose 0:e6964ff1bbcc 7 * are met:
manujose 0:e6964ff1bbcc 8 * 1. Redistributions of source code must retain the above copyright
manujose 0:e6964ff1bbcc 9 * notice, this list of conditions and the following disclaimer.
manujose 0:e6964ff1bbcc 10 * 2. Redistributions in binary form must reproduce the above copyright
manujose 0:e6964ff1bbcc 11 * notice, this list of conditions and the following disclaimer in the
manujose 0:e6964ff1bbcc 12 * documentation and/or other materials provided with the distribution.
manujose 0:e6964ff1bbcc 13 * 3. Neither the name of the Institute nor the names of its contributors
manujose 0:e6964ff1bbcc 14 * may be used to endorse or promote products derived from this software
manujose 0:e6964ff1bbcc 15 * without specific prior written permission.
manujose 0:e6964ff1bbcc 16 *
manujose 0:e6964ff1bbcc 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
manujose 0:e6964ff1bbcc 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
manujose 0:e6964ff1bbcc 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
manujose 0:e6964ff1bbcc 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
manujose 0:e6964ff1bbcc 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
manujose 0:e6964ff1bbcc 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
manujose 0:e6964ff1bbcc 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
manujose 0:e6964ff1bbcc 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
manujose 0:e6964ff1bbcc 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
manujose 0:e6964ff1bbcc 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
manujose 0:e6964ff1bbcc 27 * SUCH DAMAGE.
manujose 0:e6964ff1bbcc 28 *
manujose 0:e6964ff1bbcc 29 * This file is part of the Contiki operating system.
manujose 0:e6964ff1bbcc 30 *
manujose 0:e6964ff1bbcc 31 * Author: Adam Dunkels <adam@sics.se>
manujose 0:e6964ff1bbcc 32 *
manujose 0:e6964ff1bbcc 33 * $Id: lc-switch.h,v 1.4 2006/06/03 11:29:43 adam Exp $
manujose 0:e6964ff1bbcc 34 */
manujose 0:e6964ff1bbcc 35
manujose 0:e6964ff1bbcc 36 /**
manujose 0:e6964ff1bbcc 37 * \addtogroup lc
manujose 0:e6964ff1bbcc 38 * @{
manujose 0:e6964ff1bbcc 39 */
manujose 0:e6964ff1bbcc 40
manujose 0:e6964ff1bbcc 41 /**
manujose 0:e6964ff1bbcc 42 * \file
manujose 0:e6964ff1bbcc 43 * Implementation of local continuations based on switch() statment
manujose 0:e6964ff1bbcc 44 * \author Adam Dunkels <adam@sics.se>
manujose 0:e6964ff1bbcc 45 *
manujose 0:e6964ff1bbcc 46 * This implementation of local continuations uses the C switch()
manujose 0:e6964ff1bbcc 47 * statement to resume execution of a function somewhere inside the
manujose 0:e6964ff1bbcc 48 * function's body. The implementation is based on the fact that
manujose 0:e6964ff1bbcc 49 * switch() statements are able to jump directly into the bodies of
manujose 0:e6964ff1bbcc 50 * control structures such as if() or while() statmenets.
manujose 0:e6964ff1bbcc 51 *
manujose 0:e6964ff1bbcc 52 * This implementation borrows heavily from Simon Tatham's coroutines
manujose 0:e6964ff1bbcc 53 * implementation in C:
manujose 0:e6964ff1bbcc 54 * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
manujose 0:e6964ff1bbcc 55 */
manujose 0:e6964ff1bbcc 56
manujose 0:e6964ff1bbcc 57 #ifndef __LC_SWITCH_H__
manujose 0:e6964ff1bbcc 58 #define __LC_SWITCH_H__
manujose 0:e6964ff1bbcc 59
manujose 0:e6964ff1bbcc 60 /* WARNING! lc implementation using switch() does not work if an
manujose 0:e6964ff1bbcc 61 LC_SET() is done within another switch() statement! */
manujose 0:e6964ff1bbcc 62
manujose 0:e6964ff1bbcc 63 /** \hideinitializer */
manujose 0:e6964ff1bbcc 64 typedef unsigned short lc_t;
manujose 0:e6964ff1bbcc 65
manujose 0:e6964ff1bbcc 66 #define LC_INIT(s) s = 0;
manujose 0:e6964ff1bbcc 67
manujose 0:e6964ff1bbcc 68 #define LC_RESUME(s) switch(s) { case 0:
manujose 0:e6964ff1bbcc 69
manujose 0:e6964ff1bbcc 70 #define LC_SET(s) s = __LINE__; case __LINE__:
manujose 0:e6964ff1bbcc 71
manujose 0:e6964ff1bbcc 72 #define LC_END(s) }
manujose 0:e6964ff1bbcc 73
manujose 0:e6964ff1bbcc 74 #endif /* __LC_SWITCH_H__ */
manujose 0:e6964ff1bbcc 75
manujose 0:e6964ff1bbcc 76 /** @} */