From c8f6bf24fc23416cccbcab9e3ba3b4b32cf54f71 Mon Sep 17 00:00:00 2001 From: Joe Kearney Date: Sun, 4 Jan 2026 23:53:57 +0000 Subject: [PATCH 1/5] Upgrade the ESP-IDF to v5.5.2 (#10) This pull request upgraded the ESP-IDF used by this software to [v5.5.2](https://github.com/espressif/esp-idf/releases/tag/v5.5.2). It also bumps the minor version to `01`. Co-authored-by: Joe Kearney Reviewed-on: https://git.ktag.clubk.club/Software/2024A-SW/pulls/10 --- README.md | 4 +- dependencies.lock | 4 +- main/Version.h | 4 +- main/idf_component.yml | 4 +- sdkconfig | 211 ++++++++++++++++++++++++++--------------- 5 files changed, 141 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index 754e059..f79c4b7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This software is part of the KTag project, a DIY laser tag game with customizabl 🛡️ 🃞 -Copyright © 2023-2025 Joseph P. Kearney and the KTag developers. +Copyright © 2023-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 @@ -37,7 +37,7 @@ This software in turn makes use of the following open-source software libraries | Name | Version | License ([SPDX](https://spdx.org/licenses/)) | URL |----------------------------|--------:|--------------------------------------------------------------------------|--------------------------------------------- | SystemK | 1.0 | [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) | https://git.ktag.clubk.club/Software/SystemK/ -| ESP-IDF | 5.5.1 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://github.com/espressif/esp-idf/ +| ESP-IDF | 5.5.2 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://github.com/espressif/esp-idf/ | espressif/button | 3.5.0 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/button | espressif/led_strip | 2.5.3 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/led_strip | espressif/usb_host_msc | 1.1.4 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/usb_host_msc diff --git a/dependencies.lock b/dependencies.lock index eb64311..0bed567 100644 --- a/dependencies.lock +++ b/dependencies.lock @@ -82,7 +82,7 @@ dependencies: idf: source: type: idf - version: 5.5.1 + version: 5.5.2 direct_dependencies: - chmorgan/esp-audio-player - chmorgan/esp-libhelix-mp3 @@ -90,6 +90,6 @@ direct_dependencies: - espressif/mdns - espressif/usb_host_msc - idf -manifest_hash: 9164944e752c9209cbb452b373b4f381078750cd7e2458c8ff9059700987d0b3 +manifest_hash: 5b1cfb7b4c52ebc94cab936b2f38ddcbe41bf628b9bb3665f579c79f249e4c3b target: esp32s3 version: 2.0.0 diff --git a/main/Version.h b/main/Version.h index eaeec71..eef12d9 100644 --- a/main/Version.h +++ b/main/Version.h @@ -4,7 +4,7 @@ * * 🛡️ 🃞 * - * 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 @@ -24,7 +24,7 @@ #define VERSION_H #define VERSION_MAJOR 01 -#define VERSION_MINOR 00 +#define VERSION_MINOR 01 #define STRINGIFY(number) #number #define VERSION_STRING(major, minor) STRINGIFY(major) "." STRINGIFY(minor) diff --git a/main/idf_component.yml b/main/idf_component.yml index da9ba9e..0388fce 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -7,9 +7,9 @@ dependencies: espressif/usb_host_msc: "^1.1.4" ## Required IDF version (>=5.1 is required for the SPI backend of the led-strip component.) - ## We tested with 5.5.1. + ## We tested with 5.5.2. idf: - version: ">=5.5.1" + version: ">=5.5.2" # # Put list of dependencies here # # For components maintained by Espressif: diff --git a/sdkconfig b/sdkconfig index b3bf2be..34cfba1 100644 --- a/sdkconfig +++ b/sdkconfig @@ -1,6 +1,6 @@ # # Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) 5.5.1 Project Configuration +# Espressif IoT Development Framework (ESP-IDF) 5.5.2 Project Configuration # CONFIG_SOC_ADC_SUPPORTED=y CONFIG_SOC_UART_SUPPORTED=y @@ -124,7 +124,6 @@ CONFIG_SOC_GPIO_OUT_RANGE_MAX=48 CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 -CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y @@ -185,7 +184,7 @@ CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48 CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y -CONFIG_SOC_RMT_SUPPORT_TX_ASYNC_STOP=y +CONFIG_SOC_RMT_SUPPORT_ASYNC_STOP=y CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y @@ -660,31 +659,34 @@ CONFIG_BT_CONTROLLER_ENABLED=y # # NimBLE Options # + +# +# General +# CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y # CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL is not set # CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set -# CONFIG_BT_NIMBLE_LOG_LEVEL_NONE is not set -# CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR is not set -CONFIG_BT_NIMBLE_LOG_LEVEL_WARNING=y -# CONFIG_BT_NIMBLE_LOG_LEVEL_INFO is not set -# CONFIG_BT_NIMBLE_LOG_LEVEL_DEBUG is not set -CONFIG_BT_NIMBLE_LOG_LEVEL=2 -CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3 -CONFIG_BT_NIMBLE_MAX_BONDS=3 -CONFIG_BT_NIMBLE_MAX_CCCDS=8 -CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=0 +CONFIG_BT_NIMBLE_PINNED_TO_CORE=0 CONFIG_BT_NIMBLE_PINNED_TO_CORE_0=y # CONFIG_BT_NIMBLE_PINNED_TO_CORE_1 is not set -CONFIG_BT_NIMBLE_PINNED_TO_CORE=0 CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=4096 +CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE=y +# end of General + +# +# Roles and Profiles +# CONFIG_BT_NIMBLE_ROLE_CENTRAL=y CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y CONFIG_BT_NIMBLE_ROLE_OBSERVER=y CONFIG_BT_NIMBLE_GATT_CLIENT=y CONFIG_BT_NIMBLE_GATT_SERVER=y -CONFIG_BT_NIMBLE_NVS_PERSIST=y -# CONFIG_BT_NIMBLE_SMP_ID_RESET is not set +# end of Roles and Profiles + +# +# Security (SMP) +# CONFIG_BT_NIMBLE_SECURITY_ENABLE=y CONFIG_BT_NIMBLE_SM_LEGACY=y CONFIG_BT_NIMBLE_SM_SC=y @@ -692,14 +694,38 @@ CONFIG_BT_NIMBLE_SM_SC=y CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_ENCRYPTION=y CONFIG_BT_NIMBLE_SM_LVL=0 CONFIG_BT_NIMBLE_SM_SC_ONLY=0 -CONFIG_BT_NIMBLE_PRINT_ERR_NAME=y -# CONFIG_BT_NIMBLE_DEBUG is not set -# CONFIG_BT_NIMBLE_DYNAMIC_SERVICE is not set -CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="KTag 32ESPecial" -CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 +# end of Security (SMP) + +# +# GAP / GATT / Device Settings +# +CONFIG_BT_NIMBLE_RPA_TIMEOUT=900 +CONFIG_BT_NIMBLE_WHITELIST_SIZE=12 +CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=y +CONFIG_BT_NIMBLE_MAX_CONN_REATTEMPT=3 +# CONFIG_BT_NIMBLE_HANDLE_REPEAT_PAIRING_DELETION is not set +# CONFIG_BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN is not set +# CONFIG_BT_NIMBLE_HOST_QUEUE_CONG_CHECK is not set +CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3 +CONFIG_BT_NIMBLE_MAX_BONDS=3 +CONFIG_BT_NIMBLE_MAX_CCCDS=8 +CONFIG_BT_NIMBLE_NVS_PERSIST=y +# CONFIG_BT_NIMBLE_SMP_ID_RESET is not set CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=256 CONFIG_BT_NIMBLE_ATT_MAX_PREP_ENTRIES=64 -CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0 +CONFIG_BT_NIMBLE_GATT_MAX_PROCS=4 +CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS=y +CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS=2000 +CONFIG_BT_NIMBLE_USE_ESP_TIMER=y +# CONFIG_BT_NIMBLE_BLE_GATT_BLOB_TRANSFER is not set +# CONFIG_BT_NIMBLE_HS_FLOW_CTRL is not set +# end of GAP / GATT / Device Settings + +# +# L2CAP +# +CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=0 +# end of L2CAP # # Memory Settings @@ -714,17 +740,12 @@ CONFIG_BT_NIMBLE_TRANSPORT_EVT_SIZE=70 CONFIG_BT_NIMBLE_TRANSPORT_EVT_COUNT=30 CONFIG_BT_NIMBLE_TRANSPORT_EVT_DISCARD_COUNT=8 CONFIG_BT_NIMBLE_L2CAP_COC_SDU_BUFF_COUNT=1 +# CONFIG_BT_NIMBLE_MEMPOOL_RUNTIME_ALLOC is not set # end of Memory Settings -CONFIG_BT_NIMBLE_GATT_MAX_PROCS=4 -# CONFIG_BT_NIMBLE_HS_FLOW_CTRL is not set -CONFIG_BT_NIMBLE_RPA_TIMEOUT=900 -# CONFIG_BT_NIMBLE_MESH is not set -CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS=y -CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS=2000 -CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=y -CONFIG_BT_NIMBLE_MAX_CONN_REATTEMPT=3 -# CONFIG_BT_NIMBLE_HANDLE_REPEAT_PAIRING_DELETION is not set +# +# BLE 5.x Features +# CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT=y CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY=y CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY=y @@ -732,17 +753,11 @@ CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY=y CONFIG_BT_NIMBLE_EXT_SCAN=y CONFIG_BT_NIMBLE_ENABLE_PERIODIC_SYNC=y CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS=0 -# CONFIG_BT_NIMBLE_GATT_CACHING is not set -# CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY is not set -CONFIG_BT_NIMBLE_WHITELIST_SIZE=12 -# CONFIG_BT_NIMBLE_TEST_THROUGHPUT_TEST is not set -# CONFIG_BT_NIMBLE_BLUFI_ENABLE is not set -CONFIG_BT_NIMBLE_USE_ESP_TIMER=y -CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE=y -# CONFIG_BT_NIMBLE_BLE_GATT_BLOB_TRANSFER is not set +# CONFIG_BT_NIMBLE_ISO is not set +# end of BLE 5.x Features # -# BLE Services +# Services # CONFIG_BT_NIMBLE_PROX_SERVICE=y CONFIG_BT_NIMBLE_ANS_SERVICE=y @@ -767,6 +782,19 @@ CONFIG_BT_NIMBLE_DIS_SERVICE=y # CONFIG_BT_NIMBLE_SVC_DIS_PNP_ID is not set # CONFIG_BT_NIMBLE_SVC_DIS_INCLUDED is not set CONFIG_BT_NIMBLE_GAP_SERVICE=y +CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="KTag 32ESPecial" +CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 +CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0 +CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM=0 +CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_ENC=0 +CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHEN=0 +CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHOR=0 +# CONFIG_BT_NIMBLE_SVC_GAP_GATT_SECURITY_LEVEL is not set +# CONFIG_BT_NIMBLE_SVC_GAP_RPA_ONLY is not set +CONFIG_BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP=y +# CONFIG_BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP is not set +# CONFIG_BT_NIMBLE_SVC_GAP_CAR_SUPP is not set +CONFIG_BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION=-1 # # GAP Appearance write permissions @@ -778,11 +806,6 @@ CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN=0 CONFIG_BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR=0 # end of GAP Appearance write permissions -CONFIG_BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP=y -# CONFIG_BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP is not set -# CONFIG_BT_NIMBLE_SVC_GAP_CAR_SUPP is not set -CONFIG_BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION=-1 - # # GAP device name write permissions # @@ -797,22 +820,27 @@ CONFIG_BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL=0 CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY=0 CONFIG_BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO=0 # end of Peripheral Preferred Connection Parameters (PPCP) settings +# end of Services -CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM=0 -CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_ENC=0 -CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHEN=0 -CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM_AUTHOR=0 -# CONFIG_BT_NIMBLE_SVC_GAP_GATT_SECURITY_LEVEL is not set -# CONFIG_BT_NIMBLE_SVC_GAP_RPA_ONLY is not set -# end of BLE Services - -# CONFIG_BT_NIMBLE_VS_SUPPORT is not set +# +# Extra Features +# +# CONFIG_BT_NIMBLE_DYNAMIC_SERVICE is not set +# CONFIG_BT_NIMBLE_GATT_CACHING is not set +# CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY is not set +# CONFIG_BT_NIMBLE_BLUFI_ENABLE is not set # CONFIG_BT_NIMBLE_ENC_ADV_DATA is not set -CONFIG_BT_NIMBLE_HIGH_DUTY_ADV_ITVL=y -# CONFIG_BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN is not set -# CONFIG_BT_NIMBLE_HOST_QUEUE_CONG_CHECK is not set # CONFIG_BT_NIMBLE_GATTC_PROC_PREEMPTION_PROTECT is not set # CONFIG_BT_NIMBLE_GATTC_AUTO_PAIR is not set +CONFIG_BT_NIMBLE_EATT_CHAN_NUM=0 +# CONFIG_BT_NIMBLE_SUBRATE is not set +# end of Extra Features + +# +# NimBLE Mesh +# +# CONFIG_BT_NIMBLE_MESH is not set +# end of NimBLE Mesh # # Host-controller Transport @@ -824,8 +852,26 @@ CONFIG_BT_NIMBLE_HCI_UART_RTS_PIN=19 CONFIG_BT_NIMBLE_HCI_UART_CTS_PIN=23 # end of Host-controller Transport -CONFIG_BT_NIMBLE_EATT_CHAN_NUM=0 -# CONFIG_BT_NIMBLE_SUBRATE is not set +# +# Debugging/Testing +# +# CONFIG_BT_NIMBLE_LOG_LEVEL_NONE is not set +# CONFIG_BT_NIMBLE_LOG_LEVEL_ERROR is not set +CONFIG_BT_NIMBLE_LOG_LEVEL_WARNING=y +# CONFIG_BT_NIMBLE_LOG_LEVEL_INFO is not set +# CONFIG_BT_NIMBLE_LOG_LEVEL_DEBUG is not set +CONFIG_BT_NIMBLE_LOG_LEVEL=2 +CONFIG_BT_NIMBLE_PRINT_ERR_NAME=y +# CONFIG_BT_NIMBLE_DEBUG is not set +# CONFIG_BT_NIMBLE_TEST_THROUGHPUT_TEST is not set +# end of Debugging/Testing + +# +# Vendor / Optimization +# +# CONFIG_BT_NIMBLE_VS_SUPPORT is not set +CONFIG_BT_NIMBLE_HIGH_DUTY_ADV_ITVL=y +# end of Vendor / Optimization # end of NimBLE Options # @@ -932,8 +978,16 @@ CONFIG_BT_CTRL_BLE_ADV=y # Common Options # CONFIG_BT_ALARM_MAX_NUM=50 + +# +# BLE Log +# +# CONFIG_BLE_LOG_ENABLED is not set +# end of BLE Log + # CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED is not set # CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED is not set +# CONFIG_BT_LE_USED_MEM_STATISTICS_ENABLED is not set # end of Common Options # CONFIG_BT_HCI_LOG_DEBUG_EN is not set @@ -1047,7 +1101,6 @@ CONFIG_EFUSE_MAX_BLK_LEN=256 # CONFIG_ESP_TLS_USING_MBEDTLS=y # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set @@ -1192,6 +1245,7 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # ESP-Driver:TWAI Configurations # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_IO_FUNC_IN_IRAM is not set # CONFIG_TWAI_ISR_CACHE_SAFE is not set # CONFIG_TWAI_ENABLE_DEBUG_LOG is not set # end of ESP-Driver:TWAI Configurations @@ -1407,9 +1461,9 @@ CONFIG_ESP_INTR_IN_IRAM=y # # ESP-Driver:LCD Controller Configurations # -# CONFIG_LCD_ENABLE_DEBUG_LOG is not set # CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set # end of ESP-Driver:LCD Controller Configurations # @@ -1494,6 +1548,7 @@ CONFIG_SPIRAM_BOOT_HW_INIT=y CONFIG_SPIRAM_BOOT_INIT=y CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y # CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set # CONFIG_SPIRAM_USE_CAPS_ALLOC is not set CONFIG_SPIRAM_USE_MALLOC=y CONFIG_SPIRAM_MEMTEST=y @@ -1694,7 +1749,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y # CONFIG_ESP_WIFI_WAPI_PSK is not set -# CONFIG_ESP_WIFI_SUITE_B_192 is not set # CONFIG_ESP_WIFI_11KV_SUPPORT is not set # CONFIG_ESP_WIFI_MBO_SUPPORT is not set # CONFIG_ESP_WIFI_DPP_SUPPORT is not set @@ -1706,10 +1760,10 @@ CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y # # CONFIG_ESP_WIFI_WPS_STRICT is not set # CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# CONFIG_ESP_WIFI_WPS_RECONNECT_ON_FAIL is not set # end of WPS Configuration Options # CONFIG_ESP_WIFI_DEBUG_PRINT is not set -# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set # CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set # end of Wi-Fi @@ -2056,6 +2110,7 @@ CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 +# CONFIG_LWIP_IPV6_ND6_ROUTE_INFO_OPTION_SUPPORT is not set # CONFIG_LWIP_PPP_SUPPORT is not set # CONFIG_LWIP_SLIP_SUPPORT is not set @@ -2324,6 +2379,8 @@ CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y # # CONFIG_OPENTHREAD_SPINEL_ONLY is not set # end of OpenThread Spinel + +# CONFIG_OPENTHREAD_DEBUG is not set # end of OpenThread # @@ -2700,39 +2757,39 @@ CONFIG_NIMBLE_ENABLED=y CONFIG_NIMBLE_MEM_ALLOC_MODE_INTERNAL=y # CONFIG_NIMBLE_MEM_ALLOC_MODE_EXTERNAL is not set # CONFIG_NIMBLE_MEM_ALLOC_MODE_DEFAULT is not set -CONFIG_NIMBLE_MAX_CONNECTIONS=3 -CONFIG_NIMBLE_MAX_BONDS=3 -CONFIG_NIMBLE_MAX_CCCDS=8 -CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=0 +CONFIG_NIMBLE_PINNED_TO_CORE=0 CONFIG_NIMBLE_PINNED_TO_CORE_0=y # CONFIG_NIMBLE_PINNED_TO_CORE_1 is not set -CONFIG_NIMBLE_PINNED_TO_CORE=0 CONFIG_NIMBLE_TASK_STACK_SIZE=4096 CONFIG_BT_NIMBLE_TASK_STACK_SIZE=4096 CONFIG_NIMBLE_ROLE_CENTRAL=y CONFIG_NIMBLE_ROLE_PERIPHERAL=y CONFIG_NIMBLE_ROLE_BROADCASTER=y CONFIG_NIMBLE_ROLE_OBSERVER=y -CONFIG_NIMBLE_NVS_PERSIST=y CONFIG_NIMBLE_SM_LEGACY=y CONFIG_NIMBLE_SM_SC=y # CONFIG_NIMBLE_SM_SC_DEBUG_KEYS is not set CONFIG_BT_NIMBLE_SM_SC_LVL=0 -# CONFIG_NIMBLE_DEBUG is not set -CONFIG_NIMBLE_SVC_GAP_DEVICE_NAME="KTag 32ESPecial" -CONFIG_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 +CONFIG_NIMBLE_RPA_TIMEOUT=900 +CONFIG_NIMBLE_MAX_CONNECTIONS=3 +CONFIG_NIMBLE_MAX_BONDS=3 +CONFIG_NIMBLE_MAX_CCCDS=8 +CONFIG_NIMBLE_NVS_PERSIST=y CONFIG_NIMBLE_ATT_PREFERRED_MTU=256 -CONFIG_NIMBLE_SVC_GAP_APPEARANCE=0 +CONFIG_NIMBLE_CRYPTO_STACK_MBEDTLS=y +# CONFIG_NIMBLE_HS_FLOW_CTRL is not set +CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=0 CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT=12 CONFIG_BT_NIMBLE_ACL_BUF_COUNT=24 CONFIG_BT_NIMBLE_ACL_BUF_SIZE=255 CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 CONFIG_BT_NIMBLE_HCI_EVT_HI_BUF_COUNT=30 CONFIG_BT_NIMBLE_HCI_EVT_LO_BUF_COUNT=8 -# CONFIG_NIMBLE_HS_FLOW_CTRL is not set -CONFIG_NIMBLE_RPA_TIMEOUT=900 +CONFIG_NIMBLE_SVC_GAP_DEVICE_NAME="KTag 32ESPecial" +CONFIG_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31 +CONFIG_NIMBLE_SVC_GAP_APPEARANCE=0 # CONFIG_NIMBLE_MESH is not set -CONFIG_NIMBLE_CRYPTO_STACK_MBEDTLS=y +# CONFIG_NIMBLE_DEBUG is not set # CONFIG_BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_EN is not set CONFIG_BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_DIS=y CONFIG_SW_COEXIST_ENABLE=y @@ -2835,7 +2892,6 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_WAPI_PSK is not set -# CONFIG_WPA_SUITE_B_192 is not set # CONFIG_WPA_11KV_SUPPORT is not set # CONFIG_WPA_MBO_SUPPORT is not set # CONFIG_WPA_DPP_SUPPORT is not set @@ -2843,7 +2899,6 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_DEBUG_PRINT is not set -# CONFIG_WPA_TESTING_OPTIONS is not set CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set # CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE is not set From 376acd48159ffcd59de877f9f1a6fd3962f0a721 Mon Sep 17 00:00:00 2001 From: Joe Kearney Date: Sat, 10 Jan 2026 22:49:51 +0000 Subject: [PATCH 2/5] Added console with one command (so far): log (#11) Co-authored-by: Joe Kearney Reviewed-on: https://git.ktag.clubk.club/Software/2024A-SW/pulls/11 --- components/Audio/I2S_Audio.c | 6 +- components/Console/CMakeLists.txt | 15 + components/Console/Commands/Log_Command.c | 358 ++++++++++++++++++++++ components/Console/Commands/Log_Command.h | 23 ++ components/Console/Console.c | 48 +++ components/Console/Console.h | 23 ++ components/IR/IR.c | 6 +- components/SystemK | 2 +- main/Version.h | 2 +- main/main.c | 3 + sdkconfig | 27 +- 11 files changed, 494 insertions(+), 19 deletions(-) create mode 100644 components/Console/CMakeLists.txt create mode 100644 components/Console/Commands/Log_Command.c create mode 100644 components/Console/Commands/Log_Command.h create mode 100644 components/Console/Console.c create mode 100644 components/Console/Console.h 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/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/SystemK b/components/SystemK index f80cb59..c4350eb 160000 --- a/components/SystemK +++ b/components/SystemK @@ -1 +1 @@ -Subproject commit f80cb59828aca6f784adcc898aa2603303c5cf2f +Subproject commit c4350ebd2700a7d52f84b3783f945ddf4ac54963 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 9b0069e..0a7856b 100644 --- a/main/main.c +++ b/main/main.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "nvs_flash.h" #include "HW_NeoPixels.h" #include "Version.h" @@ -82,6 +83,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..1613bf3 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 @@ -2638,6 +2636,13 @@ CONFIG_KTAG_ANIMATION_STEP_TIME_IN_ms=10 CONFIG_KTAG_T_DEFAULT_START_GAME_in_ms=30000 CONFIG_KTAG_MAX_AUDIO_VOLUME=100 CONFIG_KTAG_MIN_AUDIO_VOLUME=0 +CONFIG_SYSTEMK_LOG_LEVEL=5 +# CONFIG_SYSTEMK_LOG_LEVEL_NONE is not set +# CONFIG_SYSTEMK_LOG_LEVEL_ERROR is not set +# CONFIG_SYSTEMK_LOG_LEVEL_WARN is not set +# CONFIG_SYSTEMK_LOG_LEVEL_INFO is not set +# CONFIG_SYSTEMK_LOG_LEVEL_DEBUG is not set +CONFIG_SYSTEMK_LOG_LEVEL_VERBOSE=y # end of KTag SystemK # From ebee29a1e4da906960e85fd1e548186afe1cadf2 Mon Sep 17 00:00:00 2001 From: Joe Kearney Date: Sat, 10 Jan 2026 23:21:28 +0000 Subject: [PATCH 3/5] Annum Novum Faustum Felicem MMXXVI (#12) Co-authored-by: Joe Kearney Reviewed-on: https://git.ktag.clubk.club/Software/2024A-SW/pulls/12 --- README.md | 2 +- components/Audio/I2S_Audio.h | 4 ++-- components/BLE/BLE.c | 4 ++-- components/BLE/BLE.h | 4 ++-- components/IR/IR.h | 4 ++-- components/NVM/Key_Value.c | 4 ++-- components/NVM/Key_Value.h | 4 ++-- components/NVM/NVM.h | 4 ++-- components/NVM/SPIFFS.c | 4 ++-- components/NVM/SPIFFS.h | 4 ++-- components/NVM/Settings.c | 4 ++-- components/NVM/USB.c | 4 ++-- components/NVM/USB.h | 4 ++-- components/Reprogramming/Reprogramming.c | 4 ++-- components/Reprogramming/Reprogramming.h | 4 ++-- components/Switches/Switches.c | 4 ++-- components/Switches/Switches.h | 4 ++-- components/SystemK | 2 +- components/System_Events/System_Events.c | 4 ++-- components/System_Events/System_Events.h | 4 ++-- main/HW_NeoPixels.c | 4 ++-- main/HW_NeoPixels.h | 4 ++-- spiffs_image/default_config.txt | 2 +- 23 files changed, 43 insertions(+), 43 deletions(-) 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.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/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 c4350eb..45df6f9 160000 --- a/components/SystemK +++ b/components/SystemK @@ -1 +1 @@ -Subproject commit c4350ebd2700a7d52f84b3783f945ddf4ac54963 +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/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 From 393994131585801e171be0017ea8953f78a14d54 Mon Sep 17 00:00:00 2001 From: Joe Kearney Date: Sun, 11 Jan 2026 01:08:13 +0000 Subject: [PATCH 4/5] Fixed directory conflict on Windows. (#13) CMake on Windows had conflicts with one directory in the project tree named `console`, and another named `Console`. Co-authored-by: Joe Kearney Reviewed-on: https://git.ktag.clubk.club/Software/2024A-SW/pulls/13 --- README.md | 2 +- components/{Console => Serial_Console}/CMakeLists.txt | 0 components/{Console => Serial_Console}/Commands/Log_Command.c | 0 components/{Console => Serial_Console}/Commands/Log_Command.h | 0 components/{Console => Serial_Console}/Console.c | 0 components/{Console => Serial_Console}/Console.h | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename components/{Console => Serial_Console}/CMakeLists.txt (100%) rename components/{Console => Serial_Console}/Commands/Log_Command.c (100%) rename components/{Console => Serial_Console}/Commands/Log_Command.h (100%) rename components/{Console => Serial_Console}/Console.c (100%) rename components/{Console => Serial_Console}/Console.h (100%) diff --git a/README.md b/README.md index 62c50f3..96deb6d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ This software in turn makes use of the following open-source software libraries | Name | Version | License ([SPDX](https://spdx.org/licenses/)) | URL |----------------------------|--------:|--------------------------------------------------------------------------|--------------------------------------------- -| SystemK | 1.0 | [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) | https://git.ktag.clubk.club/Software/SystemK/ +| SystemK | 1.01 | [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) | https://git.ktag.clubk.club/Software/SystemK/ | ESP-IDF | 5.5.2 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://github.com/espressif/esp-idf/ | espressif/button | 3.5.0 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/button | espressif/led_strip | 2.5.3 | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | https://components.espressif.com/components/espressif/led_strip diff --git a/components/Console/CMakeLists.txt b/components/Serial_Console/CMakeLists.txt similarity index 100% rename from components/Console/CMakeLists.txt rename to components/Serial_Console/CMakeLists.txt diff --git a/components/Console/Commands/Log_Command.c b/components/Serial_Console/Commands/Log_Command.c similarity index 100% rename from components/Console/Commands/Log_Command.c rename to components/Serial_Console/Commands/Log_Command.c diff --git a/components/Console/Commands/Log_Command.h b/components/Serial_Console/Commands/Log_Command.h similarity index 100% rename from components/Console/Commands/Log_Command.h rename to components/Serial_Console/Commands/Log_Command.h diff --git a/components/Console/Console.c b/components/Serial_Console/Console.c similarity index 100% rename from components/Console/Console.c rename to components/Serial_Console/Console.c diff --git a/components/Console/Console.h b/components/Serial_Console/Console.h similarity index 100% rename from components/Console/Console.h rename to components/Serial_Console/Console.h From 2c81bdd0528d0ae225124c2153db5330b8873f70 Mon Sep 17 00:00:00 2001 From: Joe Kearney Date: Sat, 17 Jan 2026 16:33:41 +0000 Subject: [PATCH 5/5] Added a new console command: "system" (#14) ``` KTag> system Usage: system chip-info - Show chip and system information system coredump - Check coredump status system factory-reset - Clear NVS and restart system flash - Show flash information system heap-caps - Show heap by capability system hostname [name]- Show/set hostname system mac - Show MAC addresses system partition - List partition table system RAM - Display heap memory usage system reboot - Reboot the device system reset-reason - Show last reset reason system stats - Combined system statistics system tasks - List FreeRTOS tasks system uptime - Display system uptime system version - Show firmware version ``` Co-authored-by: Joe Kearney Reviewed-on: https://git.ktag.clubk.club/Software/2024A-SW/pulls/14 --- components/Serial_Console/CMakeLists.txt | 20 + .../Serial_Console/Commands/System_Command.c | 663 ++++++++++++++++++ .../Serial_Console/Commands/System_Command.h | 23 + components/Serial_Console/Console.c | 2 + .../generate_git_versions.cmake | 72 ++ main/HW_NeoPixels.c | 2 +- sdkconfig | 33 +- 7 files changed, 801 insertions(+), 14 deletions(-) create mode 100644 components/Serial_Console/Commands/System_Command.c create mode 100644 components/Serial_Console/Commands/System_Command.h create mode 100644 components/Serial_Console/generate_git_versions.cmake diff --git a/components/Serial_Console/CMakeLists.txt b/components/Serial_Console/CMakeLists.txt index b4fbae4..94c73e9 100644 --- a/components/Serial_Console/CMakeLists.txt +++ b/components/Serial_Console/CMakeLists.txt @@ -2,14 +2,34 @@ idf_component_register( SRCS "Console.c" "Commands/Log_Command.c" + "Commands/System_Command.c" INCLUDE_DIRS "." "./Commands" REQUIRES "SystemK" "System_Events" + "app_update" "console" + "espcoredump" + "esp_netif" + "esp_pm" + "esp_timer" "log" "nvs_flash" + "spi_flash" "vfs" ) + +target_compile_definitions(${COMPONENT_LIB} PRIVATE HAS_SYSTEMK_GIT_VERSION) + +add_custom_target(generate_git_versions ALL + COMMAND ${CMAKE_COMMAND} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -DOUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/git_versions.h + -P ${CMAKE_CURRENT_SOURCE_DIR}/generate_git_versions.cmake + BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/git_versions.h +) + +add_dependencies(${COMPONENT_LIB} generate_git_versions) +target_include_directories(${COMPONENT_LIB} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/components/Serial_Console/Commands/System_Command.c b/components/Serial_Console/Commands/System_Command.c new file mode 100644 index 0000000..feaf949 --- /dev/null +++ b/components/Serial_Console/Commands/System_Command.c @@ -0,0 +1,663 @@ +/* + * 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_system.h" +#include "esp_chip_info.h" +#include "esp_flash.h" +#include "esp_partition.h" +#include "esp_ota_ops.h" +#include "esp_app_desc.h" +#include "esp_idf_version.h" +#include "esp_pm.h" +#include "esp_sleep.h" +#include "esp_timer.h" +#include "esp_heap_caps.h" +#include "esp_mac.h" +#include "esp_netif.h" +#include "esp_core_dump.h" +#include "nvs_flash.h" +#include "linenoise/linenoise.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "git_versions.h" // Generated during the build process. +#include +#include +#include +#include + +static void print_usage(void) +{ + printf( + "Usage:\n" + " system chip-info - Show chip and system information\n" + " system coredump - Check coredump status\n" + " system factory-reset - Clear NVS and restart\n" + " system flash - Show flash information\n" + " system heap-caps - Show heap by capability\n" + " system hostname [name]- Show/set hostname\n" + " system mac - Show MAC addresses\n" + " system partition - List partition table\n" + " system RAM - Display heap memory usage\n" + " system reboot - Reboot the device\n" + " system reset-reason - Show last reset reason\n" + " system stats - Combined system statistics\n" + " system tasks - List FreeRTOS tasks\n" + " system uptime - Display system uptime\n" + " system version - Show firmware version\n"); +} + +static int system_cmd_chip_info(void) +{ + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + + printf("Chip Information:\n"); + printf(" Model: %s\n", CONFIG_IDF_TARGET); + printf(" Cores: %d\n", chip_info.cores); + printf(" Revision: %d\n", chip_info.revision); + printf(" Features: %s%s%s%s\n", + (chip_info.features & CHIP_FEATURE_WIFI_BGN) ? "WiFi " : "", + (chip_info.features & CHIP_FEATURE_BT) ? "BT " : "", + (chip_info.features & CHIP_FEATURE_BLE) ? "BLE " : "", + (chip_info.features & CHIP_FEATURE_IEEE802154) ? "802.15.4 " : ""); + + uint32_t flash_size; + if (esp_flash_get_size(NULL, &flash_size) == ESP_OK) + { + printf(" Flash: %lu MB %s\n", + flash_size / (1024 * 1024), + (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "(embedded)" : "(external)"); + } + + return 0; +} + +static int system_cmd_uptime(void) +{ + int64_t uptime_us = esp_timer_get_time(); + int64_t uptime_s = uptime_us / 1000000; + + int days = uptime_s / 86400; + int hours = (uptime_s % 86400) / 3600; + int minutes = (uptime_s % 3600) / 60; + int seconds = uptime_s % 60; + + printf("Uptime: %d days, %02d:%02d:%02d\n", days, hours, minutes, seconds); + printf(" (%lld seconds)\n", uptime_s); + + return 0; +} + +static int system_cmd_tasks(void) +{ +#if (configUSE_TRACE_FACILITY == 1) + uint32_t task_count = uxTaskGetNumberOfTasks(); + TaskStatus_t *task_array = malloc(task_count * sizeof(TaskStatus_t)); + + if (task_array == NULL) + { + printf("Failed to allocate memory for task list\n"); + return 1; + } + + uint32_t total_runtime; + task_count = uxTaskGetSystemState(task_array, task_count, &total_runtime); + + printf("Tasks (%lu total):\n", task_count); + printf("%-16s %5s %6s %11s %8s", "Name", "State", "Core", "Priority", "Stack"); +#if (configGENERATE_RUN_TIME_STATS == 1) + printf(" %7s", "CPU%"); +#endif + printf("\n"); + printf("----------------------------------------------------------------\n"); + + for (uint32_t i = 0; i < task_count; i++) + { + const char *state_str; + switch (task_array[i].eCurrentState) + { + case eRunning: + state_str = "RUN "; + break; + case eReady: + state_str = "READY"; + break; + case eBlocked: + state_str = "BLOCK"; + break; + case eSuspended: + state_str = "SUSP "; + break; + case eDeleted: + state_str = "DEL "; + break; + default: + state_str = "? "; + break; + } + + uint32_t stack_remaining = task_array[i].usStackHighWaterMark; + + BaseType_t affinity = xTaskGetCoreID(task_array[i].xHandle); + + printf("%-16s %5s ", task_array[i].pcTaskName, state_str); + + if (affinity == tskNO_AFFINITY) + { + printf("%6s", "ANY"); + } + else + { + printf("%6d", (int)affinity); + } + + printf(" %11u %8lu", task_array[i].uxCurrentPriority, stack_remaining); + +#if (configGENERATE_RUN_TIME_STATS == 1) + float cpu_percent = 0.0; + if (total_runtime > 0) + { + cpu_percent = (100.0 * task_array[i].ulRunTimeCounter) / total_runtime; + } + printf(" %6.1f%%", cpu_percent); +#endif + printf("\n"); + } + + free(task_array); +#else + printf("Task listing not available (configUSE_TRACE_FACILITY not enabled)\n"); + printf("Enable in menuconfig: Component config -> FreeRTOS -> Kernel\n"); +#endif + return 0; +} + +static int system_cmd_reset_reason(void) +{ + esp_reset_reason_t reason = esp_reset_reason(); + + printf("Reset reason: "); + switch (reason) + { + case ESP_RST_UNKNOWN: + printf("Unknown\n"); + break; + case ESP_RST_POWERON: + printf("Power-on reset\n"); + break; + case ESP_RST_EXT: + printf("External pin reset\n"); + break; + case ESP_RST_SW: + printf("Software reset\n"); + break; + case ESP_RST_PANIC: + printf("Exception/panic\n"); + break; + case ESP_RST_INT_WDT: + printf("Interrupt watchdog\n"); + break; + case ESP_RST_TASK_WDT: + printf("Task watchdog\n"); + break; + case ESP_RST_WDT: + printf("Other watchdog\n"); + break; + case ESP_RST_DEEPSLEEP: + printf("Deep sleep reset\n"); + break; + case ESP_RST_BROWNOUT: + printf("Brownout reset\n"); + break; + case ESP_RST_SDIO: + printf("SDIO reset\n"); + break; + default: + printf("Code %d\n", reason); + break; + } + + return 0; +} + +static int system_cmd_ram(void) +{ + size_t free_heap = esp_get_free_heap_size(); + size_t min_free_heap = esp_get_minimum_free_heap_size(); + size_t largest_block = heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT); + + printf("Heap Memory:\n"); + printf(" Free: %u bytes (%.2f KB)\n", free_heap, free_heap / 1024.0); + printf(" Minimum free: %u bytes (%.2f KB)\n", min_free_heap, min_free_heap / 1024.0); + printf(" Largest free block: %u bytes (%.2f KB)\n", largest_block, largest_block / 1024.0); + + return 0; +} + +static int system_cmd_flash(void) +{ + uint32_t flash_size; + if (esp_flash_get_size(NULL, &flash_size) != ESP_OK) + { + printf("Failed to get flash size\n"); + return 1; + } + + printf("Flash Information:\n"); + printf(" Total size: %lu bytes (%.2f MB)\n", flash_size, flash_size / (1024.0 * 1024.0)); + + const esp_partition_t *running = esp_ota_get_running_partition(); + if (running) + { + printf(" Running partition: %s (offset 0x%lx, size %lu KB)\n", + running->label, running->address, running->size / 1024); + } + + return 0; +} + +static int system_cmd_partition(void) +{ + printf("Partition Table:\n"); + printf("%-16s %-10s %-10s %10s %10s\n", "Label", "Type", "SubType", "Offset", "Size"); + printf("------------------------------------------------------------------------\n"); + + esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL); + + while (it != NULL) + { + const esp_partition_t *part = esp_partition_get(it); + + const char *type_str = "?"; + if (part->type == ESP_PARTITION_TYPE_APP) + type_str = "app"; + else if (part->type == ESP_PARTITION_TYPE_DATA) + type_str = "data"; + + printf("%-16s %-10s 0x%-8x 0x%08lx %8lu KB\n", + part->label, + type_str, + part->subtype, + part->address, + part->size / 1024); + + it = esp_partition_next(it); + } + + esp_partition_iterator_release(it); + return 0; +} + +static int system_cmd_heap_caps(void) +{ + printf("Heap by Capability:\n"); + + size_t internal_free = heap_caps_get_free_size(MALLOC_CAP_INTERNAL); + size_t internal_total = heap_caps_get_total_size(MALLOC_CAP_INTERNAL); + printf(" Internal: %u / %u bytes free (%.1f%%)\n", + internal_free, internal_total, + internal_total > 0 ? 100.0 * internal_free / internal_total : 0); + + size_t spiram_free = heap_caps_get_free_size(MALLOC_CAP_SPIRAM); + size_t spiram_total = heap_caps_get_total_size(MALLOC_CAP_SPIRAM); + if (spiram_total > 0) + { + printf(" SPIRAM: %u / %u bytes free (%.1f%%)\n", + spiram_free, spiram_total, 100.0 * spiram_free / spiram_total); + } + + size_t dma_free = heap_caps_get_free_size(MALLOC_CAP_DMA); + size_t dma_total = heap_caps_get_total_size(MALLOC_CAP_DMA); + printf(" DMA capable: %u / %u bytes free (%.1f%%)\n", + dma_free, dma_total, + dma_total > 0 ? 100.0 * dma_free / dma_total : 0); + + size_t exec_free = heap_caps_get_free_size(MALLOC_CAP_EXEC); + size_t exec_total = heap_caps_get_total_size(MALLOC_CAP_EXEC); + printf(" Executable: %u / %u bytes free (%.1f%%)\n", + exec_free, exec_total, + exec_total > 0 ? 100.0 * exec_free / exec_total : 0); + + return 0; +} + +static int system_cmd_stats(void) +{ + printf("=== System Statistics ===\n\n"); + + system_cmd_uptime(); + printf("\n"); + system_cmd_ram(); + printf("\n"); + + uint32_t task_count = uxTaskGetNumberOfTasks(); + printf("Active tasks: %lu\n\n", task_count); + + system_cmd_reset_reason(); + + return 0; +} + +static int system_cmd_coredump(void) +{ + esp_core_dump_summary_t summary; + esp_err_t err = esp_core_dump_get_summary(&summary); + + if (err == ESP_ERR_NOT_FOUND) + { + printf("No coredump found in flash\n"); + return 0; + } + else if (err != ESP_OK) + { + printf("Failed to read coredump: %s\n", esp_err_to_name(err)); + return 1; + } + + printf("Coredump found:\n"); + printf(" Program counter: 0x%08lx\n", summary.exc_pc); + printf(" Exception cause: %lu\n", summary.ex_info.exc_cause); + printf(" Exception vaddr: 0x%08lx\n", summary.ex_info.exc_vaddr); + + return 0; +} + +static int system_cmd_mac(void) +{ + uint8_t mac[6]; + + printf("MAC Addresses:\n"); + + if (esp_read_mac(mac, ESP_MAC_WIFI_STA) == ESP_OK) + { + printf(" WiFi STA: %02x:%02x:%02x:%02x:%02x:%02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + } + + if (esp_read_mac(mac, ESP_MAC_WIFI_SOFTAP) == ESP_OK) + { + printf(" WiFi AP: %02x:%02x:%02x:%02x:%02x:%02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + } + + if (esp_read_mac(mac, ESP_MAC_BT) == ESP_OK) + { + printf(" BT: %02x:%02x:%02x:%02x:%02x:%02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + } + + if (esp_read_mac(mac, ESP_MAC_ETH) == ESP_OK) + { + printf(" Ethernet: %02x:%02x:%02x:%02x:%02x:%02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + } + + return 0; +} +typedef struct +{ + const char **hostname_out; + bool success; +} hostname_get_ctx_t; + +typedef struct +{ + const char *hostname_in; + esp_err_t result; +} hostname_set_ctx_t; + +static esp_err_t get_hostname_tcpip(void *ctx) +{ + hostname_get_ctx_t *context = (hostname_get_ctx_t *)ctx; + esp_netif_t *netif = esp_netif_next_unsafe(NULL); + + if (netif) + { + esp_netif_get_hostname(netif, context->hostname_out); + context->success = true; + } + else + { + context->success = false; + } + + return ESP_OK; +} + +static esp_err_t set_hostname_tcpip(void *ctx) +{ + hostname_set_ctx_t *context = (hostname_set_ctx_t *)ctx; + esp_netif_t *netif = esp_netif_next_unsafe(NULL); + + if (netif) + { + context->result = esp_netif_set_hostname(netif, context->hostname_in); + } + else + { + context->result = ESP_ERR_NOT_FOUND; + } + + return ESP_OK; +} + +static int system_cmd_hostname(int argc, char **argv) +{ + if (argc < 3) + { + const char *hostname = NULL; + hostname_get_ctx_t ctx = { + .hostname_out = &hostname, + .success = false}; + + esp_err_t err = esp_netif_tcpip_exec(get_hostname_tcpip, &ctx); + + if (err != ESP_OK) + { + printf("Failed to access network interface: %s\n", esp_err_to_name(err)); + return 1; + } + + if (ctx.success) + { + if (hostname) + { + printf("Hostname: %s\n", hostname); + } + else + { + printf("No hostname set\n"); + } + } + else + { + printf("No network interface available\n"); + } + return 0; + } + + hostname_set_ctx_t ctx = { + .hostname_in = argv[2], + .result = ESP_FAIL}; + + esp_err_t err = esp_netif_tcpip_exec(set_hostname_tcpip, &ctx); + + if (err != ESP_OK) + { + printf("Failed to access network interface: %s\n", esp_err_to_name(err)); + return 1; + } + + if (ctx.result == ESP_ERR_NOT_FOUND) + { + printf("No network interface available\n"); + } + else if (ctx.result == ESP_OK) + { + printf("Hostname set to: %s\n", argv[2]); + } + else + { + printf("Failed to set hostname: %s\n", esp_err_to_name(ctx.result)); + } + + return 0; +} + +static int system_cmd_version(void) +{ + const esp_app_desc_t *app_desc = esp_app_get_description(); + + printf("Firmware Information:\n"); + printf(" Version: %s\n", app_desc->version); + printf(" Project: %s\n", app_desc->project_name); + printf(" IDF version: %s\n", app_desc->idf_ver); + printf(" SystemK version: %s (%s)\n", SYSTEMK_VERSION_STRING, SYSTEMK_GIT_COMMIT_HASH_SHORT); + printf(" Git commit: %s\n", GIT_COMMIT_HASH_LONG); + printf(" Compile time: %s %s\n", app_desc->date, app_desc->time); + + return 0; +} + +static int system_cmd_factory_reset(void) +{ + printf("WARNING: This will erase all NVS data!\n"); + printf("Type 'yes' to confirm: "); + + char confirm[10]; + if (fgets(confirm, sizeof(confirm), stdin) == NULL) + { + printf("\nCancelled\n"); + return 0; + } + + // Remove newline + confirm[strcspn(confirm, "\n")] = 0; + + if (strcmp(confirm, "yes") != 0) + { + printf("Factory reset cancelled.\n"); + return 0; + } + + printf("Erasing NVS...\n"); + esp_err_t err = nvs_flash_erase(); + if (err != ESP_OK) + { + printf("Failed to erase NVS: %s\n", esp_err_to_name(err)); + return 1; + } + + printf("Factory reset complete. Rebooting...\n"); + vTaskDelay(pdMS_TO_TICKS(1000)); + esp_restart(); + + return 0; +} + +static int system_cmd_reboot(void) +{ + printf("Rebooting...\n"); + vTaskDelay(pdMS_TO_TICKS(100)); + esp_restart(); + return 0; +} + +static int cmd_system(int argc, char **argv) +{ + if (argc < 2) + { + print_usage(); + return 0; + } + + if (!strcmp(argv[1], "chip-info")) + return system_cmd_chip_info(); + if (!strcmp(argv[1], "coredump")) + return system_cmd_coredump(); + if (!strcmp(argv[1], "factory-reset")) + return system_cmd_factory_reset(); + if (!strcmp(argv[1], "flash")) + return system_cmd_flash(); + if (!strcmp(argv[1], "heap-caps")) + return system_cmd_heap_caps(); + if (!strcmp(argv[1], "hostname")) + return system_cmd_hostname(argc, argv); + if (!strcmp(argv[1], "mac")) + return system_cmd_mac(); + if (!strcmp(argv[1], "partition")) + return system_cmd_partition(); + if (!strcmp(argv[1], "RAM")) + return system_cmd_ram(); + if (!strcmp(argv[1], "reboot")) + return system_cmd_reboot(); + if (!strcmp(argv[1], "reset-reason")) + return system_cmd_reset_reason(); + if (!strcmp(argv[1], "stats")) + return system_cmd_stats(); + if (!strcmp(argv[1], "tasks")) + return system_cmd_tasks(); + if (!strcmp(argv[1], "uptime")) + return system_cmd_uptime(); + if (!strcmp(argv[1], "version")) + return system_cmd_version(); + + printf("Unknown command\n"); + print_usage(); + return 0; +} + +static void system_completion(const char *buf, linenoiseCompletions *lc) +{ + if (!strncmp(buf, "system", 6)) + { + linenoiseAddCompletion(lc, "system chip-info"); + linenoiseAddCompletion(lc, "system coredump"); + linenoiseAddCompletion(lc, "system factory-reset"); + linenoiseAddCompletion(lc, "system flash"); + linenoiseAddCompletion(lc, "system heap-caps"); + linenoiseAddCompletion(lc, "system hostname"); + linenoiseAddCompletion(lc, "system mac"); + linenoiseAddCompletion(lc, "system partition"); + linenoiseAddCompletion(lc, "system RAM"); + linenoiseAddCompletion(lc, "system reboot"); + linenoiseAddCompletion(lc, "system reset-reason"); + linenoiseAddCompletion(lc, "system stats"); + linenoiseAddCompletion(lc, "system tasks"); + linenoiseAddCompletion(lc, "system uptime"); + linenoiseAddCompletion(lc, "system version"); + } +} + +void Register_System_Command(void) +{ + linenoiseSetCompletionCallback(system_completion); + + const esp_console_cmd_t cmd = { + .command = "system", + .help = "System management and diagnostic commands", + .func = &cmd_system, + }; + + ESP_ERROR_CHECK(esp_console_cmd_register(&cmd)); +} \ No newline at end of file diff --git a/components/Serial_Console/Commands/System_Command.h b/components/Serial_Console/Commands/System_Command.h new file mode 100644 index 0000000..f34f331 --- /dev/null +++ b/components/Serial_Console/Commands/System_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_System_Command(void); \ No newline at end of file diff --git a/components/Serial_Console/Console.c b/components/Serial_Console/Console.c index af2a29e..80e59d5 100644 --- a/components/Serial_Console/Console.c +++ b/components/Serial_Console/Console.c @@ -22,10 +22,12 @@ #include "esp_console.h" #include +#include static void register_commands() { Register_Log_Command(); + Register_System_Command(); esp_console_register_help_command(); } diff --git a/components/Serial_Console/generate_git_versions.cmake b/components/Serial_Console/generate_git_versions.cmake new file mode 100644 index 0000000..b66f862 --- /dev/null +++ b/components/Serial_Console/generate_git_versions.cmake @@ -0,0 +1,72 @@ +# Main repository hashes +execute_process( + COMMAND git rev-parse --short HEAD + WORKING_DIRECTORY ${SOURCE_DIR} + OUTPUT_VARIABLE GIT_HASH_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +execute_process( + COMMAND git rev-parse HEAD + WORKING_DIRECTORY ${SOURCE_DIR} + OUTPUT_VARIABLE GIT_HASH_LONG + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Check for uncommitted changes in main repo +execute_process( + COMMAND git diff-index --quiet HEAD -- + WORKING_DIRECTORY ${SOURCE_DIR} + RESULT_VARIABLE GIT_DIRTY +) + +if(NOT GIT_DIRTY EQUAL 0) + set(GIT_HASH_SHORT "${GIT_HASH_SHORT}+") + set(GIT_HASH_LONG "${GIT_HASH_LONG}+") +endif() + +# SystemK hashes +set(SYSTEMK_PATH "${SOURCE_DIR}/components/SystemK") + +execute_process( + COMMAND git rev-parse --short HEAD + WORKING_DIRECTORY ${SYSTEMK_PATH} + OUTPUT_VARIABLE SYSTEMK_HASH_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE SYSTEMK_RESULT +) + +execute_process( + COMMAND git rev-parse HEAD + WORKING_DIRECTORY ${SYSTEMK_PATH} + OUTPUT_VARIABLE SYSTEMK_HASH_LONG + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Check for uncommitted changes in SystemK. +execute_process( + COMMAND git diff-index --quiet HEAD -- + WORKING_DIRECTORY ${SYSTEMK_PATH} + RESULT_VARIABLE SYSTEMK_DIRTY +) + +# Handle the case where SystemK doesn't exist or is not a git repo. +if(SYSTEMK_RESULT EQUAL 0) + if(NOT SYSTEMK_DIRTY EQUAL 0) + set(SYSTEMK_HASH_SHORT "${SYSTEMK_HASH_SHORT}+") + set(SYSTEMK_HASH_LONG "${SYSTEMK_HASH_LONG}+") + endif() +else() + set(SYSTEMK_HASH_SHORT "unknown") + set(SYSTEMK_HASH_LONG "unknown") +endif() + +file(WRITE ${OUTPUT_FILE} +"#ifndef GIT_VERSION_H +#define GIT_VERSION_H +#define GIT_COMMIT_HASH_SHORT \"${GIT_HASH_SHORT}\" +#define GIT_COMMIT_HASH_LONG \"${GIT_HASH_LONG}\" +#define SYSTEMK_GIT_COMMIT_HASH_SHORT \"${SYSTEMK_HASH_SHORT}\" +#define SYSTEMK_GIT_COMMIT_HASH_LONG \"${SYSTEMK_HASH_LONG}\" +#endif +") \ No newline at end of file diff --git a/main/HW_NeoPixels.c b/main/HW_NeoPixels.c index 6d4255e..2c0fde9 100644 --- a/main/HW_NeoPixels.c +++ b/main/HW_NeoPixels.c @@ -31,7 +31,7 @@ #include #include "HW_NeoPixels.h" -#define NEOPIXELS_STACK_SIZE (100 * 1024) +#define NEOPIXELS_STACK_SIZE (10 * 1024) #define NEOPIXELS_TASK_PRIORITY (tskIDLE_PRIORITY + 1) static StaticTask_t xTaskBuffer; StackType_t *xStack; diff --git a/sdkconfig b/sdkconfig index 1613bf3..9b2ab6c 100644 --- a/sdkconfig +++ b/sdkconfig @@ -441,11 +441,11 @@ CONFIG_BOOTLOADER_LOG_VERSION_1=y CONFIG_BOOTLOADER_LOG_VERSION=1 # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=3 +CONFIG_BOOTLOADER_LOG_LEVEL=2 # # Format @@ -1871,9 +1871,13 @@ CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096 CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 -# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y # CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set -# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID is not set +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_FREERTOS_RUN_TIME_COUNTER_TYPE_U32=y +# CONFIG_FREERTOS_RUN_TIME_COUNTER_TYPE_U64 is not set # CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set # end of Kernel @@ -1893,6 +1897,7 @@ CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER=y # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # end of Port @@ -1952,17 +1957,19 @@ 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 is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set -CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y -CONFIG_LOG_DEFAULT_LEVEL=5 -CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# 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 is not set +CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE=y CONFIG_LOG_MAXIMUM_LEVEL=5 # # Level Settings # -CONFIG_LOG_MASTER_LEVEL=y +# CONFIG_LOG_MASTER_LEVEL is not set 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 @@ -2728,11 +2735,11 @@ CONFIG_MDNS_PREDEF_NETIF_ETH=y # CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=3 +CONFIG_LOG_BOOTLOADER_LEVEL=2 # CONFIG_FLASH_ENCRYPTION_ENABLED is not set # CONFIG_FLASHMODE_QIO is not set # CONFIG_FLASHMODE_QOUT is not set