summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 4f425b6..e4c9719 100644
--- a/main.cpp
+++ b/main.cpp
@@ -562,6 +562,20 @@ int main() {
usb.write(1, (uint32_t*)&report, sizeof(report));
+ uint32_t ps_state = (1 << 5) | (1 << 6) | (1 << 7);
+ ps_state |= buttons & (1 << 0) ? 1 << 12 : 0; // B1
+ ps_state |= buttons & (1 << 1) ? 1 << 13 : 0; // B2
+ ps_state |= buttons & (1 << 2) ? 1 << 11 : 0; // B3
+ ps_state |= buttons & (1 << 3) ? 1 << 14 : 0; // B4
+ ps_state |= buttons & (1 << 4) ? 1 << 10 : 0; // B5
+ ps_state |= buttons & (1 << 5) ? 1 << 15 : 0; // B6
+ ps_state |= buttons & (1 << 6) ? 1 << 9 : 0; // B7
+ ps_state |= buttons & (1 << 6) ? 1 << 4 : 0; // B8
+ ps_state |= buttons & (1 << 6) ? 1 << 8 : 0; // B9
+ ps_state |= buttons & (1 << 10) ? 1 << 0 : 0; // select
+ ps_state |= buttons & (1 << 9) ? 1 << 3 : 0; // start
+
+ /*
uint32_t ps_state = 0;
ps_state |= buttons & (1 << 0) ? 1 << 15 : 0; // B1
ps_state |= buttons & (1 << 1) ? 1 << 10 : 0; // B2
@@ -572,6 +586,7 @@ int main() {
ps_state |= buttons & (1 << 6) ? 1 << 7 : 0; // B7
ps_state |= buttons & (1 << 10) ? 1 << 0 : 0; // select
ps_state |= buttons & (1 << 9) ? 1 << 3 : 0; // start
+ */
spi_ps.set_state(ps_state);
}