summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/Kconfig.projbuild16
-rw-r--r--main/main.c22
2 files changed, 24 insertions, 14 deletions
diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild
index 4ff3093..85eb1ee 100644
--- a/main/Kconfig.projbuild
+++ b/main/Kconfig.projbuild
@@ -144,6 +144,12 @@ menu "Configuration of the Nixie Screen"
default 3
help
Pin number for N3_P3.
+
+ config BUTTON_PIN
+ int "Pin number for the button"
+ default 9
+ help
+ Pin number for the button.
config ESP_DPP_LISTEN_CHANNEL_LIST
string "DPP Listen channel list"
@@ -166,14 +172,4 @@ menu "Configuration of the Nixie Screen"
default "pool.ntp.org"
help
Hostname of the main SNTP server.
-
- choice SNTP_TIME_SYNC_METHOD
- prompt "Time synchronization method"
- default SNTP_TIME_SYNC_METHOD_IMMED
- help
- Time synchronization method.
-
- config SNTP_TIME_SYNC_METHOD_IMMED
- bool "update time immediately when received"
- endchoice
endmenu \ No newline at end of file
diff --git a/main/main.c b/main/main.c
index 81a51b1..16e1ca6 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1,11 +1,13 @@
-#include <unistd.h>
+#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "screen.h"
#include "dpp_wifi.h"
#include "time_sntp.h"
+#include "button_handler.h"
+struct Button* button;
struct Screen screen;
char t[4];
@@ -25,26 +27,38 @@ void setup_nvs()
ESP_ERROR_CHECK(ret);
}
+
void app_main(void)
{
+
printf("Starting up...\n");
+
configure_screen(&screen);
display(&screen, "aaaa");
printf("Screen Configured!\n");
+
setup_nvs();
display(&screen, "0aaa");
printf("NVS Flash Configured!\n");
- launch_dpp();
+
+ button = (struct Button*)malloc(sizeof(struct Button));
+ button->time = 0;
+ setup_button(button);
display(&screen, "00aa");
+ printf("User Inputs Configured!\n");
+
+ launch_dpp();
+ display(&screen, "000a");
printf("WiFi Configured!\n");
+
set_tz("CET-1CEST,M3.5.0/2,M10.5.0/2");
- display(&screen, "000a");
sync_time();
display(&screen, "0000");
printf("SNTP Configured!\n");
+
while(1){
refresh_screen();
- sleep(2);
+ vTaskDelay(2000 / portTICK_PERIOD_MS);
}
} \ No newline at end of file