From cfa644ccd3bcb305c8153dce59a4deefb8f10134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20B=C3=A9rub=C3=A9?= Date: Tue, 18 Jun 2024 14:04:46 -0400 Subject: [PATCH] Verbosity of different modules --- src/hal/config.c | 8 ++------ src/jpeg.c | 1 + src/server.c | 2 +- src/watchdog.c | 2 ++ 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/hal/config.c b/src/hal/config.c index eb58d12..416bb55 100644 --- a/src/hal/config.c +++ b/src/hal/config.c @@ -79,10 +79,8 @@ enum ConfigError parse_param_value( regmatch_t m[n_matches]; int match = regexec(®ex, ini->str + start_pos, n_matches, m, 0); regfree(®ex); - if (match > 0 || (end_pos >= 0 && end_pos - start_pos < m[1].rm_so)) { - printf("Can't find '%s' in section '%s'.\n", param_name, section); + if (match > 0 || (end_pos >= 0 && end_pos - start_pos < m[1].rm_so)) return CONFIG_PARAM_NOT_FOUND; - } int res = sprintf(param_value, "%.*s", (int)(m[1].rm_eo - m[1].rm_so), ini->str + start_pos + m[1].rm_so); @@ -280,10 +278,8 @@ enum ConfigError parse_uint32( bool open_config(struct IniConfig *ini, const char *path) { FILE *file = fopen(path, "rb"); - if (!file) { - printf("Can't open file %s\n", path); + if (!file) return false; - } fseek(file, 0, SEEK_END); size_t length = ftell(file); diff --git a/src/jpeg.c b/src/jpeg.c index 5b2e49d..81c8f5e 100644 --- a/src/jpeg.c +++ b/src/jpeg.c @@ -95,6 +95,7 @@ void jpeg_deinit() { active: jpeg_module_init = false; pthread_mutex_unlock(&jpeg_mutex); + printf(tag "Module de-initialization completed!\n"); } int jpeg_get(short width, short height, char quality, char grayscale, diff --git a/src/server.c b/src/server.c index 9477c56..c8d7d06 100644 --- a/src/server.c +++ b/src/server.c @@ -723,7 +723,7 @@ void *server_thread(void *vargp) { "Content-Type: application/json;charset=UTF-8\r\n" \ "Connection: close\r\n" \ "\r\n" \ - "{\"width\":%d,\"height\":%d,\"fps\":%d,\"qfactor\":%d}", + "{\"width\":%d,\"height\":%d,\"qfactor\":%d}", app_config.jpeg_width, app_config.jpeg_height, app_config.jpeg_qfactor); } else { respLen = sprintf(response, diff --git a/src/watchdog.c b/src/watchdog.c index 11f1897..c8b67d9 100644 --- a/src/watchdog.c +++ b/src/watchdog.c @@ -30,4 +30,6 @@ void watchdog_stop(void) { write(fd, "V", 1); close(fd); fd = 0; + + fprintf(stderr, "[watchdog] Watchdog stopped!\n"); } \ No newline at end of file