 
 uint8_t gameCubeReceiveReport(GameCubeData_t* data, uint8_t rumble) {
   if (fails >= maxFails) {
-    disableIRQ();
+    nvic_globalirq_disable();
     gameCubeSendBits(0b000000001l, 9);
-    enableIRQ();
+    nvic_globalirq_enable();
     delayMicroseconds(400);
     fails = 0;
   }              
-  disableIRQ();
+  nvic_globalirq_disable();
   gameCubeSendBits(rumble ? 0b0100000000000011000000011l : 0b0100000000000011000000001l, 25); 
   uint8_t success = gameCubeReceiveBits(data, 64);
-  enableIRQ();
+  nvic_globalirq_enable();
   if (success && 0 == (data->buttons & 0x80) && (data->buttons & 0x8000) ) {
     gpio_write_bit(ledPort, ledPin, 0);
     return 1;

  } while(bits);
}

void disableIRQ() {
  __asm volatile 
  (
      " CPSID   I        \n"
  );  
}

void enableIRQ() {
  __asm volatile 
  (
      " CPSIE   I        \n"
  );    
}

// bits must be greater than 0
uint8_t gameCubeReceiveBits(void* data0, uint32_t bits) {
  uint8_t* data = (uint8_t*)data0;

    Serial.println("c-stick = "+String(data.cX)+","+String(data.cY));  
    Serial.println("shoulders = "+String(data.shoulderLeft)+","+String(data.shoulderRight));      
#else 
    inject(injectors + injectionMode, &data);
#endif
  }
