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 //! //! \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() { 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; }
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; }
//**************************************************************************** // //! 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(); }
//**************************************************************************** // 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_LedOn(MCU_RED_LED_GPIO); if (VStartSimpleLinkSpawnTask(8) != 0) { LOG(LL_ERROR, ("Failed to create SL task")); } if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) { 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(); }
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(); }
void main(void) { BoardInit(); PinMuxConfig(); UartA0Init(); // create task SystemTaskCreate(); // start the task scheduler osi_start(); while(1) { } }
//**************************************************************************** // //! 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(); }
int main(void) { Board_initGeneral(); Board_initGPIO(); Board_initWiFi(); setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(stderr, NULL, _IOLBF, 0); cs_log_set_level(LL_INFO); cs_log_set_file(stdout); if (!mg_start_task(MIOT_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) { LOG(LL_ERROR, ("Error starting Mongoose task")); return 1; } osi_start(); return 0; }
//***************************************************************************** // 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 //***************************************************************************** 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(); }
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; }
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; }
int main (void) { // Initialize the clocks and the interrupt system HAL_SystemInit(); #if MICROPY_HW_ANTENNA_DIVERSITY // configure the antenna selection pins antenna_init0(); #endif // Init the watchdog pybwdt_init0(); #ifndef DEBUG OsiTaskHandle mpTaskHandle; #endif mpTaskHandle = xTaskCreateStatic(TASK_Micropython, "MicroPy", MICROPY_TASK_STACK_LEN, NULL, MICROPY_TASK_PRIORITY, mpTaskStack, &mpTaskTCB); ASSERT(mpTaskHandle != NULL); osi_start(); for ( ; ; ); }
//**************************************************************************** // 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) { } }
//***************************************************************************** // MAIN FUNCTION //***************************************************************************** void main() { long lRetVal = -1; // // Board Initialization // BoardInit(); // // configure the GPIO pins for LEDs,UART // PinMuxConfig(); // // Configure the UART // #ifndef NOTERM InitTerm(); #endif //NOTERM // // Display Application Banner // DisplayBanner(APPLICATION_NAME); // // Configure all 3 LEDs // GPIO_IF_LedConfigure(LED1|LED2|LED3); // switch off all LEDs GPIO_IF_LedOff(MCU_ALL_LED_IND); // // Start the SimpleLink Host // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the WlanStationMode task // lRetVal = osi_TaskCreate( WlanStationMode, \ (const signed char*)"Wlan Station Task", \ OSI_STACK_SIZE, NULL, 1, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
//****************************************************************************** // MAIN FUNCTION //****************************************************************************** int main() { long lRetVal = -1; BoardInit(); // // Pinmux Configuration // PinMuxConfig(); // // Initialising the UART terminal // InitTerm(); // // Create RX and TX Buffer // pTxBuffer = CreateCircularBuffer(TX_BUFFER_SIZE); if(pTxBuffer == NULL) { UART_PRINT("Unable to Allocate Memory for Tx Buffer\n\r"); LOOP_FOREVER(); } pRxBuffer = CreateCircularBuffer(RX_BUFFER_SIZE); if(pRxBuffer == NULL) { UART_PRINT("Unable to Allocate Memory for Rx Buffer\n\r"); LOOP_FOREVER(); } // // Initialising the I2C Interface // lRetVal = I2C_IF_Open(1); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Configure Audio Codec // ConfigureAudioCodec(CODEC_I2S_WORD_LEN_24); GPIO_IF_LedConfigure(LED2|LED3); GPIO_IF_LedOff(MCU_RED_LED_GPIO); GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); // // Configure PIN_01 for GPIOOutput // MAP_PinTypeGPIO(PIN_01, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x4, GPIO_DIR_MODE_OUT); // // Configure PIN_02 for GPIOOutput // MAP_PinTypeGPIO(PIN_02, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x8, GPIO_DIR_MODE_OUT); //Turning off Green,Orange LED after i2c writes completed - First Time GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO); // // Initialize the Audio(I2S) Module // AudioCapturerInit(); // // Initialize the DMA Module // UDMAInit(); UDMAChannelSelect(UDMA_CH4_I2S_RX, NULL); UDMAChannelSelect(UDMA_CH5_I2S_TX, NULL); // // Setup the DMA Mode // SetupPingPongDMATransferTx(); SetupPingPongDMATransferRx(); // // Setup the Audio In/Out // lRetVal = AudioCapturerSetupDMAMode(DMAPingPongCompleteAppCB_opt, \ CB_EVENT_CONFIG_SZ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } AudioCaptureRendererConfigure(); // // Start Audio Tx/Rx // Audio_Start(); // // Start the simplelink thread // lRetVal = VStartSimpleLinkSpawnTask(9); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the Network Task // lRetVal = osi_TaskCreate( Network, (signed char*)"NetworkTask",\ OSI_STACK_SIZE, NULL, 1, &g_NetworkTask ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the Control Task // lRetVal = ControlTaskCreate(); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the Microphone Task // lRetVal = osi_TaskCreate( Microphone,(signed char*)"MicroPhone", \ OSI_STACK_SIZE, NULL, 1, &g_MicTask ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the Speaker Task // lRetVal = osi_TaskCreate( Speaker, (signed char*)"Speaker",OSI_STACK_SIZE, \ NULL, 1, &g_SpeakerTask ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start the task scheduler // osi_start(); }
//**************************************************************************** // MAIN FUNCTION //**************************************************************************** void main() { long lRetVal = -1; // // Board Initilization // BoardInit(); // // Configure the pinmux settings for the peripherals exercised // PinMuxConfig(); PinConfigSet(PIN_58,PIN_STRENGTH_2MA|PIN_STRENGTH_4MA,PIN_TYPE_STD_PD); // Initialize Global Variables InitializeAppVariables(); // // UART Init // InitTerm(); DisplayBanner(APP_NAME); // // LED Init // GPIO_IF_LedConfigure(LED1); //Turn Off the LEDs GPIO_IF_LedOff(MCU_RED_LED_GPIO); // // I2C Init // lRetVal = I2C_IF_Open(I2C_MASTER_MODE_FST); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } //Init Temprature Sensor lRetVal = TMP006DrvOpen(); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } //Init Accelerometer Sensor lRetVal = BMA222Open(); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Simplelinkspawntask // lRetVal = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Create OOB Task // lRetVal = osi_TaskCreate(OOBTask, (signed char*)"OOBTask", \ OSI_STACK_SIZE, NULL, \ OOB_TASK_PRIORITY, NULL ); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } // // Start OS Scheduler // osi_start(); while (1) { } }