diff --git a/misc/Kconfig b/misc/Kconfig index e0acf06a75..0fa72a2bca 100644 --- a/misc/Kconfig +++ b/misc/Kconfig @@ -39,4 +39,5 @@ source "$PKGS_DIR/packages/misc/qparam/Kconfig" source "$PKGS_DIR/packages/misc/CorevMCU_CLI/Kconfig" source "$PKGS_DIR/packages/misc/get_irq_priority/Kconfig" source "$PKGS_DIR/packages/misc/drmp/Kconfig" +source "$PKGS_DIR/packages/misc/hsm/Kconfig" endmenu diff --git a/misc/hsm/Kconfig b/misc/hsm/Kconfig new file mode 100644 index 0000000000..ecc4b89de3 --- /dev/null +++ b/misc/hsm/Kconfig @@ -0,0 +1,46 @@ +menuconfig PKG_USING_HSM + bool "HSM: Hierarchical state machines for embedded systems" + default n + help + HSM is a minimal, event-driven hierarchical state machine framework designed for embedded systems. + It supports nested states, entry/exit actions, state transitions, and provides a simple C API for event handling. + +if PKG_USING_HSM + + config PKG_HSM_PATH + string + default "/packages/misc/hsm" + + config PKG_HSM_MAX_LEVEL + int "Maximum nesting level for state hierarchy" + range 5 20 + default 10 + help + The maximum nesting level supported for hierarchical states. + Increase this value for deeply nested state machines. + + config PKG_HSM_USING_EXAMPLE + bool "Enable HSM examples" + default n + help + Enable the HSM LED example code + + choice + prompt "Version" + default PKG_USING_HSM_LATEST_VERSION + help + Select the package version + + config PKG_USING_HSM_V100 + bool "v1.0.0" + + config PKG_USING_HSM_LATEST_VERSION + bool "latest" + endchoice + + config PKG_HSM_VER + string + default "v1.0.0" if PKG_USING_HSM_V100 + default "latest" if PKG_USING_HSM_LATEST_VERSION + +endif \ No newline at end of file diff --git a/misc/hsm/package.json b/misc/hsm/package.json new file mode 100644 index 0000000000..172fe06584 --- /dev/null +++ b/misc/hsm/package.json @@ -0,0 +1,37 @@ +{ + "name": "hsm", + "description": "Hierarchical state machines for designing event-driven systems", + "description_zh": "一种用于设计事件驱动系统的层次化状态机库", + "enable": "PKG_USING_HSM", + "keywords": [ + "hsm", + "state-machine", + "state", + "embedded" + ], + "category": "misc", + "author": { + "name": "Ye Zenghui", + "email": "y956370541@163.com", + "github": "https://github.com/Ye-Zenghui" + }, + "license": "MIT", + "repository": "https://github.com/Ye-Zenghui/hsm", + "icon": "unknown", + "homepage": "https://github.com/Ye-Zenghui/hsm#readme", + "doc": "https://github.com/Ye-Zenghui/hsm/blob/master/README.md", + "site": [ + { + "version": "latest", + "URL": "https://github.com/Ye-Zenghui/hsm.git", + "filename": "", + "VER_SHA": "master" + }, + { + "version": "v1.0.0", + "URL": "https://github.com/Ye-Zenghui/hsm/archive/v1.0.0.zip", + "filename": "hsm-1.0.0.zip", + "VER_SHA": "fill in latest version SHA" + } + ] +} \ No newline at end of file