void main(void) { OS_Init(); // OS System init ADC_init(); // Should be done first PWM_init(); // Beware pwm ports go together with ANALOG in setPortBIO(0x04); // Set port B in output mode setPortDIO(0x00); // Set port D in output mode XLCDInit(); // initialize the LCD module XLCDClear(); // Push een kleine lijst //push(2); //push(1); //push(3); OS_Task_Create(0, Task_Server); // BT Connection OS_Task_Create(1, Task_Hartbeat); // Show I am alive (called by scheduler)// OS_Task_Create(1, Task_Run); // Run me through the maze (called by scheduler)// OS_Task_Create(2, Task_Display); // be called by scheduler OS_Run(); // Run scheduler }
//________________________________________________________________________________ int main(void) { char i; ConfigDevice(); #ifndef SIMULATION ConfigDac(); #endif FillTableT(); FillTableInvDV(); OS_Init(); OS_Task_Create(ProcessUartMsg, &task0); OS_Task_Create(Pid, &task1); OS_Sem_Create(&UartRcMsgSem,0); PR2 = OS_TMR_TICK; // timer tick = 1000 instruction cycles=0.1 ms T2CON = 0x05; ReportStartUp(); while (1) { if(TMR1IF) { TMR1IF=0; OS_Task_Resume(&task1); } asm("CLRWDT"); OS_Scheduler(); } }
void main() { CNC_INITIALIZE(); // Init periphery OS_Init(); // Init OS OS_Task_Create(1,CNC_CONTROL); OS_Task_Create(2,STEPPER_CONTROL); OS_EI(); // Enable interrupts OS_Run(); }
int main (void) { Init(); // Init periphery OS_Init(); // Init OS OS_Task_Create(0, Task_Rolling); // Create tasks. OS_Task_Create(0, Task_SetSpeed); // OS_Task_Create(0, Task_Button); // m_cPosition = 0; // rotation phase m_cDirection = 1; // direction OS_EI(); // Enable interrupts OS_Run(); // Running scheduler }
void main(void) { clock_int_48MHz(); PIC_Init(); // Configurações gerais do PIC OS_Init(); TRISB=0b00000000; TRISA=0b00000000; OS_Task_Create(1,Task_1); // Criando uma tarefa, prioridade 1 OS_Task_Create(2,Task_2); // Criando uma tarefa, prioridade 2 OS_Task_Create(3,Task_3); // Criando uma tarefa, prioridade 3 //OS_Task_Create(4,Task_4); // Criando uma tarefa, prioridade 4 OS_EI(); // Habilita interrupcoes OS_Run(); // Executa o RTOS }
//**************************************************************************** //**** main //**************************************************************************** void main(void){ Inicio(); OS_Init(); // Init OS OS_Task_Define(USB); // Define tasks. OS_Task_Define(Gla); OS_Task_Define(Glc_PIDdiscreto); OS_Task_Define(MotorX); OS_Task_Define(MotorY); OS_Task_Define(MotorZ); OS_Task_Define(MotorE); // Create tasks. // if 0 = no priorities OS_Task_Create(0, USB); OS_Task_Create(0, Gla); OS_Task_Create(0, Glc_PIDdiscreto); OS_Task_Create(0, MotorX); OS_Task_Create(0, MotorY); OS_Task_Create(0, MotorZ); OS_Task_Create(0, MotorE); // Create tasks, Task priority. Allowed values from 0(highest) to 7(lowest) /*OS_Task_Create(0, USB); OS_Task_Create(7, Gla); OS_Task_Create(1, Glc_PIDdiscreto); OS_Task_Create(2, MotorX); OS_Task_Create(2, MotorY); OS_Task_Create(2, MotorZ); OS_Task_Create(2, MotorE); OS_Bsem_Set(BS_GLAGLC_FREE);*/ OS_EI(); // Enable interrupts OS_Run(); // Running scheduler }