Browse Source

Document hat mapping for back-paddle dpad codes

copilot-swe-agent[bot] 4 months ago
parent
commit
419a080fbb
1 changed files with 1 additions and 0 deletions
  1. 1 0
      OpenPuck/mode_switch_hori.cpp

+ 1 - 0
OpenPuck/mode_switch_hori.cpp

@@ -28,6 +28,7 @@ static uint16_t codeToSwitch(uint8_t c, uint16_t fA,uint16_t fB,uint16_t fX,uint
     case 5:return 0x10; case 6:return 0x20; case 7:return 0x400; case 8:return 0x800;
     case 5:return 0x10; case 6:return 0x20; case 7:return 0x400; case 8:return 0x800;
     case 9:return 0x100; case 10:return 0x200; case 11:return 0x1000; default:return 0; }
     case 9:return 0x100; case 10:return 0x200; case 11:return 0x1000; default:return 0; }
 }
 }
+// Back-paddle code 12..15 map to D-pad Up/Down/Left/Right; fold them into the hat direction flags.
 static inline void backCodeToHatDirs(uint8_t c, bool& u, bool& d, bool& l, bool& r){
 static inline void backCodeToHatDirs(uint8_t c, bool& u, bool& d, bool& l, bool& r){
   if(c==12) u=true;
   if(c==12) u=true;
   else if(c==13) d=true;
   else if(c==13) d=true;