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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [uart.c] - Diff between revs 188 and 234

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 188 Rev 234
Line 321... Line 321...
void UartPrintf(const char *format,
void UartPrintf(const char *format,
                int arg0, int arg1, int arg2, int arg3,
                int arg0, int arg1, int arg2, int arg3,
                int arg4, int arg5, int arg6, int arg7)
                int arg4, int arg5, int arg6, int arg7)
{
{
   uint8 *ptr;
   uint8 *ptr;
 
#if 0
 
   //Check for string "!M#~" to mask print statement
 
   static char moduleLevel[26];
 
   if(format[0] == '!' && format[3] == '~' &&
 
      'A' <= format[1] && format[1] <= 'Z')
 
   {
 
      int module = format[1] - 'A';
 
      int level = format[2] - '5';
 
      if(format[2] == '#')
 
      {
 
         //Set level with "!M#~#"
 
         moduleLevel[module] = (char)(format[4] - '5');
 
         return;
 
      }
 
      if(level < moduleLevel[module])
 
         return;
 
      format += 4;
 
   }
 
#endif
   OS_SemaphorePend(SemaphoreUart, OS_WAIT_FOREVER);
   OS_SemaphorePend(SemaphoreUart, OS_WAIT_FOREVER);
   sprintf(PrintfString, format, arg0, arg1, arg2, arg3,
   sprintf(PrintfString, format, arg0, arg1, arg2, arg3,
           arg4, arg5, arg6, arg7);
           arg4, arg5, arg6, arg7);
   ptr = (uint8*)PrintfString;
   ptr = (uint8*)PrintfString;
   while(*ptr)
   while(*ptr)
Line 464... Line 483...
   MemoryWrite(GPIO0_OUT, value);  //Change LEDs
   MemoryWrite(GPIO0_OUT, value);  //Change LEDs
}
}
 
 
 
 
/******************************************/
/******************************************/
#ifndef WIN32
 
int puts(const char *string)
int puts(const char *string)
{
{
   uint8 *ptr;
   uint8 *ptr;
   OS_SemaphorePend(SemaphoreUart, OS_WAIT_FOREVER);
   OS_SemaphorePend(SemaphoreUart, OS_WAIT_FOREVER);
   ptr = (uint8*)string;
   ptr = (uint8*)string;
Line 491... Line 509...
 
 
int kbhit(void)
int kbhit(void)
{
{
   return ReadBuffer->read != ReadBuffer->write;
   return ReadBuffer->read != ReadBuffer->write;
}
}
#endif
 
 
 
 
 
/******************************************/
/******************************************/
#if 0
#if 0
int LogArray[100], LogIndex;
int LogArray[100], LogIndex;

powered by: WebSVN 2.1.0

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