From 248eb499f74df0bf0be39812e3f55c05d58c7b21 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Fri, 27 Feb 2015 02:20:03 +0100 Subject: popn --- main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); } -- cgit v1.2.3