Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement led flashing on connection
- Loading branch information
Showing
6 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"string": "c", | ||
"string_view": "c", | ||
"ios": "c", | ||
"ftp.h": "c" | ||
"ftp.h": "c", | ||
"util.h": "c" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <string.h> | ||
#include <switch.h> | ||
|
||
#include "console.h" | ||
#include "util.h" | ||
|
||
void flash_led_connect() | ||
{ | ||
HidsysNotificationLedPattern pattern; | ||
memset(&pattern, 0, sizeof(pattern)); | ||
|
||
pattern.baseMiniCycleDuration = 0x2; | ||
pattern.totalMiniCycles = 0x2; | ||
pattern.totalFullCycles = 0x1; | ||
pattern.startIntensity = 0x0; | ||
|
||
pattern.miniCycles[0].ledIntensity = 0xF; | ||
pattern.miniCycles[0].transitionSteps = 0xF; | ||
pattern.miniCycles[0].finalStepDuration = 0x0; | ||
pattern.miniCycles[1].ledIntensity = 0x0; | ||
pattern.miniCycles[1].transitionSteps = 0xF; | ||
pattern.miniCycles[1].finalStepDuration = 0x0; | ||
|
||
u64 uniquePadIds[2]; | ||
memset(uniquePadIds, 0, sizeof(uniquePadIds)); | ||
|
||
size_t total_entries = 0; | ||
|
||
Result rc = hidsysGetUniquePadsFromNpad(hidGetHandheldMode() ? CONTROLLER_HANDHELD : CONTROLLER_PLAYER_1, uniquePadIds, 2, &total_entries); | ||
if (R_FAILED(rc)) | ||
fatalLater(rc); | ||
|
||
for (int i = 0; i < total_entries; i++) | ||
hidsysSetNotificationLedPattern(&pattern, uniquePadIds[i]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void flash_led_connect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters