From 58be1e6166f1fa98b6adcc5713aee6cbbcd7a3de Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 24 May 2024 13:33:57 +0300 Subject: (iot/goam) Minor naming and formatting changes --- Year 3/Internet of things/goam/main/main.c | 15 ++++++++------- Year 3/Internet of things/goam/main/ptc06.c | 4 ++-- Year 3/Internet of things/goam/main/webserver.c | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Year 3/Internet of things/goam/main/main.c b/Year 3/Internet of things/goam/main/main.c index b7ddc92..f83dbf3 100644 --- a/Year 3/Internet of things/goam/main/main.c +++ b/Year 3/Internet of things/goam/main/main.c @@ -68,13 +68,14 @@ void debug_serial_print_image(const char* image, size_t length) { } void take_photo() { - display_printon("0", 1); + display_printon("-", 1); + ptc06_set_image_resolution(RES_640X480); char* image; size_t length = ptc06_get_image(&image); spiffs_write(SPIFFS_PREFIX "/capture.jpeg", image, length); - display_printon("1", 1); - /* debug_serial_print_image(); */ + + display_printon("+", 1); free(image); } @@ -93,6 +94,7 @@ static void init_camera(void*) { ESP_LOGE(TAG, "Couldnt't notify main of camera init, software will hang"); } + display_printon("+", 1); vTaskDelete(NULL); } @@ -103,7 +105,7 @@ void app_main(void) nvs_init(); // A whole lotta stuff depend on this // Minor performance improvement, since we always have to wait 2.5 seconds - xTaskCreate(init_camera, "init_camera", 2048, NULL, 10, NULL); + xTaskCreate(init_camera, "init_camera", 1024, NULL, 10, NULL); // These inits are really fast, it doesnt make a difference if // they're in a task or not @@ -112,19 +114,18 @@ void app_main(void) add_push_button(BTN_SHOOT_PIN, take_photo, NULL); display_init(); + display_printon("-", 1); // This is really slow wifi_init(); webserver_init(); - wifi_start(); // Automatically starts server too + wifi_launch(); // Automatically starts server too long unsigned int notification = 0; while (!(notification & INIT_CAMERA_BIT)) { xTaskNotifyWait(0, 0, ¬ification, 50 / portTICK_PERIOD_MS); } - display_println("A0"); - for (int i = 0; true; i++) { /* ptc06_reset(); */ /* printf("%d seconds, %d\n", i, gpio_get_level(GPIO_INPUT_CAMERA)); */ diff --git a/Year 3/Internet of things/goam/main/ptc06.c b/Year 3/Internet of things/goam/main/ptc06.c index 273b0ba..816fc12 100644 --- a/Year 3/Internet of things/goam/main/ptc06.c +++ b/Year 3/Internet of things/goam/main/ptc06.c @@ -58,7 +58,7 @@ static QueueHandle_t uart_queue; static size_t serial_num = 0x00; -static void init_uart() { +static void init_uart_interface() { // HS_UART uart_config_t uart_config = { .baud_rate = 115200, @@ -287,8 +287,8 @@ static void init_camera() { */ void ptc06_init() { - init_uart(); init_camera(); + init_uart_interface(); vc0706_system_reset(); /* ptc06_set_resolution(); */ diff --git a/Year 3/Internet of things/goam/main/webserver.c b/Year 3/Internet of things/goam/main/webserver.c index 8d5e18b..14ada7c 100644 --- a/Year 3/Internet of things/goam/main/webserver.c +++ b/Year 3/Internet of things/goam/main/webserver.c @@ -164,7 +164,7 @@ void webserver_init() { void webserver_start() { if (server != NULL) { - ESP_LOGE(TAG, "Tried starting the server while it was already started"); + ESP_LOGW(TAG, "Tried starting the server while it was already started"); return; } -- cgit v1.3.1-23-gd82d