Fixing issues with getConnectedDevice()

This commit is contained in:
Rodrigo Alfonso
2025-02-17 02:52:51 -03:00
parent 3645ca5d9f
commit 18f9afecce
2 changed files with 7 additions and 1 deletions

View File

@@ -229,6 +229,8 @@ int main() {
ERAPI_RenderFrame(1);
}
setGeneralPurposeMode();
// exit
return ERAPI_EXIT_TO_MENU;
}

View File

@@ -47,7 +47,11 @@ int main() {
std::string output = "LinkCard_demo (v8.0.0)\n\n";
output += "Device: ";
auto device = linkCard->getConnectedDevice([]() { return false; });
u32 initialVCount = REG_VCOUNT;
auto device = linkCard->getConnectedDevice([&initialVCount]() {
u32 elapsed = (REG_VCOUNT - initialVCount + 228) % 228;
return elapsed > 30;
});
switch (device) {
case LinkCard::ConnectedDevice::E_READER_JAP:
case LinkCard::ConnectedDevice::E_READER_USA: {