mirror of
https://github.com/espressif/openthread.git
synced 2026-08-15 07:07:46 +00:00
[posix-app] remove pseudo reset (#3190)
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
||||
otDiagInit(sInstance);
|
||||
#endif
|
||||
|
||||
while (!otSysPseudoResetWasRequested())
|
||||
while (true)
|
||||
{
|
||||
otTaskletsProcess(sInstance);
|
||||
otSysProcessDrivers(sInstance);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user