68 lines
1.6 KiB
C
68 lines
1.6 KiB
C
// #include "apds_9960.c"
|
|
#include "app_nvs.c"
|
|
#include "ch1116.c"
|
|
#include "ci_03t.c"
|
|
#include "esp_log.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
#include "gui.c"
|
|
#include "i2c.c"
|
|
#include "light.c"
|
|
// #include "mqtt.c"
|
|
// #include "pca9555.c"
|
|
#include "sdkconfig.h"
|
|
#include "service_discovery.c"
|
|
// #include "temperature.c"
|
|
#include "desktop.c"
|
|
#include "ui_input.c"
|
|
#include "wifi.c"
|
|
|
|
static const char *APP_TAG = "DisplayAmbientLight";
|
|
|
|
void app_main(void) {
|
|
app_nvs_init();
|
|
light_init_strip();
|
|
|
|
gpio_install_isr_service(0);
|
|
init_i2c();
|
|
i2c_check_slaves();
|
|
|
|
ch1116_main();
|
|
gui_main();
|
|
|
|
gui_set_wifi_connecting();
|
|
gui_set_server_connecting();
|
|
|
|
// display_print8_str(0, 0, "Ambient Light");
|
|
|
|
// ci_03t_init();
|
|
// apds_9960_init();
|
|
// apds_9960_auto_fetch();
|
|
// auto_fetch_temperature();
|
|
pca9555_init();
|
|
ui_input_init();
|
|
// xTaskCreate(mqtt_publish_ui_input, "mqtt_publish_ui_input", 2048, NULL, 10,
|
|
// NULL);
|
|
// vTaskDelay(pdMS_TO_TICKS(10));
|
|
light_play(light_mode_connection_wifi);
|
|
if (connect_wifi()) {
|
|
gui_set_wifi_connected();
|
|
light_play(light_mode_idle);
|
|
} else {
|
|
gui_set_wifi_disconnected();
|
|
}
|
|
udp_server_init();
|
|
service_discovery_init();
|
|
// vTaskDelay(pdMS_TO_TICKS(1000));
|
|
// mqtt_app_start();
|
|
// if (waiting_for_mqtt_connected()) {
|
|
// light_play(light_mode_mqtt_connected);
|
|
// }
|
|
// if (waiting_for_desktop_online()) {
|
|
// light_play(light_mode_desktop_online);
|
|
// }
|
|
// while (waiting_and_get_colors()) {
|
|
// light_play_colors(NUMBER_OF_LEDS * 3, mqtt_colors_buffer);
|
|
// }
|
|
}
|