|
|
@ -27,8 +27,8 @@ extern u8 _usbSuspendState;
|
|
|
|
|
|
|
|
|
|
|
|
namespace kaleidoscope {
|
|
|
|
namespace kaleidoscope {
|
|
|
|
|
|
|
|
|
|
|
|
bool MyOldFriend::wasSuspended = false;
|
|
|
|
bool MyOldFriend::was_suspended_ = false;
|
|
|
|
bool MyOldFriend::initialSuspend = true;
|
|
|
|
bool MyOldFriend::initial_suspend_ = true;
|
|
|
|
|
|
|
|
|
|
|
|
void MyOldFriend::begin(void) {
|
|
|
|
void MyOldFriend::begin(void) {
|
|
|
|
Kaleidoscope.useLoopHook(loopHook);
|
|
|
|
Kaleidoscope.useLoopHook(loopHook);
|
|
|
@ -57,19 +57,19 @@ void MyOldFriend::loopHook(bool post_clear) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if ((_usbSuspendState & (1 << SUSPI))) {
|
|
|
|
if ((_usbSuspendState & (1 << SUSPI))) {
|
|
|
|
if (!initialSuspend) {
|
|
|
|
if (!initial_suspend_) {
|
|
|
|
if (!wasSuspended) {
|
|
|
|
if (!was_suspended_) {
|
|
|
|
wasSuspended = true;
|
|
|
|
was_suspended_ = true;
|
|
|
|
myOldFriendEventHandler(Suspend);
|
|
|
|
myOldFriendEventHandler(Suspend);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
myOldFriendEventHandler(Sleep);
|
|
|
|
myOldFriendEventHandler(Sleep);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (initialSuspend)
|
|
|
|
if (initial_suspend_)
|
|
|
|
initialSuspend = false;
|
|
|
|
initial_suspend_ = false;
|
|
|
|
if (wasSuspended) {
|
|
|
|
if (was_suspended_) {
|
|
|
|
wasSuspended = false;
|
|
|
|
was_suspended_ = false;
|
|
|
|
myOldFriendEventHandler(Resume);
|
|
|
|
myOldFriendEventHandler(Resume);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|