int main(void) { //lenguaje C orientado a microcontroladores rev 1 //quidel.inele.ufro.cl //cc5x //printf("%i\n",0xFFFFFFFF); /* Initializing shared Queues */ dispatcherQueue = osQueueCreate(25,sizeof(DispCmd)); executerCmdQueue = osQueueCreate(1,sizeof(ExeCmd)); executerStatQueue = osQueueCreate(1,sizeof(int)); /* Initializing shared Semaphore */ osSemaphoreCreate(&repoDataSem); /* Crating all task (the others are created inside taskDeployment) */ osCreateTask(taskDispatcher,"dispatcher",2*configMINIMAL_STACK_SIZE,NULL,3); osCreateTask(taskExecuter, "executer", 5*configMINIMAL_STACK_SIZE, NULL, 4); osCreateTask(taskHousekeeping, "housekeeping", 2*configMINIMAL_STACK_SIZE, NULL, 2); osCreateTask(taskConsole, "console", 2*configMINIMAL_STACK_SIZE, NULL, 2); /* Configure Peripherals */ /* On reset */ on_reset(); /* Start the scheduler. Should never return */ osScheduler(); return 0; }
int main(void) { /* On reset */ on_reset(); /* Init software subsystems */ log_init(); // Logging system cmd_repo_init(); // Command repository initialization dat_repo_init(); // Update status repository LOGI(tag, "Creating tasks..."); /* Initializing shared Queues */ dispatcher_queue = osQueueCreate(25,sizeof(cmd_t *)); executer_cmd_queue = osQueueCreate(1,sizeof(cmd_t *)); executer_stat_queue = osQueueCreate(1,sizeof(int)); int n_threads = 3; os_thread threads_id[n_threads]; /* Crating system task (the others are created inside taskDeployment) */ osCreateTask(taskDispatcher,"dispatcher", 2*configMINIMAL_STACK_SIZE,NULL,3, &threads_id[0]); osCreateTask(taskExecuter, "executer", 5*configMINIMAL_STACK_SIZE, NULL, 4, &threads_id[1]); osCreateTask(taskTest, "test", 2*configMINIMAL_STACK_SIZE, "TEST1", 2, &threads_id[2]); #ifndef ESP32 /* Start the scheduler. Should never return */ osScheduler(threads_id, n_threads); return 0; #endif }
int main(void) #endif { /* On reset */ on_reset(); printf("\n\n--------- FLIGHT SOFTWARE START ---------\n"); printf("\t Version: %s\n", SCH_SW_VERSION); printf("\t Device : %d (%s)\n", SCH_DEVICE_ID, SCH_NAME); printf("-----------------------------------------\n\n"); /* Init software subsystems */ log_init(); // Logging system cmd_repo_init(); // Command repository initialization dat_repo_init(); // Update status repository /* Initializing shared Queues */ dispatcher_queue = osQueueCreate(25,sizeof(cmd_t *)); if(dispatcher_queue == 0) LOGE(tag, "Error creating dispatcher queue"); executer_stat_queue = osQueueCreate(1,sizeof(int)); if(executer_stat_queue == 0) LOGE(tag, "Error creating executer stat queue"); executer_cmd_queue = osQueueCreate(1,sizeof(cmd_t *)); if(executer_cmd_queue == 0) LOGE(tag, "Error creating executer cmd queue"); int n_threads = 4; os_thread threads_id[n_threads]; LOGI(tag, "Creating basic tasks..."); /* Crating system task (the others are created inside taskInit) */ int t_inv_ok = osCreateTask(taskDispatcher,"invoker", SCH_TASK_DIS_STACK, NULL, 3, &threads_id[1]); int t_exe_ok = osCreateTask(taskExecuter, "receiver", SCH_TASK_EXE_STACK, NULL, 4, &threads_id[2]); int t_wdt_ok = osCreateTask(taskWatchdog, "watchdog", SCH_TASK_WDT_STACK, NULL, 2, &threads_id[0]); int t_ini_ok = osCreateTask(taskInit, "init", SCH_TASK_INI_STACK, NULL, 3, &threads_id[3]); /* Check if the task were created */ if(t_inv_ok != 0) LOGE(tag, "Task invoker not created!"); if(t_exe_ok != 0) LOGE(tag, "Task receiver not created!"); if(t_wdt_ok != 0) LOGE(tag, "Task watchdog not created!"); if(t_ini_ok != 0) LOGE(tag, "Task init not created!"); #ifndef ESP32 /* Start the scheduler. Should never return */ osScheduler(threads_id, n_threads); return 0; #endif }