2020-07-14 20:54:14 +02:00
|
|
|
// Copyright 2020 Lukas Haubaum
|
|
|
|
//
|
|
|
|
// Licensed under the GNU Affero General Public License, Version 3;
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
2020-07-11 12:11:34 +02:00
|
|
|
|
2020-07-14 20:54:14 +02:00
|
|
|
// https://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2020-07-11 12:11:34 +02:00
|
|
|
#include <stdio.h>
|
2020-07-14 20:54:14 +02:00
|
|
|
#include <string.h>
|
2020-07-11 12:11:34 +02:00
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
#include "freertos/task.h"
|
|
|
|
#include <time.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include "esp_system.h"
|
|
|
|
#include "esp_log.h"
|
|
|
|
|
|
|
|
#include "ena.h"
|
2020-07-14 20:54:14 +02:00
|
|
|
#include "ena-detection.h"
|
2020-07-11 12:11:34 +02:00
|
|
|
#include "ena-storage.h"
|
2020-07-12 14:14:06 +02:00
|
|
|
#include "ena-interface.h"
|
2020-07-13 20:32:53 +02:00
|
|
|
#include "ena-interface-menu.h"
|
2020-07-11 12:11:34 +02:00
|
|
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
|
|
|
void app_main(void)
|
|
|
|
{
|
|
|
|
// DEBUG set time
|
|
|
|
struct timeval tv = {1594459800, 0}; // current hardcoded timestamp (2020-07-11 09:30:00) ¯\_(ツ)_/¯
|
|
|
|
settimeofday(&tv, NULL);
|
|
|
|
|
|
|
|
esp_log_level_set(ENA_STORAGE_LOG, ESP_LOG_INFO);
|
2020-07-14 20:54:14 +02:00
|
|
|
// ena_storage_erase(); // only needed on first start! TODO automatically check (how?)
|
2020-07-11 12:11:34 +02:00
|
|
|
|
2020-07-12 14:14:06 +02:00
|
|
|
ena_interface_start();
|
2020-07-13 20:32:53 +02:00
|
|
|
ena_interface_menu_start();
|
2020-07-12 14:14:06 +02:00
|
|
|
ena_start();
|
2020-07-11 12:11:34 +02:00
|
|
|
}
|