// @(#) $Header: /usr/local/scalawags_cvs/Scalawags/Frc2006/supportfuncs.h,v 1.23 2006/02/08 04:40:11 abrown Exp $
/***********************************************************************
  * Copyright (C) 2004  Allen Brown and Sean Lavelle
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  * 
  * This program 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 General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the
  *   Free Software Foundation, Inc.
  *   59 Temple Place, Suite 330
  *   Boston, MA  02111-1307  USA
  * 
  * To contact the author of this software:
  *   Allen Brown
  *   PO Box J
  *   Corvallis, OR
  * 
  *   http://brown.armoredpenguin.com/~abrown/contact.html
  ***********************************************************************/

#ifndef supportfuncs_h
  #define supportfuncs_h
  #if defined(ABSIMULATION_NOCOPROCESSOR) || defined(ABSIMULATION_COPROCESSOR)\
      || defined(ABSIMULATION_COPRSIM) || defined(COPROCESSOR_SIMULATION)
    #include "sim/simfuncs.h"
  #endif
#if defined(FRC_NOCOPROCESSOR) || defined(FRC_COPROCESSOR)
  #define ROM rom
#else
  #define ROM
#endif
  #define ERROR 1
  #define WARNING 2
  #define NOTE 3
  #define MSG_TSLOW 1
  #define MSG_TFAST 2
  #define MSG_TINTERRUPT 3
  #define MSG_TREPORT 4
  #define MSG_TEXIT 5
  #define MSG_TCOPDAT 6
  #define MSG_TCOPRMSG 7

  #include <stdio.h>
#if defined(FRC_COPROCESSOR) || defined(ABSIMULATION_COPROCESSOR)
  #include "msgxfer.h"
#endif

  void reportstart( ROM const char *file, const int line,
		    int type, ROM const char *mesg );
  void reportint( const int number );
  void reporttext( ROM const char *mesg );
  void reportend( ROM const char *mesg );
  int reportsum( void );
  int msg_reader(void);
  int msg_writer(unsigned char ch);
  void set_raw_mode(int fd);
  void DisableBot(void);
#endif

/*
 * $Log: supportfuncs.h,v $
 * Revision 1.23  2006/02/08 04:40:11  abrown
 * Declare remaining strings as ROM type qualifier.
 *
 * Revision 1.22  2005/12/24 01:36:50  abrown
 * Split the old target ABSIMULATION_COPROCESSOR into two.  Now
 * ABSIMULATION_COPROCESSOR includes a physical coprocessor.  The new
 * target, ABSIMULATION_COPRSIM, includes a simulated coprocessor.
 *
 * Revision 1.21  2005/12/17 04:02:46  asumu
 * Added a command to the FRC simulation to simulate serial communications interrupt. Also allow sd_* declarations for ABSIMULATION_COPROCESSOR.
 *
 * Revision 1.20  2005/05/13 23:47:00  abrown
 * Remove __ from defines.  Move Log to end of file.
 *
 * Revision 1.19  2005/04/30 17:49:10  abrown
 * First cut at changing obsolete defines to the new ones.
 *
 * Revision 1.18  2005/02/17 02:33:19  abrown
 * Move simfuncs into the sim directory.
 *
 * Revision 1.17  2005/02/13 20:18:56  abrown
 * The merge effort between FRC and simulator in main.  It doesn't
 * work on the FRC yet.  But it got checked in anyway, so now I
 * need to make it work quickly.
 *
 * Revision 1.16  2005/02/05 02:43:30  jeff
 * Modified to compile under MPLab (fixed misplaced ifndefs and endifs)
 * Added comment about pwm position on robot
 *
 * Revision 1.15  2005/01/31 23:17:45  go
 * Added "set_raw_mode" function to supportfuncs
 * Added call to "set_raw_mode" to main and coprocessor
 *
 * Revision 1.14  2005/01/31 06:02:52  abrown
 * Fix problems pointing to msg_reader/msg_writer.
 *
 * Revision 1.13  2005/01/30 22:23:03  abrown
 * Merge in changes to msgxfer.  Unfortunately it now core dumps.
 * And there are some odd warnings.
 *
 * Revision 1.12  2005/01/25 04:13:18  jeff
 * Modified to compile in MPLAB; fixed includes.
 *
 * Revision 1.11  2005/01/09 05:15:00  abrown
 * Update to 2005 default code base. -- Allen Brown
 *
 * Revision 1.10  2004/12/29 05:39:11  abrown
 * Removed redundant declaration of abs.  Cleaned up a warning.
 */


syntax highlighted by Code2HTML, v. 0.9.1