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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [rtos_test.c] - Diff between revs 226 and 235

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

Rev 226 Rev 235
Line 429... Line 429...
void HtmlThread(void *arg);
void HtmlThread(void *arg);
void ConsoleInit(void);
void ConsoleInit(void);
 
 
void MainThread(void *Arg)
void MainThread(void *Arg)
{
{
   int ch;
   int ch, i;
   (void)Arg;
   (void)Arg;
#ifdef __MMU_ENUM_H__
#ifdef __MMU_ENUM_H__
   OS_MMUInit();
   OS_MMUInit();
#endif
#endif
 
 
#ifdef INCLUDE_HTML
#ifdef INCLUDE_HTML
   IPInit(NULL);
   IPInit(NULL);
   HtmlInit(0);
   HtmlInit(1);
#endif
#endif
 
 
#ifdef INCLUDE_CONSOLE
#ifdef INCLUDE_CONSOLE
   ConsoleInit();
   ConsoleInit();
#endif
#endif
 
 
   for(;;)
   for(;;)
   {
   {
      printf("\n");
      printf("\n");
      printf("0 Exit\n");
 
      printf("1 CLib\n");
      printf("1 CLib\n");
      printf("2 Heap\n");
      printf("2 Heap\n");
      printf("3 Thread\n");
      printf("3 Thread\n");
      printf("4 Semaphore\n");
      printf("4 Semaphore\n");
      printf("5 Mutex\n");
      printf("5 Mutex\n");
Line 465... Line 464...
      printf("> ");
      printf("> ");
      ch = UartRead();
      ch = UartRead();
      printf("%c\n", ch);
      printf("%c\n", ch);
      switch(ch)
      switch(ch)
      {
      {
      case '0':
 
#ifndef WIN32
 
         //{
 
         //OS_FuncPtr_t funcPtr=NULL;
 
         //OS_CriticalBegin();
 
         //funcPtr(NULL);
 
         //}
 
#endif
 
         return;
 
      case '1': TestCLib(); break;
      case '1': TestCLib(); break;
      case '2': TestHeap(); break;
      case '2': TestHeap(); break;
      case '3': TestThread(); break;
      case '3': TestThread(); break;
      case '4': TestSemaphore(); break;
      case '4': TestSemaphore(); break;
      case '5': TestMutex(); break;
      case '5': TestMutex(); break;
Line 492... Line 482...
#endif
#endif
#ifdef WIN32
#ifdef WIN32
      case 'm': TestMathFull(); break;
      case 'm': TestMathFull(); break;
#endif
#endif
      case 'g': printf("Global=%d\n", ++Global); break;
      case 'g': printf("Global=%d\n", ++Global); break;
 
      default:
 
         printf("Error");
 
         for(i = 0; i < 30; ++i)
 
         {
 
            if(kbhit())
 
               ch = UartRead();
 
            else
 
               OS_ThreadSleep(1);
 
         }
 
         break;
      }
      }
   }
   }
}
}
 
 
 
 

powered by: WebSVN 2.1.0

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