示例#1
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();
}
示例#2
0
//****************************************************************************
//
//! \brief  This function restore the backed up data (after S3)
//!
//! \param  none
//!
//! \return none
//
//****************************************************************************
void lp3p0_restore_soc_data(void)
{       
        /* Invoking the default CC3xxx service impl. */
        cc_restore_soc_data();
		
		PRCMCC3200MCUInit();

        /* disabling all wk up srcs */
        PRCMLPDSWakeupSourceDisable(PRCM_LPDS_HOST_IRQ|PRCM_LPDS_GPIO|PRCM_LPDS_TIMER);

        //
        // Configure the pinmux settings for the peripherals exercised
        //
        PinMuxConfig();   
        
        //
        // enable peripherals
        //
        enable_peripherals();

        /* ungates the clk for the shared SPI*/
        MAP_PRCMPeripheralClkEnable(PRCM_SSPI, PRCM_RUN_MODE_CLK|
                                    PRCM_SLP_MODE_CLK);
        
        MAP_PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR);
}
示例#3
0
static void Init()
{
    long lRetVal = -1;
    BoardInit();
    UDMAInit();
    PinMuxConfig();
    InitTerm();

    InitializeAppVariables();

    //
    // Following function configure the device to default state by cleaning
    // the persistent settings stored in NVMEM (viz. connection profiles &
    // policies, power policy etc)
    //
    // Applications may choose to skip this step if the developer is sure
    // that the device is in its default state at start of applicaton
    //
    // Note that all profiles and persistent settings that were done on the
    // device will be lost
    //
    lRetVal = ConfigureSimpleLinkToDefaultState();

    if (lRetVal < 0) {
        if (DEVICE_NOT_IN_STATION_MODE == lRetVal)
            UART_PRINT(
                    "Failed to configure the device in its default state \n\r");

        LOOP_FOREVER()
        ;
    }

    //
    // Asumption is that the device is configured in station mode already
    // and it is in its default state
    //
    lRetVal = sl_Start(0, 0, 0);
    if (lRetVal < 0) {
        UART_PRINT("Failed to start the device \n\r");
        LOOP_FOREVER()
        ;
    }

    UART_PRINT("Connecting to AP: '%s'...\r\n", SSID_NAME);

    // Connecting to WLAN AP - Set with static parameters defined at common.h
    // After this call we will be connected and have IP address
    lRetVal = WlanConnect();
    if (lRetVal < 0) {
        UART_PRINT("Connection to AP failed \n\r");
        LOOP_FOREVER()
        ;
    }

    UART_PRINT("Connected to AP: '%s' \n\r", SSID_NAME);

#ifdef NEW_ID
    iobeam_Reset();
#endif
}
示例#4
0
//****************************************************************************
//
//! \brief  This function restore the backed up data (after S3)
//!
//! \param  none
//!
//! \return none
//
//****************************************************************************
void lp3p0_restore_soc_data(void)
{       
        /* Invoking the default CC3xxx service impl. */
        cc_restore_soc_data();
        //
        // Configure the pinmux settings for the peripherals exercised
        //
        PinMuxConfig();   
        
        cc_gpio_restore_context();
#ifdef DEBUG_GPIO
        cc_gpio_write(tGPIODbgHndl, GPIO_09, 1);
#endif
        /* Initialize timer services */
        MAP_PRCMPeripheralClkEnable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK|
                                                    PRCM_SLP_MODE_CLK);
        /* ungates the clk for the shared SPI*/
        MAP_PRCMPeripheralClkEnable(PRCM_SSPI, PRCM_RUN_MODE_CLK|
                                    PRCM_SLP_MODE_CLK);
        /* Initialize the DMA module */
        MAP_PRCMPeripheralClkEnable(PRCM_UDMA, PRCM_RUN_MODE_CLK|
                                    PRCM_SLP_MODE_CLK);
        MAP_uDMAControlBaseSet(dma_ctrl_table);
        MAP_uDMAEnable();
        
        MAP_PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR);
}
示例#5
0
文件: main.c 项目: nqd/cc3200
//****************************************************************************
//
//! 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();
}
示例#6
0
文件: main.c 项目: yuch7/cc3200-MCU
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;
}
示例#7
0
//*****************************************************************************
//
//! Main 
//!
//! \param  none
//!
//! \return None
//!
//*****************************************************************************
void main()
{
    long lRetVal = -1;
    //
    // Initialize board configuration
    //
    BoardInit();

    PinMuxConfig();

    #ifndef NOTERM
        InitTerm();
    #endif

    lRetVal = ssl();
    if(lRetVal < 0)
    {
        ERR_PRINT(lRetVal);
    }

    //
    // power off network processor
    //
    sl_Stop(SL_STOP_TIMEOUT);
    LOOP_FOREVER();
}
示例#8
0
文件: main.cpp 项目: hangc2/wif
//****************************************************************************
//							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;
}
void initBoard() {
#ifndef USE_TIRTOS
#if defined(ccs) || defined(gcc)
    MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
#endif
#if defined(ewarm)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif
#endif

    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();

    PinMuxConfig();
    GPIO_IF_LedConfigure(LED1);
    GPIO_IF_LedOff(MCU_RED_LED_GPIO);

    InitTerm();
    ClearTerm();

    UART_PRINT("Blink - Parse for IoT sample application\r\n");
    UART_PRINT("----------------------------------------\r\n");
    UART_PRINT("\r\n");
    UART_PRINT("[Blink] Board init\r\n");

    // start the spawn task
    short status = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY);
    if (status < 0) {
        UART_PRINT("[Blink] Spawn task failed\r\n");
        ERR_PRINT(status);
        LOOP_FOREVER();
    }

    // initialize the I2C bus
    status = I2C_IF_Open(I2C_MASTER_MODE_FST);
    if (status < 0) {
        UART_PRINT("[Blink] I2C opening error\r\n");
        ERR_PRINT(status);
        LOOP_FOREVER();
    }

    UART_PRINT("[Blink] Device                    : TI SimpleLink CC3200\r\n");
#ifdef USE_TIRTOS
    UART_PRINT("[Blink] Operating system          : TI-RTOS\r\n");
#endif
#ifdef USE_FREERTOS
    UART_PRINT("[Blink] Operating system          : FreeRTOS\r\n");
#endif
#ifndef SL_PLATFORM_MULTI_THREADED
    UART_PRINT("[Blink] Operating system          : None\r\n");
#endif
}
示例#10
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;
}
示例#11
0
文件: main.c 项目: gale320/cc3200
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)
    {

    }

}
示例#12
0
//****************************************************************************
//
//! 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();
}
示例#13
0
//*****************************************************************************
//
//! 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();
}
示例#14
0
//*****************************************************************************
//
//!    main function demonstrates the use of the timers to generate
//! periodic interrupts.
//!
//! \param  None
//!
//! \return none
//
//*****************************************************************************
int
main(void)
{
    //
    // Initialize board configurations
    BoardInit();
    //
    // Pinmuxing for LEDs
    //
    PinMuxConfig();
    //
    // configure the LED RED and GREEN
    //
    GPIO_IF_LedConfigure(LED1|LED3);

    GPIO_IF_LedOff(MCU_RED_LED_GPIO);
    GPIO_IF_LedOff(MCU_GREEN_LED_GPIO); 

    //
    // Base address for first timer
    //
    g_ulBase = TIMERA0_BASE;
    //
    // Base address for second timer
    //
    g_ulRefBase = TIMERA1_BASE;
    //
    // Configuring the timers
    //
    Timer_IF_Init(PRCM_TIMERA0, g_ulBase, TIMER_CFG_PERIODIC, TIMER_A, 0);
    Timer_IF_Init(PRCM_TIMERA1, g_ulRefBase, TIMER_CFG_PERIODIC, TIMER_A, 0);

    //
    // Setup the interrupts for the timer timeouts.
    //
    Timer_IF_IntSetup(g_ulBase, TIMER_A, TimerBaseIntHandler);
    Timer_IF_IntSetup(g_ulRefBase, TIMER_A, TimerRefIntHandler);

    //
    // Turn on the timers feeding values in mSec
    //
    Timer_IF_Start(g_ulBase, TIMER_A, 500);
    Timer_IF_Start(g_ulRefBase, TIMER_A, 1000);
	
    //
    // Loop forever while the timers run.
    //
    while(FOREVER)
    {
    }
}
示例#15
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();

}
示例#16
0
//****************************************************************************
//
//! Main function
//!
//! \param none
//! 
//! This function  
//!    1. Configures the GPIOA1 and A2 interrupt.
//!
//! \return None.
//
//****************************************************************************
int main() {
	//
	// Initialize Board configurations
	//
	BoardInit();

	//
	// Power on the corresponding GPIO port B for 9,10,11.
	// Set up the GPIO lines to mode 0 (GPIO)
	//
	PinMuxConfig();

	//
	// Configure the GPIO13 - SW2 interrupt
	//
	MAP_GPIOIntRegister(GPIOA1_BASE, GPIOA1IntHandler);
	MAP_GPIOIntTypeSet(GPIOA1_BASE, GPIO_PIN_5, GPIO_RISING_EDGE);

	//
	// Configure the GPIO22 interrupt
	//
	MAP_GPIOIntRegister(GPIOA2_BASE, GPIOA2IntHandler);
	MAP_GPIOIntTypeSet(GPIOA2_BASE, GPIO_PIN_6, GPIO_RISING_EDGE);

	//
	// Enable GPIO13 Interrupt
	//
	MAP_GPIOIntClear(GPIOA1_BASE, GPIO_PIN_5);
	MAP_IntPendClear(INT_GPIOA1);
	MAP_IntEnable(INT_GPIOA1);
	MAP_GPIOIntEnable(GPIOA1_BASE, GPIO_PIN_5);

	//
	// Enable GPIO22 Interrupt
	//
	MAP_GPIOIntClear(GPIOA2_BASE, GPIO_PIN_6);
	MAP_IntPendClear(INT_GPIOA2);
	MAP_IntEnable(INT_GPIOA2);
	MAP_GPIOIntEnable(GPIOA2_BASE, GPIO_PIN_6);

	//
	// Infinite loop. All processing happens now in the interrupt handler.
	while (1) {

	}

	return 0;
}
示例#17
0
//****************************************************************************
//
//! Main function invoking the sleep and deepsleep functionality
//!
//! \param none
//! 
//! This function  
//!    1. Invokes the API that implements Sleep followed by wakeup using WDT
//!    2. Invokes the API that implements DeepSleep followed by wakeup 
//!       using WDT
//!    3. Invokes the API that implements Sleep followed by wakeup using GPT
//!    4. Invokes the API that implements DeepSleep followed by wakeup 
//!       using GPT
//!
//! \return None.
//
//****************************************************************************
void main()
{
    //
    // Initialize the MCU
    //
    BoardInit();
    
    //
    // Configure the pinmux settings for the peripherals exercised
    //
    PinMuxConfig();
    
    //
    // Initialze the UART
    //
    InitTerm();

    DisplayBanner(APP_NAME);
    
    DBG_PRINT("SLEEP_DEEPSLEEP: Test Begin\n\r");
    
    //
    // Sleep followed by wakeup using WDT
    //
    PerformPRCMSleepWDTWakeup();
    
    //
    // DeepSleep followed by wakeup using WDT
    //
    PerformPRCMDeepSleepWDTWakeup();
    
    //
    // Sleep followed by wakeup using GPT
    //
    PerformPRCMSleepGPTWakeup();
    
    //
    // DeepSleep followed by wakeup using GPT
    //
    PerformPRCMDeepSleepGPTWakeup();
    
    DBG_PRINT("SLEEP_DEEPSLEEP: Test Complete\n\r");

    //
    // Done. Loop here
    //
    while(1);
}
示例#18
0
//*****************************************************************************
//                            MAIN FUNCTION
//*****************************************************************************
void main() {
	//
	// 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);

	FileTest();

	/*//
	 // Start the SimpleLink Host
	 //
	 VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY);

	 //
	 // Start the WlanStationMode task
	 //
	 osi_TaskCreate( WlanStationMode, (const signed char*)"Wlan Station Task",
	 OSI_STACK_SIZE, NULL, 1, NULL );
	 //
	 // Start the task scheduler
	 //
	 osi_start();*/
}
示例#19
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();

}
示例#20
0
//*****************************************************************************
//
//!	main function demonstrates the use of the watchdog timer to perform system
//! reset.
//!
//! \param  None
//!
//! \return None
//
//*****************************************************************************
void main(void)
{
    tBoolean bRetcode;
    //
    // Initialize the board
    //
    BoardInit();
    //
    // Pinmuxing for LEDs
    //
    PinMuxConfig();
    //
    // configure RED LED
    //
    GPIO_IF_LedConfigure(LED1);

	GPIO_IF_LedOff(MCU_RED_LED_GPIO);

    //
    // Enable the peripherals used by this example.
    //
    MAP_PRCMPeripheralClkEnable(PRCM_WDT, PRCM_RUN_MODE_CLK);

    //
    // Set up the watchdog interrupt handler.
    //
    WDT_IF_Init(WatchdogIntHandler, MILLISECONDS_TO_TICKS(WD_PERIOD_MS));
    
    //
    // Start the timer. Once the timer is started, it cannot be disable.
    //
    MAP_WatchdogEnable(WDT_BASE);
    bRetcode = MAP_WatchdogRunning(WDT_BASE);
    if(!bRetcode)
    {
       WDT_IF_DeInit();
    }

    //
    // Loop forever while the LED winks as watchdog interrupts are handled.
    //
    while(FOREVER)
    {

    }
}
示例#21
0
//*****************************************************************************
//
//! Main 
//!
//! \param  none
//!
//! \return None
//!
//*****************************************************************************
void main()
{
    long lRetVal = -1;
    //
    // Initialize board configuration
    //
    BoardInit();

    PinMuxConfig();
    //Initialize GPIO interrupt
    GPIOIntInit();
    //Initialize Systick interrupt
    SystickIntInit();
    //Initialize Uart interrupt
    UART1IntInit();
    //Initialize SPI
    SPIInit();
    //Initalize Adafruit
    Adafruit_Init();

    InitTerm();
    //Connect the CC3200 to the local access point
    lRetVal = connectToAccessPoint();
    //Set time so that encryption can be used
    lRetVal = set_time();
    if(lRetVal < 0)
    {
        UART_PRINT("Unable to set time in the device");
        LOOP_FOREVER();
    }
    //Connect to the website with TLS encryption
    lRetVal = tls_connect();
    if(lRetVal < 0)
    {
        ERR_PRINT(lRetVal);
    }

    //remote calls sendMessage() which calls http_post() which requires the return value from tls_connect()
    remote(lRetVal);

    //http_post(lRetVal);

    sl_Stop(SL_STOP_TIMEOUT);
    LOOP_FOREVER();
}
示例#22
0
//****************************************************************************
//							MAIN FUNCTION
//****************************************************************************
void main()
{
    char cMode = 0;

    //
    // Board Initialization
    //
    BoardInit();

    //
    // Configure the pinmux settings for the peripherals exercised
    //
    PinMuxConfig();

    //
    // Configuring UART
    //
#ifndef NOTERM
    InitTerm();
#endif  //NOTERM
    //
    // Display banner
    //
    DisplayBanner(APP_NAME);

    //
    // staring simplelink
    //
    cMode = sl_Start(NULL,NULL,NULL);

    //
    // Display current mode and ssid name(for AP mode)
    //
    DisplayCurrentConfig(cMode);

    //
    // Configure the networking mode and ssid name(for AP mode)
    //
    ConfigureMode(cMode);

    UART_PRINT("Please restart the device \n\r");
    sl_Stop(SL_STOP_TIMEOUT);
    LOOP_FOREVER(line_number);

}
示例#23
0
文件: main.c 项目: dlugaz/All
//****************************************************************************
//
//! 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();
}
示例#24
0
void main(void)
{
   BoardInit();
   PinMuxConfig();

   UartA0Init();


   // create task
   SystemTaskCreate();


   // start the task scheduler
   osi_start();

   while(1)
   {
   }
}
示例#25
0
//****************************************************************************
//
//! 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();
}
示例#26
0
文件: main.c 项目: dlugaz/All
int main()
{
    long lRetVal = -1;

    //
    // Board Initialization
    //
    BoardInit();

    //
    // Configure the pinmux settings for the peripherals exercised
    //
    PinMuxConfig();

    //
    // Configuring UART
    //
    InitTerm();

    //
    // Display banner
    //
    DisplayBanner(APP_NAME);

    InitializeAppVariables();

    lRetVal = ServerFileDownload();

    if(lRetVal < 0)
    {
        UART_PRINT("Server file download failed\n\r");
        LOOP_FOREVER();
    }
    else
    {
        UART_PRINT("Downloading File Completed\n\r");
    }
    UART_PRINT("\nThank you\r\n");
    // Stop the CC3200 device
    lRetVal = sl_Stop(SL_STOP_TIMEOUT);
    
    LOOP_FOREVER();
}
示例#27
0
//*****************************************************************************
//                            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();
}
示例#28
0
文件: main.c 项目: dlugaz/All
//****************************************************************************
//
//! Demonstrates the controlling of LED brightness using PWM
//!
//! \param none
//! 
//! This function  
//!    1. Pinmux the GPIOs that drive LEDs to PWM mode.
//!    2. Initializes the timer as PWM.
//!    3. Loops to continuously change the PWM value and hence brightness 
//!       of LEDs.
//!
//! \return None.
//
//****************************************************************************
void main()
{
    int iLoopCnt;

    //
    // Board Initialisation
    //
    BoardInit();
    
    //
    // Configure the pinmux settings for the peripherals exercised
    //
    PinMuxConfig();    
    
    //
    // Initialize the PWMs used for driving the LEDs
    //
    InitPWMModules();

    while(1)
    {
        //
        // RYB - Update the duty cycle of the corresponding timers.
        // This changes the brightness of the LEDs appropriately.
        // The timers used are as per LP schematics.
        //
        for(iLoopCnt = 0; iLoopCnt < 255; iLoopCnt++)
        {
            UpdateDutyCycle(TIMERA2_BASE, TIMER_B, iLoopCnt);
            UpdateDutyCycle(TIMERA3_BASE, TIMER_B, iLoopCnt);
            UpdateDutyCycle(TIMERA3_BASE, TIMER_A, iLoopCnt);
            MAP_UtilsDelay(800000);
        }
      
    }

    //
    // De-Init peripherals - will not reach here...
    //
    //DeInitPWMModules();
}
示例#29
0
文件: main.c 项目: nqngo22/CC3200_LED
//****************************************************************************
//
//! Main function
//!
//! \param none
//! 
//! This function  
//!    1. Invokes the LEDBlinkyTask
//!
//! \return None.
//
//****************************************************************************
int
main()
{
    //
    // Initialize Board configurations
    //
    BoardInit();
    
    //
    // Power on the corresponding GPIO port B for 9,10,11.
    // Set up the GPIO lines to mode 0 (GPIO)
    //
    PinMuxConfig();

	#ifndef NOTERM
		//
		// Configuring UART
		//
		InitTerm();
	#endif

	DisplayBanner("Lab 0");
    Message("\t\t****************************************************\n\r");
    Message("\t\t\t        CC3200 UART Echo Usage        \n\r");
    Message("\t\t To get to state 3, the user must press and hold SW2  \n\r");
    Message("\t\t then press SW3 without releasing SW2   \n\r");
    Message("\t\t and then release SW2 while continuing to press SW3\n\r");
    Message("\n\n\n\r");

    GPIO_IF_LedConfigure(LED1|LED2|LED3);

    GPIO_IF_LedOff(MCU_ALL_LED_IND);
    
    //
    // Start the LEDBlinkyRoutine
    //
    LEDBlinkyRoutine();
    return 0;
}
示例#30
0
文件: main.c 项目: ClarePhang/CC3200
//****************************************************************************
//
//! Main function
//!
//! \param none
//!
//! This function
//!    1. Invokes the LEDBlinkyTask
//!
//! \return None.
//
//****************************************************************************
int
main()
{
    //
    // Initialize Board configurations
    //
    BoardInit();

    //
    // Power on the corresponding GPIO port B for 9,10,11.
    // Set up the GPIO lines to mode 0 (GPIO)
    //
    PinMuxConfig();
    GPIO_IF_LedConfigure(LED1|LED2|LED3);

    GPIO_IF_LedOff(MCU_ALL_LED_IND);

    //
    // Start the LEDBlinkyRoutine
    //
    LEDBlinkyRoutine();
    return 0;
}