Read NTP time from Ethernet and drive six 7-segment LEDs using a MAX7221 to show time, date, month, week, year etc....

Dependencies:   NTPClient_NetServices mbed

Committer:
cheungderek
Date:
Wed Jun 22 01:31:47 2011 +0000
Revision:
0:e083abcfe7a8
First release.
Just some testing but working code to read NTP time and drive 6 LEDs to display time, date, month, year etc...

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cheungderek 0:e083abcfe7a8 1 /*****************************************************************************
cheungderek 0:e083abcfe7a8 2 * pppdebug.h - System debugging utilities.
cheungderek 0:e083abcfe7a8 3 *
cheungderek 0:e083abcfe7a8 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
cheungderek 0:e083abcfe7a8 5 * portions Copyright (c) 1998 Global Election Systems Inc.
cheungderek 0:e083abcfe7a8 6 * portions Copyright (c) 2001 by Cognizant Pty Ltd.
cheungderek 0:e083abcfe7a8 7 *
cheungderek 0:e083abcfe7a8 8 * The authors hereby grant permission to use, copy, modify, distribute,
cheungderek 0:e083abcfe7a8 9 * and license this software and its documentation for any purpose, provided
cheungderek 0:e083abcfe7a8 10 * that existing copyright notices are retained in all copies and that this
cheungderek 0:e083abcfe7a8 11 * notice and the following disclaimer are included verbatim in any
cheungderek 0:e083abcfe7a8 12 * distributions. No written agreement, license, or royalty fee is required
cheungderek 0:e083abcfe7a8 13 * for any of the authorized uses.
cheungderek 0:e083abcfe7a8 14 *
cheungderek 0:e083abcfe7a8 15 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
cheungderek 0:e083abcfe7a8 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
cheungderek 0:e083abcfe7a8 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
cheungderek 0:e083abcfe7a8 18 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
cheungderek 0:e083abcfe7a8 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
cheungderek 0:e083abcfe7a8 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
cheungderek 0:e083abcfe7a8 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
cheungderek 0:e083abcfe7a8 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
cheungderek 0:e083abcfe7a8 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
cheungderek 0:e083abcfe7a8 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cheungderek 0:e083abcfe7a8 25 *
cheungderek 0:e083abcfe7a8 26 ******************************************************************************
cheungderek 0:e083abcfe7a8 27 * REVISION HISTORY (please don't use tabs!)
cheungderek 0:e083abcfe7a8 28 *
cheungderek 0:e083abcfe7a8 29 * 03-01-01 Marc Boucher <marc@mbsi.ca>
cheungderek 0:e083abcfe7a8 30 * Ported to lwIP.
cheungderek 0:e083abcfe7a8 31 * 98-07-29 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
cheungderek 0:e083abcfe7a8 32 * Original.
cheungderek 0:e083abcfe7a8 33 *
cheungderek 0:e083abcfe7a8 34 *****************************************************************************
cheungderek 0:e083abcfe7a8 35 */
cheungderek 0:e083abcfe7a8 36 #ifndef PPPDEBUG_H
cheungderek 0:e083abcfe7a8 37 #define PPPDEBUG_H
cheungderek 0:e083abcfe7a8 38
cheungderek 0:e083abcfe7a8 39 /* Trace levels. */
cheungderek 0:e083abcfe7a8 40 #define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE)
cheungderek 0:e083abcfe7a8 41 #define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE)
cheungderek 0:e083abcfe7a8 42 #define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING)
cheungderek 0:e083abcfe7a8 43 #define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING)
cheungderek 0:e083abcfe7a8 44 #define LOG_INFO (PPP_DEBUG)
cheungderek 0:e083abcfe7a8 45 #define LOG_DETAIL (PPP_DEBUG)
cheungderek 0:e083abcfe7a8 46 #define LOG_DEBUG (PPP_DEBUG)
cheungderek 0:e083abcfe7a8 47
cheungderek 0:e083abcfe7a8 48
cheungderek 0:e083abcfe7a8 49 #define TRACELCP PPP_DEBUG
cheungderek 0:e083abcfe7a8 50
cheungderek 0:e083abcfe7a8 51 #if PPP_DEBUG
cheungderek 0:e083abcfe7a8 52
cheungderek 0:e083abcfe7a8 53 #define AUTHDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 54 #define IPCPDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 55 #define UPAPDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 56 #define LCPDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 57 #define FSMDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 58 #define CHAPDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 59 #define PPPDEBUG(a, b) LWIP_DEBUGF(a, b)
cheungderek 0:e083abcfe7a8 60
cheungderek 0:e083abcfe7a8 61 #else /* PPP_DEBUG */
cheungderek 0:e083abcfe7a8 62
cheungderek 0:e083abcfe7a8 63 #define AUTHDEBUG(a, b)
cheungderek 0:e083abcfe7a8 64 #define IPCPDEBUG(a, b)
cheungderek 0:e083abcfe7a8 65 #define UPAPDEBUG(a, b)
cheungderek 0:e083abcfe7a8 66 #define LCPDEBUG(a, b)
cheungderek 0:e083abcfe7a8 67 #define FSMDEBUG(a, b)
cheungderek 0:e083abcfe7a8 68 #define CHAPDEBUG(a, b)
cheungderek 0:e083abcfe7a8 69 #define PPPDEBUG(a, b)
cheungderek 0:e083abcfe7a8 70
cheungderek 0:e083abcfe7a8 71 #endif /* PPP_DEBUG */
cheungderek 0:e083abcfe7a8 72
cheungderek 0:e083abcfe7a8 73 #endif /* PPPDEBUG_H */