Skip to content

Commit

Permalink
[Telink] Retention memory optimization (#31293)
Browse files Browse the repository at this point in the history
* [Telink] Move mFactoryDataBuffer out of retention memory

* [Telink] Enable factory data by default for tests

* [Telink] Add NFC for commissioning comment

* Revert "[Telink] Enable factory data by default for tests"

This reverts commit 59c87a9.

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 26, 2024
1 parent 3119b06 commit 6acfc67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/lighting-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
# Disable CHIP shell support
CONFIG_CHIP_LIB_SHELL=n

# Disable CHIP NFC for commissioning
CONFIG_CHIP_NFC_COMMISSIONING=n

# Disable factory data support
Expand Down
3 changes: 2 additions & 1 deletion src/platform/telink/FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
namespace chip {
namespace DeviceLayer {

__attribute__((section(".bss"))) static uint8_t mFactoryDataBuffer[FIXED_PARTITION_SIZE(factory_partition)];

struct InternalFlashFactoryData
{
CHIP_ERROR GetFactoryDataPartition(uint8_t *& data, size_t & dataSize)
Expand Down Expand Up @@ -63,7 +65,6 @@ struct ExternalFlashFactoryData
CHIP_ERROR ProtectFactoryDataPartitionAgainstWrite() { return CHIP_ERROR_NOT_IMPLEMENTED; }

const struct device * mFlashDevice = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller));
uint8_t mFactoryDataBuffer[FIXED_PARTITION_SIZE(factory_partition)];
};

template <class FlashFactoryData>
Expand Down

0 comments on commit 6acfc67

Please sign in to comment.