summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2015-02-27 02:20:03 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2015-02-27 02:20:03 +0100
commit248eb499f74df0bf0be39812e3f55c05d58c7b21 (patch)
tree83635d2479fc67dd7562713539c17fcba9b86116
parente08277dd012d2ad77f9cee23bd14f31e1d5a3feb (diff)
popn
-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);
}