[efr32] Added otSysEventSignalPending and NVIC configuration to efr32mg21 (#4279)

This commit is contained in:
Marven Gilhespie
2019-10-28 14:09:20 -07:00
committed by Jonathan Hui
parent 13f138284f
commit a718c4e170
5 changed files with 32 additions and 3 deletions
+2
View File
@@ -44,6 +44,8 @@ EFR32MG_SDK_SRCDIR = $(top_srcdir)/third_party/silabs
libopenthread_efr32mg21_a_CPPFLAGS = \
-DPLATFORM_HEADER=\"@top_builddir@/third_party/silabs/gecko_sdk_suite/v2.6/platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
-DEFR32_SERIES2_CONFIG1_MICRO \
-DNVIC_CONFIG=\"platform/base/hal/micro/cortexm3/efm32/nvic-config.h\" \
-Wno-sign-compare \
-DCORTEXM3 \
-DPHY=EMBER_PHY_RAIL \
+1
View File
@@ -68,6 +68,7 @@ static bool sIsRunning = false;
static void RAILCb_TimerExpired(RAIL_Handle_t aHandle)
{
otSysEventSignalPending();
}
void efr32AlarmInit(void)
+8
View File
@@ -34,6 +34,7 @@
#include <assert.h>
#include "openthread-system.h"
#include <openthread/config.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/diag.h>
@@ -718,6 +719,8 @@ static void processNextRxPacket(otInstance *aInstance)
}
}
otSysEventSignalPending();
exit:
if (packetHandle != RAIL_RX_PACKET_HANDLE_INVALID)
@@ -862,6 +865,8 @@ static void RAILCb_Generic(RAIL_Handle_t aRailHandle, RAIL_Events_t aEvents)
#endif
}
}
otSysEventSignalPending();
}
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
@@ -900,11 +905,14 @@ void efr32RadioProcess(otInstance *aInstance)
#if RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
sRailDebugCounters.mRailPlatRadioTxDoneCbCount++;
#endif
otSysEventSignalPending();
}
else if (sEnergyScanMode == ENERGY_SCAN_MODE_ASYNC && sEnergyScanStatus == ENERGY_SCAN_STATUS_COMPLETED)
{
sEnergyScanStatus = ENERGY_SCAN_STATUS_IDLE;
otPlatRadioEnergyScanDone(aInstance, sEnergyScanResultDbm);
otSysEventSignalPending();
#if RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
sRailDebugCounters.mRailEventEnergyScanCompleted++;
+18 -3
View File
@@ -34,7 +34,7 @@
#include <string.h>
#include <openthread/tasklet.h>
#include "openthread-system.h"
#include <openthread/platform/uart.h>
#include "common/logging.hpp"
@@ -71,10 +71,18 @@ void otSysInit(int argc, char *argv[])
OT_UNUSED_VARIABLE(argc);
OT_UNUSED_VARIABLE(argv);
__disable_irq();
#undef FIXED_EXCEPTION
#define FIXED_EXCEPTION(vectorNumber, functionName, deviceIrqn, deviceIrqHandler)
#define EXCEPTION(vectorNumber, functionName, deviceIrqn, deviceIrqHandler, priorityLevel, subpriority) \
NVIC_SetPriority(deviceIrqn, NVIC_EncodePriority(PRIGROUP_POSITION, priorityLevel, subpriority));
#include NVIC_CONFIG
#undef EXCEPTION
NVIC_SetPriorityGrouping(PRIGROUP_POSITION);
CHIP_Init();
halInitChipSpecific();
BSP_Init(BSP_INIT_BCC);
RTCDRV_Init();
@@ -83,6 +91,8 @@ void otSysInit(int argc, char *argv[])
wakeupFem();
#endif
__enable_irq();
#if USE_EFR32_LOG
efr32LogInit();
#endif
@@ -160,3 +170,8 @@ void otSysProcessDrivers(otInstance *aInstance)
efr32RadioProcess(aInstance);
efr32AlarmProcess(aInstance);
}
__WEAK void otSysEventSignalPending(void)
{
// Intentionally empty
}
+3
View File
@@ -34,6 +34,7 @@
#include <stddef.h>
#include "openthread-system.h"
#include <openthread/platform/uart.h>
#include "utils/code_utils.h"
@@ -106,11 +107,13 @@ static void receiveDone(UARTDRV_Handle_t aHandle, Ecode_t aStatus, uint8_t *aDat
}
UARTDRV_Receive(aHandle, aData, 1, receiveDone);
otSysEventSignalPending();
}
static void transmitDone(UARTDRV_Handle_t aHandle, Ecode_t aStatus, uint8_t *aData, UARTDRV_Count_t aCount)
{
sTransmitLength = 0;
otSysEventSignalPending();
}
static void processReceive(void)