添加硬件端固件示例代码

This commit is contained in:
kerwincui
2021-07-04 17:59:55 +08:00
parent e747bd935e
commit 224282d561
23 changed files with 5549 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
#include <stdio.h>
#include "nvs_flash.h"
#include "esp_event.h"
#include "example.h"
#include "mqtt.h"
#include "wifi.h"
/******************************************************************************
* FunctionName : app_main
* Description : entry of user application, init user function here
* Author : kerwincui
* SourceCode : https://gitee.com/kerwincui/wumei-smart
*******************************************************************************/
void app_main()
{
printf("Docking wumei-smart system demo \n");
// 初始化NVS
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 );
// 创建默认时间循环
ESP_ERROR_CHECK(esp_event_loop_create_default());
//连接wifi
wifi_start();
// 启动mqtt
mqtt_start();
}