diff --git a/src/posix/main.c b/src/posix/main.c index 8b58923c4..818787ecc 100644 --- a/src/posix/main.c +++ b/src/posix/main.c @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) otDiagInit(sInstance); #endif - while (!otSysPseudoResetWasRequested()) + while (true) { otTaskletsProcess(sInstance); otSysProcessDrivers(sInstance); diff --git a/src/posix/platform/misc.c b/src/posix/platform/misc.c index 86e36a150..61f5f0c3b 100644 --- a/src/posix/platform/misc.c +++ b/src/posix/platform/misc.c @@ -38,26 +38,17 @@ extern jmp_buf gResetJump; -static otPlatResetReason sPlatResetReason = OT_PLAT_RESET_REASON_POWER_ON; -bool gPlatformPseudoResetWasRequested; +static otPlatResetReason sPlatResetReason = OT_PLAT_RESET_REASON_POWER_ON; static otPlatMcuPowerState gPlatMcuPowerState = OT_PLAT_MCU_POWER_STATE_ON; void otPlatReset(otInstance *aInstance) { -#if OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - gPlatformPseudoResetWasRequested = true; - sPlatResetReason = OT_PLAT_RESET_REASON_SOFTWARE; - -#else // elif OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - otSysDeinit(); platformUartRestore(); longjmp(gResetJump, 1); assert(false); -#endif // else OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - (void)aInstance; } diff --git a/src/posix/platform/openthread-system.h b/src/posix/platform/openthread-system.h index de8b2d13b..2ad2e88ae 100644 --- a/src/posix/platform/openthread-system.h +++ b/src/posix/platform/openthread-system.h @@ -62,17 +62,6 @@ void otSysInit(int argc, char *argv[]); */ void otSysDeinit(void); -/** - * This function returns true if a pseudo-reset was requested. - * - * In such a case, the main loop should shut down and re-initialize the OpenThread instance. - * - * @note This function is not called by the OpenThread library. Instead, the system/RTOS should call this function - * in the main loop to determine when to shut down and re-initialize the OpenThread instance. - * - */ -bool otSysPseudoResetWasRequested(void); - /** * This function performs all platform-specific processing for OpenThread's example applications. * diff --git a/src/posix/platform/system.c b/src/posix/platform/system.c index fe80ac5fe..f572d7071 100644 --- a/src/posix/platform/system.c +++ b/src/posix/platform/system.c @@ -49,8 +49,6 @@ uint64_t gNodeId = 0; -extern bool gPlatformPseudoResetWasRequested; - static void PrintUsage(const char *aProgramName, FILE *aStream, int aExitCode) { fprintf(aStream, @@ -71,12 +69,6 @@ void otSysInit(int aArgCount, char *aArgVector[]) const char *radioFile = NULL; const char *radioConfig = ""; - if (gPlatformPseudoResetWasRequested) - { - gPlatformPseudoResetWasRequested = false; - return; - } - while (true) { int option; @@ -150,11 +142,6 @@ void otSysInit(int aArgCount, char *aArgVector[]) } } -bool otSysPseudoResetWasRequested(void) -{ - return gPlatformPseudoResetWasRequested; -} - void otSysDeinit(void) { #if OPENTHREAD_POSIX_VIRTUAL_TIME