diff --git a/README.md b/README.md index f79c4b7..62c50f3 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can ask questions (and get answers!) about this software on the KTag forum a This software is part of the KTag project, a DIY laser tag game with customizable features and wide interoperability. -🛡️ 🃞 +🛡 🃞 Copyright © 2023-2026 Joseph P. Kearney and the KTag developers. diff --git a/components/Audio/I2S_Audio.c b/components/Audio/I2S_Audio.c index 007528c..2c92853 100644 --- a/components/Audio/I2S_Audio.c +++ b/components/Audio/I2S_Audio.c @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free @@ -91,7 +91,7 @@ static esp_err_t I2S_Audio_Write(void *audio_buffer, size_t len, size_t *bytes_w static esp_err_t I2S_Audio_Reconfigure_Clock(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch) { - KLOG_INFO(TAG, "Reconfiguring clock for %lu sps, %lu bps, %d channels.", rate, bits_cfg, ch); + KLOG_DEBUG(TAG, "Reconfiguring clock for %lu sps, %lu bps, %d channels.", rate, bits_cfg, ch); esp_err_t ret = ESP_OK; i2s_std_config_t std_cfg = { diff --git a/components/Audio/I2S_Audio.h b/components/Audio/I2S_Audio.h index 58be48a..2ec9e73 100644 --- a/components/Audio/I2S_Audio.h +++ b/components/Audio/I2S_Audio.h @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/BLE/BLE.c b/components/BLE/BLE.c index f0e1dd6..4241ee4 100644 --- a/components/BLE/BLE.c +++ b/components/BLE/BLE.c @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/BLE/BLE.h b/components/BLE/BLE.h index 6b3a4a1..8f941cc 100644 --- a/components/BLE/BLE.h +++ b/components/BLE/BLE.h @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/Console/CMakeLists.txt b/components/Console/CMakeLists.txt new file mode 100644 index 0000000..b4fbae4 --- /dev/null +++ b/components/Console/CMakeLists.txt @@ -0,0 +1,15 @@ +idf_component_register( + SRCS + "Console.c" + "Commands/Log_Command.c" + INCLUDE_DIRS + "." + "./Commands" + REQUIRES + "SystemK" + "System_Events" + "console" + "log" + "nvs_flash" + "vfs" +) diff --git a/components/Console/Commands/Log_Command.c b/components/Console/Commands/Log_Command.c new file mode 100644 index 0000000..df98dbf --- /dev/null +++ b/components/Console/Commands/Log_Command.c @@ -0,0 +1,358 @@ +/* + * This program source code file is part of the KTag project, a DIY laser tag + * game with customizable features and wide interoperability. + * + * 🛡 🃞 + * + * Copyright © 2026 Joseph P. Kearney and the KTag developers. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * There should be a copy of the GNU Affero General Public License in the LICENSE + * file in the root of this repository. If not, see . + */ + +#include "esp_console.h" +#include "esp_log.h" +#include "nvs.h" +#include "nvs_flash.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "linenoise/linenoise.h" +#include "esp_vfs_dev.h" +#include +#include +#include + +#define LOG_NVS_NS "logcfg" +#define LOGCFG_VERSION 1 +#define MAX_TAGS 16 +#define MAX_TAGLEN 16 + +typedef struct +{ + char tag[MAX_TAGLEN]; + uint8_t level; +} tag_entry_t; + +static esp_log_level_t Saved_Global_Level = ESP_LOG_INFO; +static tag_entry_t Tag_Table[MAX_TAGS] = {0}; +static size_t Tag_Count = 0; + +static bool parse_level(const char *s, esp_log_level_t *out) +{ + if (!strcmp(s, "none")) + *out = ESP_LOG_NONE; + else if (!strcmp(s, "error")) + *out = ESP_LOG_ERROR; + else if (!strcmp(s, "warn")) + *out = ESP_LOG_WARN; + else if (!strcmp(s, "info")) + *out = ESP_LOG_INFO; + else if (!strcmp(s, "debug")) + *out = ESP_LOG_DEBUG; + else if (!strcmp(s, "verbose")) + *out = ESP_LOG_VERBOSE; + else + return false; + return true; +} + +static const char *level_str(esp_log_level_t lvl) +{ + switch (lvl) + { + case ESP_LOG_NONE: + return "none"; + case ESP_LOG_ERROR: + return "error"; + case ESP_LOG_WARN: + return "warn"; + case ESP_LOG_INFO: + return "info"; + case ESP_LOG_DEBUG: + return "debug"; + case ESP_LOG_VERBOSE: + return "verbose"; + default: + return "?"; + } +} + +static void nvs_save(void) +{ + nvs_handle_t h; + esp_err_t err = nvs_open(LOG_NVS_NS, NVS_READWRITE, &h); + if (err != ESP_OK) + return; + + nvs_set_u8(h, "ver", LOGCFG_VERSION); + nvs_set_u8(h, "global", esp_log_get_default_level()); + nvs_set_u8(h, "tagcnt", Tag_Count); + nvs_set_blob(h, "tags", Tag_Table, Tag_Count * sizeof(tag_entry_t)); + + nvs_commit(h); + nvs_close(h); +} + +static void nvs_clear_tags(void) +{ + nvs_handle_t h; + if (nvs_open(LOG_NVS_NS, NVS_READWRITE, &h) != ESP_OK) + return; + nvs_erase_key(h, "tagcnt"); + nvs_erase_key(h, "tags"); + nvs_commit(h); + nvs_close(h); +} + +static void log_config_load(void) +{ + nvs_handle_t h; + if (nvs_open(LOG_NVS_NS, NVS_READONLY, &h) != ESP_OK) + return; + + uint8_t ver; + if (nvs_get_u8(h, "ver", &ver) != ESP_OK || ver != LOGCFG_VERSION) + { + nvs_close(h); + nvs_clear_tags(); + return; + } + + uint8_t lvl; + if (nvs_get_u8(h, "global", &lvl) == ESP_OK) + { + esp_log_level_set("*", lvl); + Saved_Global_Level = lvl; + } + + uint8_t cnt; + if (nvs_get_u8(h, "tagcnt", &cnt) == ESP_OK && cnt <= MAX_TAGS) + { + size_t sz = cnt * sizeof(tag_entry_t); + if (nvs_get_blob(h, "tags", Tag_Table, &sz) == ESP_OK) + { + Tag_Count = cnt; + for (size_t i = 0; i < Tag_Count; i++) + { + esp_log_level_set(Tag_Table[i].tag, Tag_Table[i].level); + } + } + } + + nvs_close(h); +} + +static void clear_tag_levels(void) +{ + esp_log_level_t def = esp_log_get_default_level(); + for (size_t i = 0; i < Tag_Count; i++) + { + esp_log_level_set(Tag_Table[i].tag, def); + } + Tag_Count = 0; +} + +static bool set_tag_level(const char *tag, esp_log_level_t level) +{ + for (size_t i = 0; i < Tag_Count; i++) + { + if (Tag_Table[i].tag[0] != '\0' && !strcmp(Tag_Table[i].tag, tag)) + { + Tag_Table[i].level = level; + return true; + } + } + + if (Tag_Count >= MAX_TAGS) + return false; + + strncpy(Tag_Table[Tag_Count].tag, tag, MAX_TAGLEN - 1); + Tag_Table[Tag_Count].tag[MAX_TAGLEN - 1] = 0; + Tag_Table[Tag_Count].level = level; + Tag_Count++; + return true; +} + +static void print_usage(void) +{ + printf( + "Usage:\n" + " log show\n" + " log reset\n" + " log off | on\n" + " log \n" + " log tag [level|off]\n" + "Levels: none error warn info debug verbose\n"); +} + +static int log_cmd_show(void) +{ + printf("Global level: %s\n", + level_str(esp_log_get_default_level())); + + if (Tag_Count == 0) + { + printf("No tag overrides\n"); + } + else + { + printf("Tag overrides:\n"); + for (size_t i = 0; i < Tag_Count; i++) + { + printf(" %-10s : %s\n", + Tag_Table[i].tag, + level_str(Tag_Table[i].level)); + } + } + return 0; +} + +static int log_cmd_reset(void) +{ + esp_log_level_set("*", ESP_LOG_INFO); + Saved_Global_Level = ESP_LOG_INFO; + clear_tag_levels(); + nvs_clear_tags(); + nvs_save(); + printf("Logging reset to defaults\n"); + return 0; +} + +static int log_cmd_off(void) +{ + Saved_Global_Level = esp_log_get_default_level(); + esp_log_level_set("*", ESP_LOG_NONE); + nvs_save(); + printf("Global logging disabled\n"); + return 0; +} + +static int log_cmd_on(void) +{ + esp_log_level_set("*", Saved_Global_Level); + nvs_save(); + printf("Global logging restored\n"); + return 0; +} + +static int log_cmd_tag(int argc, char **argv) +{ + if (argc < 3) + { + printf("Usage: log tag [level|off]\n"); + return 0; + } + + // Ensure tag is null-terminated and within bounds + char tag[MAX_TAGLEN]; + strncpy(tag, argv[2], MAX_TAGLEN - 1); + tag[MAX_TAGLEN - 1] = '\0'; + + if (argc == 3) + { + printf("Tag '%s' is %s\n", + tag, + level_str(esp_log_level_get(tag))); + return 0; + } + + esp_log_level_t level; + if (!strcmp(argv[3], "off")) + { + level = ESP_LOG_NONE; + } + else if (!parse_level(argv[3], &level)) + { + printf("Invalid level\n"); + return 0; + } + + if (!set_tag_level(tag, level)) + { + printf("Tag table full (%d max)\n", MAX_TAGS); + return 0; + } + + esp_log_level_set(tag, level); + nvs_save(); + printf("Tag '%s' set to %s\n", tag, argv[3]); + return 0; +} + +static int log_cmd_set_global(const char *lvl) +{ + esp_log_level_t level; + if (!parse_level(lvl, &level)) + { + print_usage(); + return 0; + } + + esp_log_level_set("*", level); + Saved_Global_Level = level; + nvs_save(); + printf("Global level set to %s\n", lvl); + return 0; +} + +static int cmd_log(int argc, char **argv) +{ + if (argc < 2) + { + print_usage(); + return 0; + } + + if (!strcmp(argv[1], "show")) + return log_cmd_show(); + if (!strcmp(argv[1], "reset")) + return log_cmd_reset(); + if (!strcmp(argv[1], "off")) + return log_cmd_off(); + if (!strcmp(argv[1], "on")) + return log_cmd_on(); + if (!strcmp(argv[1], "tag")) + return log_cmd_tag(argc, argv); + + return log_cmd_set_global(argv[1]); +} + +static void log_completion(const char *buf, linenoiseCompletions *lc) +{ + if (!strncmp(buf, "log", 3)) + { + linenoiseAddCompletion(lc, "log show"); + linenoiseAddCompletion(lc, "log clear"); + linenoiseAddCompletion(lc, "log reset"); + linenoiseAddCompletion(lc, "log off"); + linenoiseAddCompletion(lc, "log on"); + linenoiseAddCompletion(lc, "log info"); + linenoiseAddCompletion(lc, "log debug"); + linenoiseAddCompletion(lc, "log warn"); + } +} + +void Register_Log_Command(void) +{ + log_config_load(); + + linenoiseSetCompletionCallback(log_completion); + + const esp_console_cmd_t cmd = { + .command = "log", + .help = "Control logging levels", + .func = &cmd_log, + }; + + ESP_ERROR_CHECK(esp_console_cmd_register(&cmd)); +} diff --git a/components/Console/Commands/Log_Command.h b/components/Console/Commands/Log_Command.h new file mode 100644 index 0000000..3cba5f9 --- /dev/null +++ b/components/Console/Commands/Log_Command.h @@ -0,0 +1,23 @@ +/* + * This program source code file is part of the KTag project, a DIY laser tag + * game with customizable features and wide interoperability. + * + * 🛡 🃞 + * + * Copyright © 2026 Joseph P. Kearney and the KTag developers. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * There should be a copy of the GNU Affero General Public License in the LICENSE + * file in the root of this repository. If not, see . + */ + +void Register_Log_Command(void); \ No newline at end of file diff --git a/components/Console/Console.c b/components/Console/Console.c new file mode 100644 index 0000000..af2a29e --- /dev/null +++ b/components/Console/Console.c @@ -0,0 +1,48 @@ +/* + * This program source code file is part of the KTag project, a DIY laser tag + * game with customizable features and wide interoperability. + * + * 🛡 🃞 + * + * Copyright © 2026 Joseph P. Kearney and the KTag developers. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * There should be a copy of the GNU Affero General Public License in the LICENSE + * file in the root of this repository. If not, see . + */ + +#include "esp_console.h" +#include + +static void register_commands() +{ + Register_Log_Command(); + esp_console_register_help_command(); +} + +void Initialize_Console(void) +{ + esp_console_repl_t *repl = NULL; + esp_console_repl_config_t repl_cfg = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); + repl_cfg.prompt = "KTag>"; + repl_cfg.max_cmdline_length = 1024; + repl_cfg.max_history_len = 16; + + register_commands(); + + esp_console_dev_uart_config_t hw_cfg = + ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); + + ESP_ERROR_CHECK( + esp_console_new_repl_uart(&hw_cfg, &repl_cfg, &repl)); + ESP_ERROR_CHECK(esp_console_start_repl(repl)); +} \ No newline at end of file diff --git a/components/Console/Console.h b/components/Console/Console.h new file mode 100644 index 0000000..17ffd48 --- /dev/null +++ b/components/Console/Console.h @@ -0,0 +1,23 @@ +/* + * This program source code file is part of the KTag project, a DIY laser tag + * game with customizable features and wide interoperability. + * + * 🛡 🃞 + * + * Copyright © 2026 Joseph P. Kearney and the KTag developers. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * There should be a copy of the GNU Affero General Public License in the LICENSE + * file in the root of this repository. If not, see . + */ + +void Initialize_Console(void); \ No newline at end of file diff --git a/components/IR/IR.c b/components/IR/IR.c index e4e4e67..4d8d7f1 100644 --- a/components/IR/IR.c +++ b/components/IR/IR.c @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free @@ -384,7 +384,7 @@ static inline void PrintPulseTrainToConsole(TimedPulseTrain_T *train) { for (uint_fast16_t i = 0; i < train->count; i += 2) { - KLOG_INFO(TAG, "%2d: (%d, %4d) (%d, %4d)", i + 1, train->bitstream[i].symbol, train->bitstream[i].duration, train->bitstream[i + 1].symbol, train->bitstream[i + 1].duration); + KLOG_DEBUG(TAG, "%2d: (%d, %4d) (%d, %4d)", i + 1, train->bitstream[i].symbol, train->bitstream[i].duration, train->bitstream[i + 1].symbol, train->bitstream[i + 1].duration); vTaskDelay(pdMS_TO_TICKS(10)); } } diff --git a/components/IR/IR.h b/components/IR/IR.h index a334c9e..21027e0 100644 --- a/components/IR/IR.h +++ b/components/IR/IR.h @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/Key_Value.c b/components/NVM/Key_Value.c index 2872f96..8665841 100644 --- a/components/NVM/Key_Value.c +++ b/components/NVM/Key_Value.c @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/Key_Value.h b/components/NVM/Key_Value.h index 2067406..b3dcf5d 100644 --- a/components/NVM/Key_Value.h +++ b/components/NVM/Key_Value.h @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/NVM.h b/components/NVM/NVM.h index ad5813d..301a1d0 100644 --- a/components/NVM/NVM.h +++ b/components/NVM/NVM.h @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/SPIFFS.c b/components/NVM/SPIFFS.c index 459ec5f..8d21bdf 100644 --- a/components/NVM/SPIFFS.c +++ b/components/NVM/SPIFFS.c @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/SPIFFS.h b/components/NVM/SPIFFS.h index bb6ed37..88d1f12 100644 --- a/components/NVM/SPIFFS.h +++ b/components/NVM/SPIFFS.h @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/Settings.c b/components/NVM/Settings.c index eb3f121..0f934ca 100644 --- a/components/NVM/Settings.c +++ b/components/NVM/Settings.c @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/USB.c b/components/NVM/USB.c index 080acb5..f75a98d 100644 --- a/components/NVM/USB.c +++ b/components/NVM/USB.c @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/NVM/USB.h b/components/NVM/USB.h index d64a531..d57dd7c 100644 --- a/components/NVM/USB.h +++ b/components/NVM/USB.h @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/Reprogramming/Reprogramming.c b/components/Reprogramming/Reprogramming.c index ee0f8e0..941ba8b 100644 --- a/components/Reprogramming/Reprogramming.c +++ b/components/Reprogramming/Reprogramming.c @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/Reprogramming/Reprogramming.h b/components/Reprogramming/Reprogramming.h index d3df3f9..9f20e12 100644 --- a/components/Reprogramming/Reprogramming.h +++ b/components/Reprogramming/Reprogramming.h @@ -1,9 +1,9 @@ /* * This program source code file is part of the KTag project. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/Switches/Switches.c b/components/Switches/Switches.c index 74be7cd..2662da1 100644 --- a/components/Switches/Switches.c +++ b/components/Switches/Switches.c @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/Switches/Switches.h b/components/Switches/Switches.h index 62866a0..6625064 100644 --- a/components/Switches/Switches.h +++ b/components/Switches/Switches.h @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/SystemK b/components/SystemK index f80cb59..45df6f9 160000 --- a/components/SystemK +++ b/components/SystemK @@ -1 +1 @@ -Subproject commit f80cb59828aca6f784adcc898aa2603303c5cf2f +Subproject commit 45df6f952abb82c2825a8bb16783c10a150adeba diff --git a/components/System_Events/System_Events.c b/components/System_Events/System_Events.c index 333474c..ff48e01 100644 --- a/components/System_Events/System_Events.c +++ b/components/System_Events/System_Events.c @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2025-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/components/System_Events/System_Events.h b/components/System_Events/System_Events.h index 60bc97d..c6a9ca5 100644 --- a/components/System_Events/System_Events.h +++ b/components/System_Events/System_Events.h @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2025-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/main/HW_NeoPixels.c b/main/HW_NeoPixels.c index ba2654c..6d4255e 100644 --- a/main/HW_NeoPixels.c +++ b/main/HW_NeoPixels.c @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/main/HW_NeoPixels.h b/main/HW_NeoPixels.h index 51934fd..39c9196 100644 --- a/main/HW_NeoPixels.h +++ b/main/HW_NeoPixels.h @@ -2,9 +2,9 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * - * Copyright © 2024-2025 Joseph P. Kearney and the KTag developers. + * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free diff --git a/main/Version.h b/main/Version.h index eef12d9..c46f3f8 100644 --- a/main/Version.h +++ b/main/Version.h @@ -2,7 +2,7 @@ * This program source code file is part of the KTag project, a DIY laser tag * game with customizable features and wide interoperability. * - * 🛡️ 🃞 + * 🛡 🃞 * * Copyright © 2024-2026 Joseph P. Kearney and the KTag developers. * diff --git a/main/main.c b/main/main.c index 5d80d4f..79fd198 100644 --- a/main/main.c +++ b/main/main.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include "nvs_flash.h" #include "HW_NeoPixels.h" @@ -83,6 +84,8 @@ void app_main(void) KLOG_ERROR(TAG, "Error initializing NVS: %s", esp_err_to_name(ret)); } + Initialize_Console(); + Initialize_SPIFFS(); Wait_For_System_Event(SYS_SPIFFS_READY, "Timeout initializing SPIFFS!", INITIALIZATION_TIMEOUT_IN_ms); diff --git a/sdkconfig b/sdkconfig index 34cfba1..b4eb3d9 100644 --- a/sdkconfig +++ b/sdkconfig @@ -390,7 +390,7 @@ CONFIG_IDF_TOOLCHAIN_GCC=y CONFIG_IDF_TARGET_ARCH_XTENSA=y CONFIG_IDF_TARGET_ARCH="xtensa" CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_INIT_VERSION="5.5.1" +CONFIG_IDF_INIT_VERSION="5.5.2" CONFIG_IDF_TARGET_ESP32S3=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 @@ -450,7 +450,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=3 # # Format # -# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_COLORS=y CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y # end of Format @@ -998,7 +998,7 @@ CONFIG_BT_ALARM_MAX_NUM=50 # # Console Library # -# CONFIG_CONSOLE_SORTED_HELP is not set +CONFIG_CONSOLE_SORTED_HELP=y # end of Console Library # @@ -1952,19 +1952,17 @@ CONFIG_LOG_VERSION=1 # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set -# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=3 -# CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT is not set -CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y -# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=4 +CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y +CONFIG_LOG_DEFAULT_LEVEL=5 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +CONFIG_LOG_MAXIMUM_LEVEL=5 # # Level Settings # -# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_MASTER_LEVEL=y CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y # CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set # CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set diff --git a/spiffs_image/default_config.txt b/spiffs_image/default_config.txt index 993d5f9..28cb503 100644 --- a/spiffs_image/default_config.txt +++ b/spiffs_image/default_config.txt @@ -1,6 +1,6 @@ ; Example configuration file for the KTag 2024A. ; -; 🛡️ 🃞 +; 🛡 🃞 ; Metadata Config_Version=1