From 1eccbd4c37a42c4c4386c98e9ca6b74564eb857f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=8D=A3=E6=96=87?= <1059451203@qq.com> Date: Thu, 9 Jan 2025 15:32:41 +0800 Subject: [PATCH 1/4] add libcrc --- misc/Kconfig | 1 + misc/libcrc/Kconfig | 111 +++++++++++++++++++++++++++++++++++++++ misc/libcrc/package.json | 35 ++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 misc/libcrc/Kconfig create mode 100644 misc/libcrc/package.json diff --git a/misc/Kconfig b/misc/Kconfig index 232672b308..b16276a553 100644 --- a/misc/Kconfig +++ b/misc/Kconfig @@ -26,6 +26,7 @@ source "$PKGS_DIR/packages/misc/vi/Kconfig" source "$PKGS_DIR/packages/misc/ki/Kconfig" source "$PKGS_DIR/packages/misc/armv7m_dwt/Kconfig" source "$PKGS_DIR/packages/misc/crclib/Kconfig" +source "$PKGS_DIR/packages/misc/libcrc/Kconfig" source "$PKGS_DIR/packages/misc/lwgps/Kconfig" source "$PKGS_DIR/packages/misc/state_machine/Kconfig" source "$PKGS_DIR/packages/misc/design_pattern/Kconfig" diff --git a/misc/libcrc/Kconfig b/misc/libcrc/Kconfig new file mode 100644 index 0000000000..8f8144f158 --- /dev/null +++ b/misc/libcrc/Kconfig @@ -0,0 +1,111 @@ + +# Kconfig file for package libcrc +menuconfig PKG_USING_LIBCRC + bool "libcrc:Multi platform MIT licensed CRC library in C." + default n + +if PKG_USING_LIBCRC + + config PKG_LIBCRC_PATH + string + default "/packages/misc/libcrc" + + choice + prompt "Version" + help + Select the package version + + config PKG_USING_LIBCRC_V100 + bool "v1.0.0" + + config PKG_USING_LIBCRC_LATEST_VERSION + bool "latest" + endchoice + + config PKG_LIBCRC_CRC8 + bool "crc8" + default n + + if PKG_LIBCRC_CRC8 + config LIBCRC_USING_CRC8 + bool "using 8 bit crc" + default n + endif + + config PKG_LIBCRC_CRC16 + bool "crc16" + default n + + if PKG_LIBCRC_CRC16 + config LIBCRC_USING_CRC16 + bool "using 16 bit crc" + default n + + config LIBCRC_USING_CRC_CCITT_1D0F + bool "using ccitt crc, 0x1D0F" + default n + + config LIBCRC_USING_CRC_CCITT_FFFF + bool "using ccitt crc, 0xFFFF" + default n + config LIBCRC_USING_CRC_DNP + bool "using dnp crc" + default n + + config LIBCRC_USING_CRC_KERMIT + bool "using kermit crc" + default n + + config LIBCRC_USING_CRC_MODBUS + bool "using modbus crc" + default n + + config LIBCRC_USING_CRC_SICK + bool "using sick crc" + default n + + config LIBCRC_USING_CRC_XMODEM + bool "using xmodem crc" + default n + endif + + config PKG_LIBCRC_CRC32 + bool "crc32" + default n + + if PKG_LIBCRC_CRC32 + config LIBCRC_USING_CRC32 + bool "using 32 bit crc" + default n + endif + + config PKG_LIBCRC_CRC64 + bool "crc64" + default n + + if PKG_LIBCRC_CRC64 + config LIBCRC_USING_CRC64_ECMA + bool "using 64 bit ecma crc" + default n + + config LIBCRC_USING_CRC64_WE + bool "using 64 bit we crc" + default n + endif + + config PKG_USING_CHECKSUM_NMEA + bool "using nmea checksum" + default n + + config PKG_USING_LIBCRC_SAMPLE + bool "using sample crc" + default n + + + config PKG_LIBCRC_VER + string + default "v1.0.0" if PKG_USING_LIBCRC_V100 + default "latest" if PKG_USING_LIBCRC_LATEST_VERSION + +endif + diff --git a/misc/libcrc/package.json b/misc/libcrc/package.json new file mode 100644 index 0000000000..306bcabbb8 --- /dev/null +++ b/misc/libcrc/package.json @@ -0,0 +1,35 @@ +{ + "name": "libcrc", + "description": "A crc verification calculation function library for porting libcrc.", + "description_zh": "一个移植libcrc的crc校验计算函数库。", + "enable": "PKG_USING_LIBCRC", + "keywords": [ + "libcrc", + "crc", + "rt-thread" + ], + "category": "misc", + "author": { + "name": "wangwang105", + "email": "1059451203@qq.com", + "github": "wangwang105" + }, + "license": "MIT", + "repository": "https://github.com/wangwang105/rtt-libcrc.git", + "icon": "https://www.rt-thread.org/qa/template/fxiaomi/style/image/logo.png", + "homepage": "https://github.com/wangwang105/rtt-libcrc.git#readme", + "doc": "unknown", + "site": [ + { + "version": "v1.0.0", + "URL": "https://libcrc-1.0.0.zip", + "filename": "libcrc-1.0.0.zip" + }, + { + "version": "latest", + "URL": "https://github.com/wangwang105/rtt-libcrc.git", + "filename": "rtt-libcrc-latest.zip", + "VER_SHA": "master" + } + ] +} From d4b834f10d0dca7c2a432e452b157db076d7ce96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=8D=A3=E6=96=87?= <1059451203@qq.com> Date: Thu, 9 Jan 2025 15:37:30 +0800 Subject: [PATCH 2/4] fix encode(utf-8) --- misc/libcrc/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/libcrc/package.json b/misc/libcrc/package.json index 306bcabbb8..89551f1de7 100644 --- a/misc/libcrc/package.json +++ b/misc/libcrc/package.json @@ -1,7 +1,7 @@ { "name": "libcrc", "description": "A crc verification calculation function library for porting libcrc.", - "description_zh": "一个移植libcrc的crc校验计算函数库。", + "description_zh": "涓涓Щ妞峫ibcrc鐨刢rc鏍¢獙璁$畻鍑芥暟搴撱", "enable": "PKG_USING_LIBCRC", "keywords": [ "libcrc", From d3467e0b1deea886f7260f69d26041ff8fdc5701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=8D=A3=E6=96=87?= <1059451203@qq.com> Date: Fri, 17 Jan 2025 11:50:03 +0800 Subject: [PATCH 3/4] modify libcrc URL --- misc/libcrc/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/libcrc/package.json b/misc/libcrc/package.json index 89551f1de7..b932a0fa3f 100644 --- a/misc/libcrc/package.json +++ b/misc/libcrc/package.json @@ -22,7 +22,7 @@ "site": [ { "version": "v1.0.0", - "URL": "https://libcrc-1.0.0.zip", + "URL": "https://github.com/wangwang105/rtt-libcrc/archive/refs/tags/v1.0.0.zip", "filename": "libcrc-1.0.0.zip" }, { From 066d76e6888a7fc65b2843de869f1fad1b223bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=8D=A3=E6=96=87?= <1059451203@qq.com> Date: Sat, 18 Jan 2025 08:07:18 +0800 Subject: [PATCH 4/4] modify libcrc package --- misc/libcrc/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/libcrc/package.json b/misc/libcrc/package.json index b932a0fa3f..5a68e2a194 100644 --- a/misc/libcrc/package.json +++ b/misc/libcrc/package.json @@ -29,7 +29,7 @@ "version": "latest", "URL": "https://github.com/wangwang105/rtt-libcrc.git", "filename": "rtt-libcrc-latest.zip", - "VER_SHA": "master" + "VER_SHA": "main" } ] }