diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2015-02-27 02:20:03 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2015-02-27 02:20:03 +0100 |
commit | 248eb499f74df0bf0be39812e3f55c05d58c7b21 (patch) | |
tree | 83635d2479fc67dd7562713539c17fcba9b86116 /main.cpp | |
parent | e08277dd012d2ad77f9cee23bd14f31e1d5a3feb (diff) |
popn
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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); } |