FAILしない限り繰り返し吸い出すように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@362 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-07-07 02:33:18 +00:00
parent 497edc847f
commit 9c6fde0460
2 changed files with 35 additions and 2 deletions

View File

@ -13,6 +13,8 @@
$Rev$ $Rev$
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
#include <nn/ns.h>
#include "Controller.h" #include "Controller.h"
#include "FileChecker.h" #include "FileChecker.h"
#include "Exporter.h" #include "Exporter.h"
@ -37,7 +39,8 @@ typedef enum BackupState
DELETE_NIM, // nimのシステムセーブデータ削除 DELETE_NIM, // nimのシステムセーブデータ削除
DONE, // 吸出し完了 DONE, // 吸出し完了
FINISHED, // SDカード抜き完了 FINISHED, // SDカード抜き完了
FAIL // 失敗 FAIL, // 失敗
REBOOTING // 再起動
} BackupState; } BackupState;
@ -143,7 +146,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
} }
} }
if (nextStep && !error) if (!error)
{ {
COMMON_LOGGER("Start Export Data\n"); COMMON_LOGGER("Start Export Data\n");
@ -312,6 +315,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
common::PlaySound(common::SOUND_CURSOR); common::PlaySound(common::SOUND_CURSOR);
s_PlayedSdPullOutCursor = true; s_PlayedSdPullOutCursor = true;
} }
s_BackupState = REBOOTING;
} }
break; break;
@ -339,6 +344,33 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
} }
break; break;
case REBOOTING:
{
static bool init = true;
if (init)
{
// ErrDispから引用
nn::Result result = nn::ns::CTR::InitializeForShell();
if (result.IsSuccess())
{
COMMON_LOGGER("System Reboot.\n");
nn::ns::CTR::HardwareResetAsync(nn::CTR::MEMORY_ARRANGE_NORMAL);
while (!nn::applet::IsExpectedToCloseApplication())
{
nn::os::Thread::Sleep(nn::fnd::TimeSpan::FromMilliSeconds(5));
}
nn::ns::CTR::FinalizeForShell();
// INFO: リブートは非同期のため処理は継続
}
init = false;
}
}
break;
} }
} }

View File

@ -61,6 +61,7 @@ LIBS += libnn_cfg \
libnn_friends \ libnn_friends \
libnn_nim \ libnn_nim \
libnn_am \ libnn_am \
libnn_ns \
INSTALL_SDK_TOOL = true INSTALL_SDK_TOOL = true