Skip to content

Commit

Permalink
[K32W0] Check module type (#12162)
Browse files Browse the repository at this point in the history
Make sure that the application runs on K32W061 (Thread + BLE).

Signed-off-by: Doru Gucea <[email protected]>
  • Loading branch information
doru91 authored and pull[bot] committed Jan 27, 2022
1 parent 3e6174b commit 8aa01b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include <openthread/platform/entropy.h>

#include "K32W061.h"

namespace chip {
namespace DeviceLayer {

Expand All @@ -59,6 +61,15 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
// Initialize the configuration system.
err = Internal::K32WConfig::Init();
SuccessOrExit(err);

if (Chip_GetType() != CHIP_K32W061)
{
err = CHIP_ERROR_INTERNAL;
ChipLogError(DeviceLayer, "Invalid chip type, expected K32W061");

goto exit;
}

SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());

Expand Down

0 comments on commit 8aa01b5

Please sign in to comment.