You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
C
59 lines
1.4 KiB
C
/* Hello World Example
|
|
|
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
|
|
|
Unless required by applicable law or agreed to in writing, this
|
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
CONDITIONS OF ANY KIND, either express or implied.
|
|
*/
|
|
#include <stdio.h>
|
|
#include "sdkconfig.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
#include "esp_system.h"
|
|
#include "nvs_flash.h"
|
|
#include "esp_timer.h"
|
|
|
|
#include "display.h"
|
|
#include "text.h"
|
|
#include "wlan.h"
|
|
|
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
|
#define CHIP_NAME "ESP32"
|
|
#endif
|
|
|
|
#ifdef CONFIG_IDF_TARGET_ESP32S2BETA
|
|
#define CHIP_NAME "ESP32-S2 Beta"
|
|
#endif
|
|
|
|
const esp_timer_create_args_t periodic_timer_args = {
|
|
.callback = &display_cycle,
|
|
};
|
|
|
|
void app_main(void)
|
|
{
|
|
printf("Hello world!\n");
|
|
display_init();
|
|
|
|
esp_timer_handle_t periodic_timer;
|
|
ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args, &periodic_timer));
|
|
ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer, 500));
|
|
|
|
put_line(fb, 1, "MauMau", 1, 1);
|
|
|
|
//Initialize WiFi
|
|
esp_err_t ret = nvs_flash_init();
|
|
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
|
ESP_ERROR_CHECK(nvs_flash_erase());
|
|
ret = nvs_flash_init();
|
|
}
|
|
ESP_ERROR_CHECK(ret);
|
|
wifi_init_sta();
|
|
|
|
put_line(fb, 2, "wifi", 1, 1);
|
|
|
|
for (;;) {
|
|
vTaskDelay(1);
|
|
}
|
|
}
|