Skip to content

Commit

Permalink
(wip) changes to pull back into gsdk
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnotran committed Nov 22, 2023
1 parent eeed38d commit 7c5e09e
Show file tree
Hide file tree
Showing 31 changed files with 904 additions and 743 deletions.
4 changes: 2 additions & 2 deletions src/gsdk-pal/alarm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -32,9 +32,9 @@
*
*/

#include "openthread-system.h"
#include <assert.h>
#include <openthread-core-config.h>
#include <openthread-system.h>
#include <stdbool.h>
#include <stdint.h>
#include <openthread/platform/alarm-micro.h>
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/board_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/crypto.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/diag.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/entropy.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/flash.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/ieee802154-packet-utils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/ieee802154-packet-utils.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/ieee802154mac.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/gsdk-pal/iostream_uart.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -37,7 +37,7 @@
#include "sl_component_catalog.h"
#endif // SL_COMPONENT_CATALOG_PRESENT

#include "openthread-system.h"
#include <openthread-system.h>
#include <stddef.h>
#include <string.h>
#include "utils/code_utils.h"
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/logging.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/memory.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
36 changes: 31 additions & 5 deletions src/gsdk-pal/misc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -80,9 +80,13 @@ otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
{
reason = OT_PLAT_RESET_REASON_FAULT;
}
else if ((sResetCause & EMU_RSTCAUSE_AVDDBOD) || (sResetCause & EMU_RSTCAUSE_DECBOD)
|| (sResetCause & EMU_RSTCAUSE_DVDDBOD) || (sResetCause & EMU_RSTCAUSE_DVDDLEBOD)
/* clang-format off */
else if ((sResetCause & EMU_RSTCAUSE_AVDDBOD)
|| (sResetCause & EMU_RSTCAUSE_DECBOD)
|| (sResetCause & EMU_RSTCAUSE_DVDDBOD)
|| (sResetCause & EMU_RSTCAUSE_DVDDLEBOD)
|| (sResetCause & EMU_RSTCAUSE_EM4))
/* clang-format on */
{
reason = OT_PLAT_RESET_REASON_OTHER;
}
Expand All @@ -108,8 +112,12 @@ otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
{
reason = OT_PLAT_RESET_REASON_FAULT;
}
else if ((sResetCause & RMU_RSTCAUSE_AVDDBOD) || (sResetCause & RMU_RSTCAUSE_DECBOD)
|| (sResetCause & RMU_RSTCAUSE_DVDDBOD) || (sResetCause & RMU_RSTCAUSE_EM4RST))
/* clang-format off */
else if ((sResetCause & RMU_RSTCAUSE_AVDDBOD)
|| (sResetCause & RMU_RSTCAUSE_DECBOD)
|| (sResetCause & RMU_RSTCAUSE_DVDDBOD)
|| (sResetCause & RMU_RSTCAUSE_EM4RST))
/* clang-format on */
{
reason = OT_PLAT_RESET_REASON_OTHER;
}
Expand Down Expand Up @@ -143,3 +151,21 @@ OT_TOOL_WEAK void efr32UartProcess(void)
{
// do nothing
}

otError railStatusToOtError(RAIL_Status_t status)
{
switch (status)
{
case RAIL_STATUS_NO_ERROR:
return OT_ERROR_NONE;
case RAIL_STATUS_INVALID_PARAMETER:
return OT_ERROR_INVALID_ARGS;
case RAIL_STATUS_INVALID_STATE:
return OT_ERROR_INVALID_STATE;
case RAIL_STATUS_INVALID_CALL:
case RAIL_STATUS_SUSPENDED:
case RAIL_STATUS_SCHED_ERROR:
default:
return OT_ERROR_FAILED;
}
}
3 changes: 2 additions & 1 deletion src/gsdk-pal/openthread-core-efr32-config-check.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -29,6 +29,7 @@
#ifndef OPENTHREAD_CORE_EFR32_CONFIG_CHECK_H_
#define OPENTHREAD_CORE_EFR32_CONFIG_CHECK_H_

#include "board_config.h"
#ifndef RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
#if OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT
#error "Platform not configured to support configuration option: OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT"
Expand Down
8 changes: 6 additions & 2 deletions src/gsdk-pal/openthread-core-efr32-config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -55,7 +55,7 @@
#endif

#include "board_config.h"
#include "em_msc.h"
#include "em_device.h"

/**
* @def OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE
Expand Down Expand Up @@ -414,8 +414,12 @@
*
*/
#ifndef OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
#if OPENTHREAD_RADIO
#define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 0
#else
#define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 1
#endif
#endif

/**
* @def OPENTHREAD_CONFIG_CRYPTO_LIB
Expand Down
2 changes: 1 addition & 1 deletion src/gsdk-pal/platform-band.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 3 additions & 1 deletion src/gsdk-pal/platform-efr32.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* Copyright (c) 2023, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -178,4 +178,6 @@ RAIL_Status_t efr32RadioSetCcaMode(uint8_t aMode);

bool efr32AllowSleepCallback(void);

otError railStatusToOtError(RAIL_Status_t status);

#endif // PLATFORM_EFR32_H_
Loading

0 comments on commit 7c5e09e

Please sign in to comment.