Ejemplo n.º 1
0
int main(int programEnd, char *argv[])
{
   (void)programEnd;  //Pointer to end of used memory
   (void)argv;
	
	

   UartPrintfCritical("Starting RTOS\n");
#ifdef WIN32
   OS_Init((uint32*)HeapSpace, sizeof(HeapSpace));
#else
   //Remaining space after program in 1MB external RAM
   OS_Init((uint32*)programEnd, 
           RAM_EXTERNAL_BASE + RAM_EXTERNAL_SIZE - programEnd); 
#endif
   UartInit();
   OS_ThreadCreate("Main", MainThread, NULL, 100, 4000);
  OS_Start();
   
   
   /*****************************************************************/
 
   
   return 0;
}
Ejemplo n.º 2
0
int main(void) {
  OS_IncDI();                      /* Initially disable interrupts  */
  OS_InitKern();                   /* Initialize OS                 */
  OS_InitHW();                     /* Initialize Hardware for OS    */
  OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
  OS_Start();                      /* Start multitasking            */
  return 0;
}
Ejemplo n.º 3
0
int main(void) 
{
  WDTCTL   = WDTPW + WDTHOLD                         ;
  Init_CLK()                                         ;
  Init_J60SPI()                                      ;
  MAIN_POWER_ON                                      ;
  __delay_cycles(5000000)                            ;
  P9DIR   |= IrDA_OUT                                ;
  P9OUT   &=~IrDA_OUT                                ;
  Init_EtherNet()                                    ;
  ENC_SLEEP()                                        ; // 省电  
    
  OS_IncDI()                                         ; // 屏蔽中断
  OS_InitKern()                                      ; // 初始化系统内核
  OS_InitHW()                                        ; // 初始化硬件
  Init_Func()                                        ;
  Init_UART()                                        ;  
  Init_RSUART()                                      ;
  Ini_LED(8)                                         ;
  Init_ADC()                                         ;
  Init_RTC()                                         ;
  LCD_Init()                                         ;

  LED_POWER_ON                                       ;
  BackLight()                                        ;
  OS_CREATERSEMA(&SemaLCD)                           ;
  OS_CREATERSEMA(&SemaSPI)                           ;
  LED_Disp_Float(3.1415925,7,FIT_ZERO)               ;
  LED_Flicker_Digit(8,1)                             ;  
  Color     = Black                                  ;
  Color_BK  = 0xEF9F                                 ;
  
  OS_CREATETASK(&Seg7LED_TASK_TCB, 
                "Seg7LedTask", 
                Seg7LedRefresh, 100, 
                Seg7LED_TASK_STACK  )                ;
  
  OS_CREATETASK(&LCD_TASK_TCB, 
                "LCD_Task", 
                LCD_Task, 100, 
                LCD_TASK_STACK  )                    ;
  
  OS_CREATETASK(&MENU_OP_TASK_TCB, 
                "MENU_OP_Task", 
                MENU_OP_Task, 100, 
                MENU_OP_TASK_STACK)                  ;

  OS_CREATETASK(&KEY_TP_TASK_TCB, 
                "KEY_TP_Task", 
                Key_TP_Task, 100, 
                KEY_TP_TASK_STACK  )                 ;
  
  
  OS_Start()                                         ; 
  return 0                                           ;
}
Ejemplo n.º 4
0
int main(void) {
    OS_IncDI();                      /* Disable interrupts */
    OS_InitKern();                   /* Initialize OS */
    OS_InitHW();                     /* Initialize Hardware */
    BSP_Init();                      /* Initialize LED ports */
    /* You need to create at least one task before calling OS_Start() */
    OS_CREATETASK(&WLFTASK, "Tests task", wolfTask, 100, WLFSTACK);
    OS_Start();                      /* Start the OS */
    return 0;
}
Ejemplo n.º 5
0
int main(int argc, char *argv[])
{
	SyslogStr("Calling - ",  __func__);
	
//	OS_CreateProcess(&test_proc, "test_os", process_entry, NULL);
	
	OS_Start();
	
	return 0;
}
Ejemplo n.º 6
0
/*********************************************************************
*
*       main
*/
int main(void) {
  OS_IncDI();                      // Initially disable interrupts
  OS_InitKern();                   // Initialize OS
  OS_InitHW();                     // Initialize Hardware for OS
  BSP_Init();                      // Initialize LED ports
  OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
  OS_CREATETASK(&TCBLP, "LP Task", LPTask,  99, StackLP);
  OS_Start();                      // Start multitasking
  return 0;
}
Ejemplo n.º 7
0
/*********************************************************************
*
*       main
*/
int main(void) {
  OS_IncDI();                      /* Initially disable interrupts  */
  OS_InitKern();                   /* Initialize OS                 */
  OS_InitHW();                     /* Initialize Hardware for OS    */
  /* You need to create at least one task here !                    */
  OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
  OS_CREATETASK(&TCBLP, "LP Task", LPTask,  50, StackLP);
  OS_Start();                      /* Start multitasking            */
  return 0;
}
Ejemplo n.º 8
0
/*********************************************************************
*
*       main
*
*********************************************************************/
int main(void) {
  OS_IncDI();                      /* Initially disable interrupts  */
  OS_InitKern();                   /* Initialize OS                 */
  OS_InitHW();                     /* Initialize Hardware for OS    */
  
  _start_kernel(0);
  
  OS_Start();                      /* Start multitasking            */
  return 0;
}
Ejemplo n.º 9
0
int main(void) {
  OS_IncDI();                   /* Initially disable interrupts     */
  OS_InitKern();                /* Initialize OS                    */
  OS_InitHW();                  /* Initialize Hardware for OS       */
  OS_Q_Create(&_MyQ, &_MyQBuffer, sizeof(_MyQBuffer));
  /* You need to create at least one task before calling OS_Start() */
  OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
  OS_CREATETASK(&TCBLP, "LP Task", LPTask,  50, StackLP);
  OS_DecRI();                   /* Enable interrupts before sending */
  OS_SendString("embOS OS_Q example");
  OS_SendString("\n\nDemonstrating message passing\n");
  OS_Start();                   /* Start multitasking               */
  return 0;
}
Ejemplo n.º 10
0
int main(void) {
   //remove to enable for detection of m16cs1. use interrupt.
   OS_IncDI();                      /* Initially disable interrupts  */

   //initialize OS
   OS_InitKern();
   //initialize Hardware for OS
   OS_InitHW();

   //Start lepton kernel
   _start_kernel(0);

   OS_Start();                      /* Start multitasking            */
   return 0;
}
Ejemplo n.º 11
0
int main(int argc, char *argv[])
{
	OS_SemInit(&input_ready, 0, 0);

	SyslogStr("Calling - ",  __func__);

	OS_CreatePeriodicTask( 100000, 100000, 20000, 0, stack1, sizeof(stack1), "LED1", &task1, task_input, &a);
	OS_CreatePeriodicTask( 10000, 10000, 3000, 1000, stack2, sizeof(stack2), "LED2", &task2, task_count, &b);
	OS_CreatePeriodicTask( 20000, 20000, 5000, 4000, stack3, sizeof(stack3), "LED3", &task3, task_3, &c);
	OS_CreateAperiodicTask(1, stack4, sizeof(stack4), "Menu", &task4, task_rtc, &d);

	OS_Start();

	return 0;
}
Ejemplo n.º 12
0
int main()
{
	OS_Start();
	//TASK Create
	TASK_Create(task1,1,2);
	TASK_Create(task2,2,5);
	TASK_Create(task3,5,6);
	while(1)
	{
		timer1++;
		TASK_Excute();
		printf("%d\n",timer1);
		sleep(1);
	}
	return 0;
}
Ejemplo n.º 13
0
void setup()
{
	eBoxInit();
	OS_Init();
	
	uart1.begin(9600);
	uart1.printf("\r\nuart1 9600 ok!");
	
		uart1.printf("\r\nos初始化!");

	OS_TaskCreate(task_1,&TASK_1_STK[TASK_1_STK_SIZE-1],TASK1_PRIO);
	OS_TaskCreate(task_2,&TASK_2_STK[TASK_2_STK_SIZE-1],TASK2_PRIO);
	OS_TaskCreate(task_3,&TASK_3_STK[TASK_3_STK_SIZE-1],TASK3_PRIO);
	uart1.printf("\r\nos创建任务成功");

	OS_Start();

}
Ejemplo n.º 14
0
/*!
 * @brief The entry point into the program.
 */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
	/* Write your local variable definition here */

	/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
	PE_low_level_init();
	/*** End of Processor Expert internal initialization.                    ***/

	/* Write your code here */
	OS_Init(CPU_CORE_CLK_HZ);

	//Important semaphores. Do it now!
	EventSemaphore = OS_SemaphoreCreate(0);
	InitSemaphore = OS_SemaphoreCreate(1);
	RtcSemaphore = OS_SemaphoreCreate(0);

	//Make some threads.
	CREATE_THREAD(InitThread, NULL, InitThreadStack, TP_INITTHREAD);
	CREATE_THREAD(MainThread, NULL, MainThreadStack, TP_MAINTHREAD);
	CREATE_THREAD(EventThread, NULL, EventThreadStack, TP_EVENTTHREAD);
	CREATE_THREAD(PacketThread, NULL, PacketThreadStack, TP_PACKETTHREAD);
	CREATE_THREAD(RtcThread, NULL, RtcThreadStack, TP_RTCTHREAD);

	//GOGOGOGOOGOGOGO
	OS_Start();

	//We don't go here.

	/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
Ejemplo n.º 15
0
//------------------------------------------------------------------------------
void OS::Kernel::Run()
{
    for(byte i = 0; i < scmRTOS_PROCESS_COUNT; i++)
    {
        TProcess* p = ProcessTable[i];

        if(!p) return;
    }

#ifdef scmRTOS_MEMORY_MANAGER_ENABLE
    MemoryManager::Init();
#endif

//    EXECUTE_PLATFORM_SPECIFIC_STUFF();
    START_SYSTEM_TIMER();

#ifdef scmRTOS_START_HOOK_ENABLE
    SystemStartUserHook();
#endif


    TStackItem* sp = ProcessTable[0]->StackPointer;
    OS_Start(sp);
}
Ejemplo n.º 16
0
void osStartKernel(void)
{
   //Start the scheduler
   OS_Start();
}
Ejemplo n.º 17
0
//............................................................................
int_t QF::run(void) {
    onStartup();     // QF callback to configure and start interrupts
    OS_Start();      // start embOS multitasking
    Q_ERROR_ID(100); // OS_Start() should never return
    return static_cast<int_t>(0); // dummy return to make the compiler happy
}
Ejemplo n.º 18
0
/*..........................................................................*/
int_t QF_run(void) {
    QF_onStartup();  /* QF callback to configure and start interrupts */
    OS_Start();      /* start embOS multitasking */
    Q_ERROR_ID(100); /* OS_Start() should never return */
    return (int_t)0; /* dummy return to make the compiler happy */
}