Initial commit

This commit is contained in:
2017-07-13 06:18:04 +02:00
commit bf5e39efb6
8 changed files with 156 additions and 0 deletions

4
src/conf_schema.yaml Normal file
View File

@@ -0,0 +1,4 @@
[
["mqtt.server", "cubieboard4:1883"],
["i2c.enable", true],
]

35
src/main.c Normal file
View File

@@ -0,0 +1,35 @@
#include <stdio.h>
#include "common/platform.h"
#include "common/cs_file.h"
#include "fw/src/mgos_app.h"
#include "fw/src/mgos_gpio.h"
#include "fw/src/mgos_sys_config.h"
#include "fw/src/mgos_timers.h"
#include "fw/src/mgos_hal.h"
#include "fw/src/mgos_dlsym.h"
#include "mjs.h"
#if CS_PLATFORM == CS_P_ESP8266
#define LED_GPIO 2 /* On ESP-12E there is a blue LED connected to GPIO2 */
#elif CS_PLATFORM == CS_P_ESP32
#define LED_GPIO 21 /* No LED on DevKitC, use random GPIO close to GND pin */
#elif CS_PLATFORM == CS_P_CC3200
#define LED_GPIO 64 /* The red LED on LAUNCHXL */
#elif(CS_PLATFORM == CS_P_STM32) && defined(BSP_NUCLEO_F746ZG)
/* Nucleo-144 F746 */
#define LED_GPIO STM32_PIN_PB7 /* Blue LED */
#elif(CS_PLATFORM == CS_P_STM32) && defined(BSP_DISCO_F746G)
/* Discovery-0 F746 */
#define LED_GPIO STM32_PIN_PI1 /* Green LED */
#else
#error Unknown platform
#endif
int get_led_gpio_pin(void) {
return LED_GPIO;
}
enum mgos_app_init_result mgos_app_init(void) {
return MGOS_APP_INIT_SUCCESS;
}