#include "mcc_generated_files/mcc.h"
#include "mcc_generated_files/weather_example.h"
#include "mcc_generated_files/EXAMPLE_BLE2.h"

/*
                         Main application
 */
void main(void)
{
    // initialize the device
    SYSTEM_Initialize();

    // When using interrupts, you need to set the Global and Peripheral Interrupt Enable bits
    // Use the following macros to:

    // Enable the Global Interrupts
    INTERRUPT_GlobalInterruptEnable();

    // Enable the Peripheral Interrupts
    INTERRUPT_PeripheralInterruptEnable();

    // Disable the Global Interrupts
    //INTERRUPT_GlobalInterruptDisable();

    // Disable the Peripheral Interrupts
    //INTERRUPT_PeripheralInterruptDisable();

    EXAMPLE_setupBLE2("Weather");   //Setting up BLE2 Click and advertising device name

    while (1)
    {
        // Add your application code

        //If switch S1 is pressed then the subsequent data should be streamed
        if(S1_GetValue() == 0){
          Weather_example();
        }
    }
}