Created
February 28, 2014 15:12
-
-
Save mikewl/9272772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Connect to Spark Cloud by default */ | |
bool FIRST_RUN_NO_HANDSHAKE = false; | |
//#define ENABLE_CLOUD | |
#ifdef ENABLE_CLOUD | |
SPARK_SOCKET_HANDSHAKE = 1; | |
#else | |
SPARK_SOCKET_HANDSHAKE = 0; | |
FIRST_RUN_NO_HANDSHAKE = true; | |
#endif | |
/* Main loop */ | |
while (1) | |
{ | |
#ifdef SPARK_WLAN_ENABLE | |
SPARK_WLAN_Loop(); | |
#endif | |
#ifdef SPARK_WIRING_ENABLE | |
#ifdef SPARK_WLAN_ENABLE | |
if(SPARK_WIRING_APPLICATION || SPARK_HANDSHAKE_COMPLETED || FIRST_RUN_NO_HANDSHAKE) | |
{ | |
if(!SPARK_FLASH_UPDATE && !IWDG_SYSTEM_RESET) | |
{ | |
#endif | |
if((SPARK_WIRING_APPLICATION != 1) && (NULL != setup)) | |
{ | |
//Execute user application setup only once | |
setup(); | |
SPARK_WIRING_APPLICATION = 1; | |
#ifndef CLOUD_ENABLE | |
FIRST_RUN_NO_HANDSHAKE = false; | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment