-
-
Save anonymous/c6c76cd25e780950b0240766ee9a0de0 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
#include <stdio.h> | |
#include "common/platform.h" | |
#include "fw/src/sj_app.h" | |
#include "fw/src/sj_gpio.h" | |
#include "fw/src/sj_sys_config.h" | |
#include "app_task.h" | |
#if CS_PLATFORM == CS_P_ESP_LWIP | |
#define GPIO 12 | |
#elif CS_PLATFORM == CS_P_CC3200 | |
#define GPIO 64 /* The red LED on LAUNCHXL */ | |
#else | |
#error Unknown platform | |
#endif | |
OsiMsgQ_t *app_queue; | |
enum mg_app_init_result sj_app_init(void) { | |
{ /* Print a message using a value from config. */ | |
printf("Hello, %s!\n", get_cfg()->hello.who); | |
} | |
{ /* Turn on LED. */ | |
sj_gpio_set_mode(GPIO, GPIO_MODE_OUTPUT, GPIO_PULL_FLOAT); | |
sj_gpio_write(GPIO, GPIO_LEVEL_LOW); | |
} | |
app_queue = apptask_start(); | |
if (app_queue == NULL) { | |
LOG(LL_ERROR, ("unable to spawn app_task")); | |
while (1); | |
} | |
apptask_msg(); | |
return MG_APP_INIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment