From 99835099ef4a5a7f8dd122e77e5e733525b01fd9 Mon Sep 17 00:00:00 2001 From: Dhinesh Kumar Pitchai Date: Tue, 28 Feb 2023 17:10:10 +0530 Subject: [PATCH 1/2] fix #346: added support to Catena 4618 V2 --- README.md | 1 + src/CatenaBase.h | 2 +- src/Catena_Guids.h | 4 ++++ src/Catena_Platforms.h | 1 + .../catena461x/Catena4618_getPlatformTable.cpp | 14 ++++++++++++++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2d5de7..e180248 100644 --- a/README.md +++ b/README.md @@ -1448,6 +1448,7 @@ This sketch demonstrates the use of the Catena FSM class to implement the `Turns - HEAD includes the following changes + - fix [#346](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/346): add support to Catena4618 with LTR329 sensor (v0.22.0-pre6) - fix [#342](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/342): add support to Catena4610 version-2 (v0.22.0-pre5). - fix [#319](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/319): accomodate missing two-arg `UsbSerial::begin()` (v0.21.3-pre1). - fix [#321](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/321): add 24-bit float encoding support (v0.22.0-pre1). diff --git a/src/CatenaBase.h b/src/CatenaBase.h index 1415b69..83ed8a0 100644 --- a/src/CatenaBase.h +++ b/src/CatenaBase.h @@ -57,7 +57,7 @@ Copyright notice: (((major) << 24u) | ((minor) << 16u) | ((patch) << 8u) | (local)) #define CATENA_ARDUINO_PLATFORM_VERSION \ - CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 22, 0, 5) /* v0.22.0-pre5 */ + CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 22, 0, 6) /* v0.22.0-pre6 */ #define CATENA_ARDUINO_PLATFORM_VERSION_GET_MAJOR(v) \ (((v) >> 24u) & 0xFFu) diff --git a/src/Catena_Guids.h b/src/Catena_Guids.h index 1f5eae9..1e62b60 100644 --- a/src/Catena_Guids.h +++ b/src/Catena_Guids.h @@ -225,6 +225,10 @@ Copyright notice: #define GUID_HW_CATENA_4618_BASE(f) \ MCCIADK_GUID_GEN_INIT(f, 0xb75ed77b, 0xb06e, 0x4b26, 0xa9, 0x68, 0x9c, 0x15, 0xf2, 0x22, 0xdf, 0xb2) +// {5a3dbd81-0fd4-428a-93e6-5862b0b35130} +#define GUID_HW_CATENA_4618_V2_BASE(f) \ + MCCIADK_GUID_GEN_INIT(f, 0x5a3dbd81, 0x0fd4, 0x428a, 0x93, 0xe6, 0x58, 0x62, 0xb0, 0xb3, 0x51, 0x30) + // {17281c12-d78a-4e4f-9c42-c8bbc5499c91} #define GUID_HW_CATENA_4630_BASE(f) \ MCCIADK_GUID_GEN_INIT(f, 0x17281c12, 0xd78a, 0x4e4f, 0x9c, 0x42, 0xc8, 0xbb, 0xc5, 0x49, 0x9c, 0x91) diff --git a/src/Catena_Platforms.h b/src/Catena_Platforms.h index 19eda00..98b98f8 100644 --- a/src/Catena_Platforms.h +++ b/src/Catena_Platforms.h @@ -74,6 +74,7 @@ extern const CATENA_PLATFORM gkPlatformCatena4612_m103; extern const CATENA_PLATFORM gkPlatformCatena4612_m104; extern const CATENA_PLATFORM gkPlatformCatena4617; extern const CATENA_PLATFORM gkPlatformCatena4618; +extern const CATENA_PLATFORM gkPlatformCatena4618_v2; extern const CATENA_PLATFORM gkPlatformCatena4630; diff --git a/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp b/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp index 546218f..1a1bf9d 100644 --- a/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp +++ b/src/lib/stm32/catena461x/Catena4618_getPlatformTable.cpp @@ -45,10 +45,24 @@ const CATENA_PLATFORM gkPlatformCatena4618 = CatenaBase::fHasFlash }; +const CATENA_PLATFORM gkPlatformCatena4618_v2 = + { + Guid: GUID_HW_CATENA_4618_V2_BASE(WIRE), + pParent: &gkPlatformCatena4618, + PlatformFlags: + CatenaBase::fHasLoRa | + CatenaBase::fHasTtnNycLoRa | + CatenaBase::fHasSHT3x | + CatenaBase::fHasLuxLtr329 | + CatenaBase::fHasFRAM | + CatenaBase::fHasFlash + }; + const CATENA_PLATFORM (* const Catena4618::vPlatforms[]) = { // entry 0 is the default &gkPlatformCatena4618, + &gkPlatformCatena4618_v2, }; const size_t Catena4618::nvPlatforms = sizeof(Catena4618::vPlatforms) / sizeof(Catena4618::vPlatforms[0]); From 7c71f2181b2c572bcc9ce47086603a7bd9caef85 Mon Sep 17 00:00:00 2001 From: Dhinesh Kumar Pitchai Date: Wed, 24 May 2023 20:10:18 +0530 Subject: [PATCH 2/2] fix #346: added support for Catena 4612 V2 --- README.md | 2 +- src/CatenaBase.h | 2 +- src/Catena_Guids.h | 6 +++++- src/Catena_Platforms.h | 1 + .../catena461x/Catena4612_getPlatformTable.cpp | 14 ++++++++++++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e180248..b745023 100644 --- a/README.md +++ b/README.md @@ -1448,7 +1448,7 @@ This sketch demonstrates the use of the Catena FSM class to implement the `Turns - HEAD includes the following changes - - fix [#346](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/346): add support to Catena4618 with LTR329 sensor (v0.22.0-pre6) + - fix [#346](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/346): add support to Catena4618 and Catena 4612 with LTR329 sensor (v0.22.0-pre7) - fix [#342](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/342): add support to Catena4610 version-2 (v0.22.0-pre5). - fix [#319](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/319): accomodate missing two-arg `UsbSerial::begin()` (v0.21.3-pre1). - fix [#321](https://github.com/mcci-catena/Catena-Arduino-Platform/issues/321): add 24-bit float encoding support (v0.22.0-pre1). diff --git a/src/CatenaBase.h b/src/CatenaBase.h index 83ed8a0..58759e7 100644 --- a/src/CatenaBase.h +++ b/src/CatenaBase.h @@ -57,7 +57,7 @@ Copyright notice: (((major) << 24u) | ((minor) << 16u) | ((patch) << 8u) | (local)) #define CATENA_ARDUINO_PLATFORM_VERSION \ - CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 22, 0, 6) /* v0.22.0-pre6 */ + CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 22, 0, 7) /* v0.22.0-pre7 */ #define CATENA_ARDUINO_PLATFORM_VERSION_GET_MAJOR(v) \ (((v) >> 24u) & 0xFFu) diff --git a/src/Catena_Guids.h b/src/Catena_Guids.h index 1e62b60..1194277 100644 --- a/src/Catena_Guids.h +++ b/src/Catena_Guids.h @@ -217,6 +217,10 @@ Copyright notice: #define GUID_HW_CATENA_4612_M104(f) \ MCCIADK_GUID_GEN_INIT(f, 0xdea48489, 0xcdac, 0x43f4, 0xb8, 0xad, 0xed, 0xb0, 0x8c, 0xe2, 0x15, 0x46) +// {4330325d-4be8-410a-9b55-0fda4fbd1977} +#define GUID_HW_CATENA_4612_V2_BASE(f) \ + MCCIADK_GUID_GEN_INIT(f, 0x4330325d, 0x4be8, 0x410a, 0x9b, 0x55, 0x0f, 0xda, 0x4f, 0xbd, 0x19, 0x77) + // {6767c2f6-d5d5-43f4-81af-db0d4d08815a} #define GUID_HW_CATENA_4617_BASE(f) \ MCCIADK_GUID_GEN_INIT(f, 0x6767c2f6, 0xd5d5, 0x43f4, 0x81, 0xaf, 0xdb, 0x0d, 0x4d, 0x08, 0x81, 0x5a) @@ -226,7 +230,7 @@ Copyright notice: MCCIADK_GUID_GEN_INIT(f, 0xb75ed77b, 0xb06e, 0x4b26, 0xa9, 0x68, 0x9c, 0x15, 0xf2, 0x22, 0xdf, 0xb2) // {5a3dbd81-0fd4-428a-93e6-5862b0b35130} -#define GUID_HW_CATENA_4618_V2_BASE(f) \ +#define GUID_HW_CATENA_4618_V2_BASE(f) \ MCCIADK_GUID_GEN_INIT(f, 0x5a3dbd81, 0x0fd4, 0x428a, 0x93, 0xe6, 0x58, 0x62, 0xb0, 0xb3, 0x51, 0x30) // {17281c12-d78a-4e4f-9c42-c8bbc5499c91} diff --git a/src/Catena_Platforms.h b/src/Catena_Platforms.h index 98b98f8..2dcf244 100644 --- a/src/Catena_Platforms.h +++ b/src/Catena_Platforms.h @@ -72,6 +72,7 @@ extern const CATENA_PLATFORM gkPlatformCatena4612_m101; extern const CATENA_PLATFORM gkPlatformCatena4612_m102; extern const CATENA_PLATFORM gkPlatformCatena4612_m103; extern const CATENA_PLATFORM gkPlatformCatena4612_m104; +extern const CATENA_PLATFORM gkPlatformCatena4612_v2; extern const CATENA_PLATFORM gkPlatformCatena4617; extern const CATENA_PLATFORM gkPlatformCatena4618; extern const CATENA_PLATFORM gkPlatformCatena4618_v2; diff --git a/src/lib/stm32/catena461x/Catena4612_getPlatformTable.cpp b/src/lib/stm32/catena461x/Catena4612_getPlatformTable.cpp index 230a0bd..c56edef 100644 --- a/src/lib/stm32/catena461x/Catena4612_getPlatformTable.cpp +++ b/src/lib/stm32/catena461x/Catena4612_getPlatformTable.cpp @@ -114,6 +114,19 @@ const CATENA_PLATFORM gkPlatformCatena4612_m104 = CatenaBase::fM104 }; +const CATENA_PLATFORM gkPlatformCatena4612_v2 = + { + Guid: GUID_HW_CATENA_4612_V2_BASE(WIRE), + pParent: &gkPlatformCatena4612, + PlatformFlags: + CatenaBase::fHasLoRa | + CatenaBase::fHasTtnNycLoRa | + CatenaBase::fHasBme280 | + CatenaBase::fHasLuxLtr329 | + CatenaBase::fHasFRAM | + CatenaBase::fHasFlash + }; + const CATENA_PLATFORM (* const Catena4612::vPlatforms[]) = { // entry 0 is the default @@ -122,6 +135,7 @@ const CATENA_PLATFORM (* const Catena4612::vPlatforms[]) = &gkPlatformCatena4612_m102, &gkPlatformCatena4612_m103, &gkPlatformCatena4612_m104, + &gkPlatformCatena4612_v2, }; const size_t Catena4612::nvPlatforms = sizeof(Catena4612::vPlatforms) / sizeof(Catena4612::vPlatforms[0]);