int main() { long lRetVal = -1; val=0; BoardInit(); PinMuxConfig(); LedInit(); //create OS tasks lRetVal = osi_TaskCreate(PushButtonHandler, (signed char*) "PushButtonHandler", OSI_STACK_SIZE, NULL, 2, &g_PushButtonTask); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } lRetVal = osi_TaskCreate(MainLoop, (signed char*)"MainLoop", OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } osi_start(); for(;;) { } return 0; }
STATIC void mptask_pre_init (void) { // this one only makes sense after a poweron reset pyb_rtc_pre_init(); // Create the simple link spawn task ASSERT (OSI_OK == VStartSimpleLinkSpawnTask(SIMPLELINK_SPAWN_TASK_PRIORITY)); // Allocate memory for the flash file system ASSERT ((sflash_fatfs = mem_Malloc(sizeof(FATFS))) != NULL); // this one allocates memory for the nvic vault pyb_sleep_pre_init(); // this one allocates memory for the WLAN semaphore wlan_pre_init(); // this one allocates memory for the updater semaphore updater_pre_init(); // this one allocates memory for the socket semaphore modusocket_pre_init(); //CRYPTOHASH_Init(); #ifdef DEBUG ASSERT (OSI_OK == osi_TaskCreate(TASK_Servers, (const signed char *)"Servers", SERVERS_STACK_SIZE, NULL, SERVERS_PRIORITY, &svTaskHandle)); #else ASSERT (OSI_OK == osi_TaskCreate(TASK_Servers, (const signed char *)"Servers", SERVERS_STACK_SIZE, NULL, SERVERS_PRIORITY, NULL)); #endif }
STATIC void mptask_pre_init (void) { #if MICROPY_HW_ENABLE_RTC pybrtc_init(); #endif // Create the simple link spawn task ASSERT (OSI_OK == VStartSimpleLinkSpawnTask(SIMPLELINK_SPAWN_TASK_PRIORITY)); // Allocate memory for the flash file system ASSERT ((sflash_fatfs = mem_Malloc(sizeof(FATFS))) != NULL); // this one allocates memory for the nvic vault pybsleep_pre_init(); // this one allocates mameory for the WLAN semaphore wlan_pre_init(); #if MICROPY_HW_HAS_SDCARD pybsd_init0(); #endif #ifdef DEBUG ASSERT (OSI_OK == osi_TaskCreate(TASK_Servers, (const signed char *)"Servers", SERVERS_STACK_SIZE, NULL, SERVERS_PRIORITY, &svTaskHandle)); #else ASSERT (OSI_OK == osi_TaskCreate(TASK_Servers, (const signed char *)"Servers", SERVERS_STACK_SIZE, NULL, SERVERS_PRIORITY, NULL)); #endif }
int main() { MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]); MAP_IntEnable(FAULT_SYSTICK); MAP_IntMasterEnable(); PRCMCC3200MCUInit(); cc3200_leds_init(); /* Console UART init. */ MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK); MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */ MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */ MAP_UARTConfigSetExpClk( CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH), CONSOLE_BAUD_RATE, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); MAP_UARTFIFODisable(CONSOLE_UART); setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); VStartSimpleLinkSpawnTask(8); osi_TaskCreate(v7_task, (const signed char *) "v7", V7_STACK_SIZE + 256, NULL, 3, NULL); osi_TaskCreate(blinkenlights_task, (const signed char *) "blink", 256, NULL, 9, NULL); osi_start(); return 0; }
/*! * \brief This websocket Event is called when WebSocket Server receives data * from client. * * * \param[in] uConnection Websocket Client Id * \param[in] *ReadBuffer Pointer to the buffer that holds the payload. * * \return none. * */ void WebSocketRecvEventHandler(UINT16 uConnection, char *ReadBuffer) { char *camera = "capture"; /* * UINT8 Opcode; * struct HttpBlob Write; */ g_uConnection = uConnection; g_Buffer = ReadBuffer; g_close = 0; if (!strcmp(ReadBuffer,camera)) { if(!g_iCameraTaskHdl) { osi_TaskCreate(CameraAppTask, "CameraApp", 1024, NULL, CAMERA_SERVICE_PRIORITY, &g_iCameraTaskHdl); } } //Free memory as we are not using anywhere later free(g_Buffer); g_Buffer = NULL; /* Enter websocket application code here */ return; }
//**************************************************************************** //! Main function //! //! \param none //! //! \return None. // //**************************************************************************** void main() { // Initialize the board BoardInit(); // Configure the pinmux settings for the peripherals exercised PinMuxConfig(); #ifndef NOTERM // Configuring UART InitTerm(); ClearTerm(); #endif // Start the TCPServer task long lRetVal = osi_TaskCreate(InfiniteLoopTask, (const signed char *)"Infinite Loop Task", OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); while(1); } // Start the task scheduler osi_start(); TimerDeinitStop(); }
int main(void) { // init the hardware initBoard(); UART_PRINT("[Blink] Start application\r\n"); // create the main application message queue // this call properly enables the OSI scheduler to function short status = osi_MsgQCreate(&g_ApplicationMessageQueue, "ApplicationMessageQueue", sizeof(ApplicationMessage), 1); if (status < 0) { UART_PRINT("[Blink] Create application message queue error\r\n"); ERR_PRINT(status); LOOP_FOREVER(); } // start the main application task // this is necessary because SimpleLink host driver is started by sl_Start(), // which cannot be called on before the OSI scheduler is started status = osi_TaskCreate(startApplication, (signed char *)"Blink", OSI_STACK_SIZE, NULL, OOB_TASK_PRIORITY, NULL); if (status < 0) { UART_PRINT("[Blink] Start application error\r\n"); ERR_PRINT(status); LOOP_FOREVER(); } // start the OSI scheduler osi_start(); return 0; }
//**************************************************************************** // //! Main function //! //! \param none //! //! This function //! 1. Invokes the SLHost task //! 2. Invokes the GetNTPTimeTask //! //! \return None. // //**************************************************************************** void main() { long lRetVal = -1; // // Initialize Board configurations // BoardInit(); // // Enable and configure DMA // UDMAInit(); // // Pinmux for UART // PinMuxConfig(); // // Configuring UART // InitTerm(); // // Display Application Banner // DisplayBanner(APP_NAME); // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the GetNTPTime task // lRetVal = osi_TaskCreate(GetNTPTimeTask, (const signed char *)"Get NTP Time", OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
//***************************************************************************** // MAIN FUNCTION //***************************************************************************** void main() { #if defined(ewarm) IntVTableBaseSet((unsigned long)&__vector_table); #endif // // Board Initialization // MCUInit(); InitTerm(); //set the parameters of uart0 // // Enable the SYSTICK interrupt // IntEnable(FAULT_SYSTICK); // // Start the SimpleLink Host // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // // Start the WlanAPMode task // osi_TaskCreate( WlanAPMode, (const signed char*)"wireless LAN in AP mode", 2048, NULL, 1, NULL ); // // Start the task scheduler // osi_start(); }
int main(void) { // create a task to run legacy loop function osi_TaskCreate( vTaskDefault, ( signed portCHAR * ) "LM4F", OSI_DEFAULT_STACK_SIZE, NULL, 1, NULL ); //RTOS start osi_start(); }
bool mg_start_task(int priority, int stack_size, mg_init_cb mg_init) { if (osi_MsgQCreate(&s_mg_q, "MG", sizeof(struct mg_q_msg), 16) != OSI_OK) { return false; } if (osi_TaskCreate(mg_task, (const signed char *) "MG", stack_size, (void *) mg_init, priority, NULL) != OSI_OK) { return false; } return true; }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** int main() { long lRetVal = -1; // // Board Initialization // BoardInit(); // // Enable and configure DMA // UDMAInit(); // // Pinmux for UART // PinMuxConfig(); // // Configuring UART // InitTerm(); // // Display Application Banner // DisplayBanner(APP_NAME); // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the Receiving file // lRetVal = osi_TaskCreate(cmd_dispatcher, (const signed char *)"TFTP", OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); return 0; }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** void main() { // // Board Initialization // BoardInit(); // // Pinmux for UART // PinMuxConfig(); #ifndef NOTERM // // Configuring UART // InitTerm(); // // Display Application Banner // DisplayBanner(APP_NAME); #endif // // Enable and configure DMA // UDMAInit(); // // Start the SimpleLink Host // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // // Start the HttpServer Task // // osi_TaskCreate(HttpServerAppTask, "WebSocketApp", OSI_STACK_SIZE, NULL, HTTP_SERVER_APP_TASK_PRIORITY, NULL ); UART_PRINT("HttpServerApp Initialized \n\r"); // // Start the task scheduler // osi_start(); return; }
int main(void) { long lRetVal = -1; // // initialize board configurations // BoardInit(); // // Pinmux GPIO for LEDs // PinMuxConfig(); #ifndef NOTERM // // Configuring UART // InitTerm(); #endif // // Configure LEDs // GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); // // Simplelinkspawntask // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } lRetVal = osi_TaskCreate(XmppClient, (const signed char*)"XmppClient",\ OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } osi_start(); while(1) { } }
//**************************************************************************** // //! Main function //! //! \param none //! //! This function //! 1. Invokes the SLHost task //! 2. Invokes the LPDSTCPServerTask //! //! \return None. // //**************************************************************************** void main() { long lRetVal = -1; // // Initialize the board // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); #ifndef NOTERM // // Configuring UART // InitTerm(); ClearTerm(); #endif // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the TCPServer task // lRetVal = osi_TaskCreate(TCPServerTask, (const signed char *)"DeepSleep TCP", OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
//***************************************************************************** // //! Main //! //! \param none //! //! This function //! 1. Invokes the SLHost task //! 2. Invokes the MqttClient //! //! \return None //! //***************************************************************************** void main() { long lRetVal = -1; // // Initialize the board configurations // BoardInit(); // // Pinmux for UART // PinMuxConfig(); // // Configuring UART // InitTerm(); // // Display Application Banner // DisplayBanner("MQTT_Client"); // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the MQTT Client task // osi_MsgQCreate(&g_PBQueue,"PBQueue",sizeof(event_msg),10); lRetVal = osi_TaskCreate(MqttClient, (const signed char *)"Mqtt Client App", OSI_STACK_SIZE, NULL, 2, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
int main() { #ifndef USE_TIRTOS MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]); #endif MAP_IntEnable(FAULT_SYSTICK); MAP_IntMasterEnable(); PRCMCC3200MCUInit(); /* Console UART init. */ MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK); MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */ MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */ MAP_UARTConfigSetExpClk( CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH), CONSOLE_BAUD_RATE, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); MAP_UARTFIFOLevelSet(CONSOLE_UART, UART_FIFO_TX1_8, UART_FIFO_RX4_8); MAP_UARTFIFOEnable(CONSOLE_UART); setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(stderr, NULL, _IOLBF, 0); cs_log_set_level(LL_INFO); cs_log_set_file(stdout); LOG(LL_INFO, ("Hello, world!")); MAP_PinTypeI2C(PIN_01, PIN_MODE_1); /* SDA */ MAP_PinTypeI2C(PIN_02, PIN_MODE_1); /* SCL */ I2C_IF_Open(I2C_MASTER_MODE_FST); /* Set up the red LED. Note that amber and green cannot be used as they share * pins with I2C. */ MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK); MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT); GPIO_IF_LedConfigure(LED1); GPIO_IF_LedToggle(MCU_RED_LED_GPIO); if (VStartSimpleLinkSpawnTask(8) != 0) { LOG(LL_ERROR, ("Failed to create SL task")); } if (osi_TaskCreate(mg_task, (const signed char *) "mg", MG_TASK_STACK_SIZE, NULL, 3, NULL) != 0) { LOG(LL_ERROR, ("Failed to create MG task")); } osi_start(); return 0; }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** void main(void) { int iRetVal; // // Board Initialisation // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); // // Initialize the platform // platform_init(); // // Configuring UART // g_tUartHndl = uart_open(PRCM_UARTA0); // // Start the SimpleLink Host // iRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(iRetVal < 0) { UART_PRINT("could not create simplelink task\n\r"); LOOP_FOREVER(); } // // setting up timer and gpio as source for wake up from HIBERNATE // iRetVal = osi_TaskCreate(TimerGPIOTask, (const signed char *)"set wk_src for hibernate", OSI_STACK_SIZE, NULL, 1, NULL ); if(iRetVal < 0) { UART_PRINT("Task creation failed\n\r"); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
int main(void) { // // Board Initialization // BoardInit(); // // Enable and configure DMA // UDMAInit(); //Config pins PinMuxConfig(); InitPWMModules(); VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); osi_TaskCreate(HttpServerAppTask, "WebSocketApp", OSI_STACK_SIZE, NULL, HTTP_SERVER_APP_TASK_PRIORITY, NULL ); osi_TaskCreate(TargetTask, "Target", OSI_STACK_SIZE, NULL, TARGET_TASK_PRIORITY, NULL ); osi_start(); return 0; }
void platform_init(void) { long lRetVal; // // Board Initialization // BoardInit(); // // configure the GPIO pins for LEDs,UART // PinMuxConfig(); // // Configure the UART // #ifndef NOTERM InitTerm(); ClearTerm(); #endif //NOTERM my_logger_init(logger_writer); // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); ASSERT(lRetVal >= 0); // // Start the IoTKit runloop task // lRetVal = osi_TaskCreate(application_main, (const signed char*)"appmain", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, NULL); ASSERT(lRetVal >= 0); UDMAInit(); _platform_spi_init(); // // Start the task scheduler // osi_start(); }
//**************************************************************************** // //! Main function //! //! \param none //! //! This function //! 1. Invokes the SLHost task //! 2. Invokes the HIBUDPBroadcastTask //! //! \return None. // //**************************************************************************** void main() { long lRetVal = -1; // // Initialize board confifurations // BoardInit(); // // Pinmux for UART & LED // PinMuxConfig(); #ifndef NOTERM // // Configuring UART // InitTerm(); #endif // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the HIBUDPBroadcast task // lRetVal = osi_TaskCreate(HIBUDPBroadcastTask, (const signed char *)"HIB UDP Broadcast", OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
long ControlTaskCreate() { long lRetVal = -1; lRetVal = InitControl(MICStartStopControl,SpeakerStartStopControl); ASSERT_ON_ERROR(lRetVal); lRetVal = osi_MsgQCreate(&g_ControlMsgQueue,"g_ControlMsgQueue",\ sizeof(tTxMsg),1); ASSERT_ON_ERROR(lRetVal); lRetVal = osi_TaskCreate(AudioControlTask, \ (signed char*)"AudioControlTask",\ 2048, NULL, 1, &g_AudioControlTask ); ASSERT_ON_ERROR(lRetVal); return SUCCESS; }
//***************************************************************************** // MAIN FUNCTION //***************************************************************************** void main() { #if defined(ewarm) IntVTableBaseSet((unsigned long)&__vector_table); #endif // // Board Initialization // MCUInit(); // // Enable the SYSTICK interrupt // IntEnable(FAULT_SYSTICK); UART_PRINT("hellow i am in\n\r"); // // Start the SimpleLink Host // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // // WlanStationMode(NULL); // UART_PRINT("hellow i am in\n\r"); // Start the WlanStationMode task // osi_TaskCreate( WlanStationMode, (const signed char*)"wireless LAN in station mode", 2048, NULL, 1, NULL ); // // Start the task scheduler // osi_start(); }
//**************************************************************************** // //! Main function //! //! \param none //! //! This function //! 1. Invokes the Loader Task //! //! \return None. // //**************************************************************************** void main() { BoardInit(); PinMuxConfig(); InitTerm(); DisplayBanner(APPLICATION_NAME); // Start the SimpleLink Host VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // Start the Loader task osi_TaskCreate(Loader, (const signed char*)"Loader Task", \ OSI_STACK_SIZE, NULL, 1, NULL ); // Start the task scheduler osi_start(); }
//***************************************************************************** // MAIN FUNCTION //***************************************************************************** void main() { // // Board Initialization // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); #ifndef NOTERM // // Configuring UART // InitTerm(); #endif // // Display banner // DisplayBanner(APP_NAME); // // Start the SimpleLink Host // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // // Start the WlanAPMode task // osi_TaskCreate( WlanAPMode, (const signed char*)"wireless LAN in AP mode", OSI_STACK_SIZE, NULL, 1, NULL ); // // Start the task scheduler // osi_start(); }
void SystemTaskCreate() { // Initializing DMA UDMAInit(); // Start the SimpleLink Host // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // // Start the GetWeather task // osi_TaskCreate(SystemTaskManager, (const signed char *)"system", OSI_STACK_SIZE, NULL, 1, NULL ); }
int main() { long lRetVal = -1; // // Initialize Board configurations // BoardInit(); // // Configuring UART // #ifndef NOTERM InitTerm(); #endif //NOTERM // // Simplelinkspawntask // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Create 'CameraService' task // lRetVal = osi_TaskCreate(CameraService,(signed char *) "CameraService", OSI_STACK_SIZE, NULL, 1, NULL); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } osi_start(); return 0; }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** void main(void) { int iRetVal; // // Board Initialization // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); // // Initialize the platform // platform_init(); // // Configuring UART // g_tUartHndl = uart_open(PRCM_UARTA0); #ifdef DEBUG_GPIO // // setting up GPIO for indicating the entry into LPDS // tGPIODbgHndl = cc_gpio_open(GPIO_09, GPIO_DIR_OUTPUT); cc_gpio_write(tGPIODbgHndl, GPIO_09, 1); #endif // // Start the SimpleLink Host // iRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(iRetVal < 0) { UART_PRINT("could not create simplelink task\n\r"); LOOP_FOREVER(); } // // sync object for inter thread communication // iRetVal = osi_MsgQCreate(&g_tConnectionFlag, NULL, sizeof( unsigned char ), 1); if(iRetVal < 0) { UART_PRINT("could not create msg queue\n\r"); LOOP_FOREVER(); } // // Task creation for providing host_irq as a wake up source(LPDS) // iRetVal = osi_TaskCreate(UDPServerTask, (const signed char *)"UDP Server waiting to recv"\ "packets", OSI_STACK_SIZE, NULL, 1, NULL ); if(iRetVal < 0) { UART_PRINT("First Task creation failed\n\r"); LOOP_FOREVER(); } // // setting up timer and gpio as source for wake up from lPDS // iRetVal = osi_TaskCreate(TimerGPIOTask, (const signed char*)"Configuring Timer and GPIO as"\ " wake src", OSI_STACK_SIZE, NULL, 1, NULL ); if(iRetVal < 0) { UART_PRINT("Second Task creation failed\n\r"); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
int main() { long lRetVal = -1; // // Initialize Board configurations // BoardInit(); // // Pinmuxing for GPIO,UART // PinMuxConfig(); // // configure LEDs // GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); #ifndef NOTERM // // Configuring UART // InitTerm(); #endif // // Display Welcome Message // DisplayBanner(APP_NAME); // Generate Menu Output for Application OutputMenu(); // Initialize AP security params SecurityParams.Key = (signed char *)SECURITY_KEY; SecurityParams.KeyLen = strlen(SECURITY_KEY); SecurityParams.Type = SECURITY_TYPE; uiUartCmd=0; // // Simplelinkspawntask // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } lRetVal = osi_MsgQCreate(&g_PBQueue,"PBQueue",sizeof(tPushButtonMsg),1); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } lRetVal = osi_TaskCreate(PushButtonHandler, \ (signed char*)"PushButtonHandler", \ OSI_STACK_SIZE , NULL, \ TASK_PRIORITY+2, &g_PushButtonTask ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } lRetVal = osi_TaskCreate(SimpleEmail, (signed char*)"SimpleEmail", \ OSI_STACK_SIZE, \ NULL, TASK_PRIORITY+1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } osi_start(); while(1) { } }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** void main() { /* Display banner */ Report("\r\n\r\nTexas Instruments CC3200 Application - Powered by 2lemetry's ThingFabric Cloud\r\n\r\n"); BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); PinConfigSet(PIN_58,PIN_STRENGTH_2MA|PIN_STRENGTH_4MA,PIN_TYPE_STD_PD); // // UART Init // InitTerm(); // // LED Init // GPIO_IF_LedConfigure(LED1); //Turn Off the LEDs GPIO_IF_LedOff(MCU_RED_LED_GPIO); // // I2C Init // I2C_IF_Open(I2C_MASTER_MODE_FST); //Init Temprature Sensor TMP006DrvOpen(); //Init Accelerometer Sensor BMA222Open(); // // Simplelinkspawntask // VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); // Create semaphore to indicate CC3200 connected to an access point if (osi_SyncObjCreate(&semaphore_Connected) != 0) { Report("Semaphore not created\r\n"); } // // Create OOB Task // Report("Starting OOBTask\r\n"); osi_TaskCreate(OOBTask, (signed char*)"OOBTask", OSI_STACK_SIZE, NULL, OOB_TASK_PRIORITY, NULL ); // // Create mqtt Task // Report("Starting mqttTask\r\n"); osi_TaskCreate(mqttTask, (signed char*)"mqttTask", OSI_STACK_SIZE, NULL, OOB_TASK_PRIORITY, NULL ); // // Start OS Scheduler // osi_start(); while (1) { } }