db_utils.h

This version of db_utils.h was modified from that provided in the PIC32 Starter Kit to eliminate the need for an addional define parameter PIC32_STARTER_KIT.


01: /********************************************************************
02:  *
03:  *                  debug utility interface.
04:  *
05:  *********************************************************************
06:  * FileName:        db_utils.h
07:  * Dependencies:    None
08:  * Processor:       PIC32
09:  *
10:  * Complier:        PIC32
11:  *                  MPLAB IDE v7.61.05 or higher
12:  * Company:         Microchip Technology, Inc.
13:  *
14:  * Copyright (c) 2007 Microchip Technology, Inc.
15:  *
16:  * Software License Agreement
17:  *
18:  * The software supplied herewith by Microchip Technology Incorporated
19:  * (the “Company”) for its PIC32 Microcontroller is intended
20:  * and supplied to you, the Company’s customer, for use solely and
21:  * exclusively on Microchip PIC32 Microcontroller products.
22:  * The software is owned by the Company and/or its supplier, and is
23:  * protected under applicable copyright laws. All rights are reserved.
24:  * Any use in violation of the foregoing restrictions may subject the
25:  * user to criminal sanctions under applicable laws, as well as to
26:  * civil liability for the breach of the terms and conditions of this
27:  * license.
28:  *
29:  * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
30:  * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
31:  * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
32:  * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
33:  * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
34:  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
35:  *
36:  ********************************************************************/
37: /*********************************************************************
38:  * This file should be included in the project for the debug print utility
39:  ********************************************************************/
40: 
41: #if defined(UART2_IO)
42:         #define DBINIT()
43:         #define DBPUTC(c)
44:         #define DBPUTS(s)
45:         #define DBPRINTF
46:         #define DBGETS(s,len)
47:         #define DBGETC(c)
48: #else // PIC32_STARTER_KIT
49:         #define DBINIT()
50:         #define DBPUTC(c)         db_puts(c,1)
51:         #define DBPUTS(s)     db_puts(s, strlen(s))
52:         #define DBPRINTF      printf
53:         #define DBGETS(s,len) db_gets(s, len)
54:         #define DBGETC(c)         db_gets(c,1)
55: #endif
56: // Debug function prototypes
57: void  __attribute__ (( noinline,nomips16 )) db_puts(const unsigned char *s, int len);
58: void  __attribute__ (( noinline,nomips16 )) db_gets(unsigned char *s, int len);
59: void _mon_write (const char * s, unsigned int count);


Maintained by John Loomis, updated Mon Jul 28 22:26:58 2008