OpenCores
URL https://opencores.org/ocsvn/sockit_owm/sockit_owm/trunk

Subversion Repositories sockit_owm

[/] [sockit_owm/] [trunk/] [HAL/] [src/] [owerr.c] - Diff between revs 2 and 3

Show entire file | Details | Blame | View Log

Rev 2 Rev 3
Line 28... Line 28...
//
//
// Version: 1.00
// Version: 1.00
//
//
 
 
#include <string.h>
#include <string.h>
#ifndef _WIN32_WCE
 
#include <stdio.h>
#include <stdio.h>
#endif
 
#ifdef _WIN64
 
#include <stdio.h>
 
#endif
 
#include "ownet.h"
#include "ownet.h"
 
 
#ifndef SIZE_OWERROR_STACK
#ifndef SIZE_OWERROR_STACK
   #ifdef SMALL_MEMORY_TARGET
   #ifdef SOCKIT_OWM_ERR_SMALL
      //for small memory, only hole 1 error
      //for small memory, only hold 1 error
      #define SIZE_OWERROR_STACK 1
      #define SIZE_OWERROR_STACK 1
   #else
   #else
      #define SIZE_OWERROR_STACK 10
      #define SIZE_OWERROR_STACK 10
   #endif
   #endif
#endif
#endif
Line 79... Line 74...
#ifdef DEBUG
#ifdef DEBUG
   void owRaiseError(int,int,char*);
   void owRaiseError(int,int,char*);
#else
#else
   void owRaiseError(int);
   void owRaiseError(int);
#endif
#endif
#ifndef SMALL_MEMORY_TARGET
#ifndef SOCKIT_OWM_ERR_SMALL
   void owPrintErrorMsg(FILE *);
   void owPrintErrorMsg(FILE *);
   void owPrintErrorMsgStd();
   void owPrintErrorMsgStd();
   char *owGetErrorMsg(int);
   char *owGetErrorMsg(int);
#endif
#endif
 
 
Line 161... Line 156...
      owErrorStack[ owErrorPointer ].owErrorNum = err;
      owErrorStack[ owErrorPointer ].owErrorNum = err;
   }
   }
#endif
#endif
 
 
 
 
// SMALL_MEMORY_TARGET - embedded microcontrollers, where these
// SOCKIT_OWM_ERR_SMALL - embedded microcontrollers, where these
// messaging functions might not make any sense.
// messaging functions might not make any sense.
#ifndef SMALL_MEMORY_TARGET
#ifndef SOCKIT_OWM_ERR_SMALL
   //Array of meaningful error messages to associate with codes.
   //Array of meaningful error messages to associate with codes.
   //Not used on targets with low memory (i.e. PIC).
   //Not used on targets with low memory (i.e. PIC).
   static char *owErrorMsg[125] =
   static char *owErrorMsg[125] =
   {
   {
   /*000*/ "No Error Was Set",
   /*000*/ "No Error Was Set",
Line 300... Line 295...
   char *owGetErrorMsg(int err)
   char *owGetErrorMsg(int err)
   {
   {
      return owErrorMsg[err];
      return owErrorMsg[err];
   }
   }
 
 
#ifndef __C51__
 
   //--------------------------------------------------------------------------
   //--------------------------------------------------------------------------
   // The 'owPrintErrorMsg' is the method for printing an error from the stack.
   // The 'owPrintErrorMsg' is the method for printing an error from the stack.
   // The destination for the print is specified by the argument, fileno, which
   // The destination for the print is specified by the argument, fileno, which
   // can be stderr, stdout, or a log file.  In non-debug mode, the output is
   // can be stderr, stdout, or a log file.  In non-debug mode, the output is
   // of the form:
   // of the form:
Line 327... Line 321...
   #else
   #else
      int err = owGetErrorNum();
      int err = owGetErrorNum();
      fprintf(filenum,"Error %d: %s\r\n",err,owErrorMsg[err]);
      fprintf(filenum,"Error %d: %s\r\n",err,owErrorMsg[err]);
   #endif
   #endif
   }
   }
#endif //__C51__
 
 
 
   // Same as above, except uses default printf output
   // Same as above, except uses default printf output
   void owPrintErrorMsgStd()
   void owPrintErrorMsgStd()
   {
   {
   #ifdef DEBUG
   #ifdef DEBUG

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.