[posix-app] remove pseudo reset (#3190)

This commit is contained in:
Yakun Xu
2018-10-22 22:22:16 -07:00
committed by Jonathan Hui
parent ad610d8db8
commit 45567f515f
4 changed files with 2 additions and 35 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
otDiagInit(sInstance);
#endif
while (!otSysPseudoResetWasRequested())
while (true)
{
otTaskletsProcess(sInstance);
otSysProcessDrivers(sInstance);
+1 -10
View File
@@ -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;
}
-11
View File
@@ -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.
*
-13
View File
@@ -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