File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313using namespace CHERI ;
1414
15- #define GPIO_VALUE (0x00000FF0 )
15+ #define GPIO_VALUE (0x000000FF )
1616
1717/* *
1818 * C++ entry point for the loader. This is called from assembly, with the
@@ -49,10 +49,9 @@ extern "C" uint32_t entry_point(void *rwRoot) {
4949 while (true ) {
5050 gpioValue ^= GPIO_VALUE;
5151 for (int i = 0 ; i < 2000000 ; i++) {
52- inputValue = *((volatile uint32_t *)gpi);
53- // Shift right to remove joystick, mask to only get 8 switches and shift left to skip LCD controls.
54- switchValue = ((inputValue >> 5 ) & 0xFF ) << 4 ;
55- joystickValue = (inputValue & 0x1F ) << 4 ;
52+ inputValue = *((volatile uint32_t *)gpi);
53+ switchValue = inputValue & 0xFF ;
54+ joystickValue = (inputValue >> 8 ) & 0x1F ;
5655 *((volatile uint32_t *)gpo) = (gpioValue ^ switchValue ^ joystickValue) & GPIO_VALUE;
5756 }
5857 }
You can’t perform that action at this time.
0 commit comments