Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example works with Uno but not with Arduino ZERO=M0 or DUE=M3 #19

Open
dsyleixa opened this issue Apr 4, 2019 · 7 comments
Open

Example works with Uno but not with Arduino ZERO=M0 or DUE=M3 #19

dsyleixa opened this issue Apr 4, 2019 · 7 comments

Comments

@dsyleixa
Copy link

dsyleixa commented Apr 4, 2019

the lib seems to be bugged or outdated for ARM CORTEX Boards (M0=Zero, M3=Due and/or different ones like Adafruit M4):
your example code:


#include <PS2X_lib.h>  //for v1.6

/******************************************************************
 * set pins connected to PS2 controller:
 *   - 1e column: original 
 *   - 2e colmun: Stef?
 * replace pin numbers by the ones you use
 ******************************************************************/
#define PS2_DAT        13  //14    
#define PS2_CMD        11  //15
#define PS2_SEL        10  //16
#define PS2_CLK        12  //17

/******************************************************************
 * select modes of PS2 controller:
 *   - pressures = analog reading of push-butttons 
 *   - rumble    = motor rumbling
 * uncomment 1 of the lines for each mode selection
 ******************************************************************/
//#define pressures   true
#define pressures   false
//#define rumble      true
#define rumble      false

PS2X ps2x; // create PS2 Controller Class

//right now, the library does NOT support hot pluggable controllers, meaning 
//you must always either restart your Arduino after you connect the controller, 
//or call config_gamepad(pins) again after connecting the controller.

int error = 0;
byte type = 0;
byte vibrate = 0;

void setup(){
 
  Serial.begin(57600);
  
  delay(300);  //added delay to give wireless ps2 module some time to startup, before configuring it
   
  //CHANGES for v1.6 HERE!!! **************PAY ATTENTION*************
  
  //setup pins and settings: GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
  error = ps2x.config_gamepad(PS2_CLK, PS2_CMD, PS2_SEL, PS2_DAT, pressures, rumble);
  
  if(error == 0){
    Serial.print("Found Controller, configured successful ");
    Serial.print("pressures = ");
	if (pressures)
	  Serial.println("true ");
	else
	  Serial.println("false");
	Serial.print("rumble = ");
	if (rumble)
	  Serial.println("true)");
	else
	  Serial.println("false");
    Serial.println("Try out all the buttons, X will vibrate the controller, faster as you press harder;");
    Serial.println("holding L1 or R1 will print out the analog stick values.");
    Serial.println("Note: Go to www.billporter.info for updates and to report bugs.");
  }  
  else if(error == 1)
    Serial.println("No controller found, check wiring, see readme.txt to enable debug. visit www.billporter.info for troubleshooting tips");
   
  else if(error == 2)
    Serial.println("Controller found but not accepting commands. see readme.txt to enable debug. Visit www.billporter.info for troubleshooting tips");

  else if(error == 3)
    Serial.println("Controller refusing to enter Pressures mode, may not support it. ");
  
//  Serial.print(ps2x.Analog(1), HEX);
  
  type = ps2x.readType(); 
  switch(type) {
    case 0:
      Serial.print("Unknown Controller type found ");
      break;
    case 1:
      Serial.print("DualShock Controller found ");
      break;
    case 2:
      Serial.print("GuitarHero Controller found ");
      break;
	case 3:
      Serial.print("Wireless Sony DualShock Controller found ");
      break;
   }
}

void loop() {
  /* You must Read Gamepad to get new values and set vibration values
     ps2x.read_gamepad(small motor on/off, larger motor strenght from 0-255)
     if you don't enable the rumble, use ps2x.read_gamepad(); with no values
     You should call this at least once a second
   */  
  if(error == 1) //skip loop if no controller found
    return; 
  
  if(type == 2){ //Guitar Hero Controller
    ps2x.read_gamepad();          //read controller 
   
    if(ps2x.ButtonPressed(GREEN_FRET))
      Serial.println("Green Fret Pressed");
    if(ps2x.ButtonPressed(RED_FRET))
      Serial.println("Red Fret Pressed");
    if(ps2x.ButtonPressed(YELLOW_FRET))
      Serial.println("Yellow Fret Pressed");
    if(ps2x.ButtonPressed(BLUE_FRET))
      Serial.println("Blue Fret Pressed");
    if(ps2x.ButtonPressed(ORANGE_FRET))
      Serial.println("Orange Fret Pressed"); 

    if(ps2x.ButtonPressed(STAR_POWER))
      Serial.println("Star Power Command");
    
    if(ps2x.Button(UP_STRUM))          //will be TRUE as long as button is pressed
      Serial.println("Up Strum");
    if(ps2x.Button(DOWN_STRUM))
      Serial.println("DOWN Strum");
 
    if(ps2x.Button(PSB_START))         //will be TRUE as long as button is pressed
      Serial.println("Start is being held");
    if(ps2x.Button(PSB_SELECT))
      Serial.println("Select is being held");
    
    if(ps2x.Button(ORANGE_FRET)) {     // print stick value IF TRUE
      Serial.print("Wammy Bar Position:");
      Serial.println(ps2x.Analog(WHAMMY_BAR), DEC); 
    } 
  }
  else { //DualShock Controller
    ps2x.read_gamepad(false, vibrate); //read controller and set large motor to spin at 'vibrate' speed
    
    if(ps2x.Button(PSB_START))         //will be TRUE as long as button is pressed
      Serial.println("Start is being held");
    if(ps2x.Button(PSB_SELECT))
      Serial.println("Select is being held");      

    if(ps2x.Button(PSB_PAD_UP)) {      //will be TRUE as long as button is pressed
      Serial.print("Up held this hard: ");
      Serial.println(ps2x.Analog(PSAB_PAD_UP), DEC);
    }
    if(ps2x.Button(PSB_PAD_RIGHT)){
      Serial.print("Right held this hard: ");
      Serial.println(ps2x.Analog(PSAB_PAD_RIGHT), DEC);
    }
    if(ps2x.Button(PSB_PAD_LEFT)){
      Serial.print("LEFT held this hard: ");
      Serial.println(ps2x.Analog(PSAB_PAD_LEFT), DEC);
    }
    if(ps2x.Button(PSB_PAD_DOWN)){
      Serial.print("DOWN held this hard: ");
      Serial.println(ps2x.Analog(PSAB_PAD_DOWN), DEC);
    }   

    vibrate = ps2x.Analog(PSAB_CROSS);  //this will set the large motor vibrate speed based on how hard you press the blue (X) button
    if (ps2x.NewButtonState()) {        //will be TRUE if any button changes state (on to off, or off to on)
      if(ps2x.Button(PSB_L3))
        Serial.println("L3 pressed");
      if(ps2x.Button(PSB_R3))
        Serial.println("R3 pressed");
      if(ps2x.Button(PSB_L2))
        Serial.println("L2 pressed");
      if(ps2x.Button(PSB_R2))
        Serial.println("R2 pressed");
      if(ps2x.Button(PSB_TRIANGLE))
        Serial.println("Triangle pressed");        
    }

    if(ps2x.ButtonPressed(PSB_CIRCLE))               //will be TRUE if button was JUST pressed
      Serial.println("Circle just pressed");
    if(ps2x.NewButtonState(PSB_CROSS))               //will be TRUE if button was JUST pressed OR released
      Serial.println("X just changed");
    if(ps2x.ButtonReleased(PSB_SQUARE))              //will be TRUE if button was JUST released
      Serial.println("Square just released");     

    if(ps2x.Button(PSB_L1) || ps2x.Button(PSB_R1)) { //print stick values if either is TRUE
      Serial.print("Stick Values:");
      Serial.print(ps2x.Analog(PSS_LY), DEC); //Left stick, Y axis. Other options: LX, RY, RX  
      Serial.print(",");
      Serial.print(ps2x.Analog(PSS_LX), DEC); 
      Serial.print(",");
      Serial.print(ps2x.Analog(PSS_RY), DEC); 
      Serial.print(",");
      Serial.println(ps2x.Analog(PSS_RX), DEC); 
    }     
  }
  delay(50);  
}

Compilation for target Board Arduino DUE (Programming Port):

compile errors:

Arduino: 1.8.8 (Windows 7), Board: "Arduino Due (Programming Port)"

D:\arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\arduino\portable\sketchbook\libraries -fqbn=arduino:sam:arduino_due_x_dbg -vid-pid=0X239A_0X8022 -ide-version=10808 -build-path C:\Users\hw\AppData\Local\Temp\arduino_build_721665 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -verbose D:\arduino\portable\sketchbook\libraries\PS2X_lib\examples\PS2X_Example\PS2X_Example.ino
D:\arduino\arduino-builder -compile -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\arduino\portable\sketchbook\libraries -fqbn=arduino:sam:arduino_due_x_dbg -vid-pid=0X239A_0X8022 -ide-version=10808 -build-path C:\Users\hw\AppData\Local\Temp\arduino_build_721665 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -verbose D:\arduino\portable\sketchbook\libraries\PS2X_lib\examples\PS2X_Example\PS2X_Example.ino
Using board 'arduino_due_x_dbg' from platform in folder: D:\arduino\portable\packages\arduino\hardware\sam\1.6.11
Using core 'arduino' from platform in folder: D:\arduino\portable\packages\arduino\hardware\sam\1.6.11

Detecting libraries used...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10808 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\variants\\arduino_due_x" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_721665\\sketch\\PS2X_Example.ino.cpp" -o nul
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10808 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_721665\\sketch\\PS2X_Example.ino.cpp" -o nul
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10808 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.11\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "D:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib\\PS2X_lib.cpp" -o nul
D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:5:20: fatal error: avr/io.h: No such file or directory

 #include <avr/io.h>

                    ^

compilation terminated.

Bibliothek PS2X_lib im Ordner: D:\arduino\portable\sketchbook\libraries\PS2X_lib (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Arduino Due (Programming Port).

would you please kindly fix that?

@dsyleixa dsyleixa changed the title Example works with Uno but not with DUE Example works with Uno but not with ZERO/M0 or DUE Apr 4, 2019
@dsyleixa dsyleixa changed the title Example works with Uno but not with ZERO/M0 or DUE Example works with Uno but not with Arduino ZERO=M0 or DUE=M3 Apr 4, 2019
@dsyleixa
Copy link
Author

is this Repo no longer maintained?

@dsyleixa
Copy link
Author

dsyleixa commented May 31, 2020

no hope that someone will re-write this lib to work also with SAM or SAMD?

@dsyleixa
Copy link
Author

errors for SAMD51:

Arduino: 1.8.9 (Windows 7), Board: "Adafruit Feather M4 Express (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

D:\arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\arduino\portable\sketchbook\libraries -fqbn=adafruit:samd:adafruit_feather_m4:cache=on,speed=120,opt=small,maxqspi=50,usbstack=arduino,debug=off -ide-version=10809 -build-path C:\Users\hw\AppData\Local\Temp\arduino_build_651464 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=D:\arduino\portable\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=D:\arduino\portable\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.openocd.path=D:\arduino\portable\packages\arduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.openocd-0.9.0-arduino.path=D:\arduino\portable\packages\arduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.CMSIS.path=D:\arduino\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=D:\arduino\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=D:\arduino\portable\packages\arduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0.path=D:\arduino\portable\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -verbose D:\Arduino\portable\sketchbook\libraries\PS2X_lib\examples\PS2X_Example\PS2X_Example.ino
D:\arduino\arduino-builder -compile -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\arduino\portable\sketchbook\libraries -fqbn=adafruit:samd:adafruit_feather_m4:cache=on,speed=120,opt=small,maxqspi=50,usbstack=arduino,debug=off -ide-version=10809 -build-path C:\Users\hw\AppData\Local\Temp\arduino_build_651464 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=D:\arduino\portable\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=D:\arduino\portable\packages\arduino\tools\CMSIS-Atmel\1.2.0 -prefs=runtime.tools.openocd.path=D:\arduino\portable\packages\arduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.openocd-0.9.0-arduino.path=D:\arduino\portable\packages\arduino\tools\openocd\0.9.0-arduino -prefs=runtime.tools.CMSIS.path=D:\arduino\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=D:\arduino\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=D:\arduino\portable\packages\arduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.bossac-1.7.0.path=D:\arduino\portable\packages\arduino\tools\bossac\1.7.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -verbose D:\Arduino\portable\sketchbook\libraries\PS2X_lib\examples\PS2X_Example\PS2X_Example.ino
Using board 'adafruit_feather_m4' from platform in folder: D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8
Using core 'arduino' from platform in folder: D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8
Detecting libraries used...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"PS2X_Example.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=120000000L -DARDUINO=10809 -DARDUINO_FEATHER_M4 -DARDUINO_ARCH_SAMD -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DENABLE_CACHE -Os -DVARIANT_QSPI_BAUD_DEFAULT=50000000 -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\variants\\feather_m4" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o nul
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"PS2X_Example.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=120000000L -DARDUINO=10809 -DARDUINO_FEATHER_M4 -DARDUINO_ARCH_SAMD -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DENABLE_CACHE -Os -DVARIANT_QSPI_BAUD_DEFAULT=50000000 -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\variants\\feather_m4" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o nul
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"PS2X_Example.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=120000000L -DARDUINO=10809 -DARDUINO_FEATHER_M4 -DARDUINO_ARCH_SAMD -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DENABLE_CACHE -Os -DVARIANT_QSPI_BAUD_DEFAULT=50000000 -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\variants\\feather_m4" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "D:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib\\PS2X_lib.cpp" -o nul
Generating function prototypes...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"PS2X_Example.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=120000000L -DARDUINO=10809 -DARDUINO_FEATHER_M4 -DARDUINO_ARCH_SAMD -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DENABLE_CACHE -Os -DVARIANT_QSPI_BAUD_DEFAULT=50000000 -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\variants\\feather_m4" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"D:\\arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD "-D__SKETCH_NAME__=\"\"\"PS2X_Example.ino\"\"\"" -DF_CPU=120000000L -DARDUINO=10809 -DARDUINO_FEATHER_M4 -DARDUINO_ARCH_SAMD -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DENABLE_CACHE -Os -DVARIANT_QSPI_BAUD_DEFAULT=50000000 -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\variants\\feather_m4" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp.o"
Compiling libraries...
Compiling library "PS2X_lib"
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD "-D__SKETCH_NAME__=\"\"\"PS2X_Example.ino\"\"\"" -DF_CPU=120000000L -DARDUINO=10809 -DARDUINO_FEATHER_M4 -DARDUINO_ARCH_SAMD -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DENABLE_CACHE -Os -DVARIANT_QSPI_BAUD_DEFAULT=50000000 -D__SAMD51J19A__ -DADAFRUIT_FEATHER_M4_EXPRESS -D__SAMD51__ -DUSB_VID=0x239A -DUSB_PID=0x8022 -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit LLC\"" "-DUSB_PRODUCT=\"Adafruit Feather M4\"" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\adafruit\\hardware\\samd\\1.5.8\\variants\\feather_m4" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "D:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib\\PS2X_lib.cpp" -o "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\libraries\\PS2X_lib\\PS2X_lib.cpp.o"
In file included from D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\cores\arduino/delay.h:24:0,

                 from D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\cores\arduino/Arduino.h:81,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.h:84,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:1:

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp: In member function 'byte PS2X::config_gamepad(uint8_t, uint8_t, uint8_t, uint8_t, bool, bool)':

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:66:38: error: invalid conversion from 'PortGroup*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

 #define digitalPinToPort(P)        ( &(PORT->Group[g_APinDescription[P].ulPort]) )

                                    ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:192:11: note: in expansion of macro 'digitalPinToPort'

   lport = digitalPinToPort(clk);

           ^~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:69:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:193:20: note: in expansion of macro 'portOutputRegister'

   _clk_lport_set = portOutputRegister(lport) + 2;

                    ^~~~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:69:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:194:20: note: in expansion of macro 'portOutputRegister'

   _clk_lport_clr = portOutputRegister(lport) + 1;

                    ^~~~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:66:38: error: invalid conversion from 'PortGroup*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

 #define digitalPinToPort(P)        ( &(PORT->Group[g_APinDescription[P].ulPort]) )

                                    ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:197:11: note: in expansion of macro 'digitalPinToPort'

   lport = digitalPinToPort(cmd);

           ^~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:69:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:198:20: note: in expansion of macro 'portOutputRegister'

   _cmd_lport_set = portOutputRegister(lport) + 2;

                    ^~~~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:69:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:199:20: note: in expansion of macro 'portOutputRegister'

   _cmd_lport_clr = portOutputRegister(lport) + 1;

                    ^~~~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:66:38: error: invalid conversion from 'PortGroup*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

 #define digitalPinToPort(P)        ( &(PORT->Group[g_APinDescription[P].ulPort]) )

                                    ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:202:11: note: in expansion of macro 'digitalPinToPort'

   lport = digitalPinToPort(att);

           ^~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:69:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:203:20: note: in expansion of macro 'portOutputRegister'

   _att_lport_set = portOutputRegister(lport) + 2;

                    ^~~~~~~~~~~~~~~~~~

D:\arduino\portable\packages\adafruit\hardware\samd\1.5.8\variants\feather_m4/variant.h:69:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:204:20: note: in expansion of macro 'portOutputRegister'

   _att_lport_clr = portOutputRegister(lport) + 1;

                    ^~~~~~~~~~~~~~~~~~

Mehrere Bibliotheken wurden für "PS2X_lib.h" gefunden
 Benutzt: D:\arduino\portable\sketchbook\libraries\PS2X_lib
 Nicht benutzt: D:\arduino\portable\sketchbook\libraries\PS2X_lib_Dexter
Bibliothek PS2X_lib im Ordner: D:\arduino\portable\sketchbook\libraries\PS2X_lib (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Adafruit Feather M4 Express (SAMD51).

@dsyleixa
Copy link
Author

dsyleixa commented May 31, 2020

errors for Arduino Due (SAM3X8E):

Arduino: 1.8.9 (Windows 7), Board: "Arduino Due (Programming Port)"

D:\arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\arduino\portable\sketchbook\libraries -fqbn=arduino:sam:arduino_due_x_dbg -ide-version=10809 -build-path C:\Users\hw\AppData\Local\Temp\arduino_build_651464 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -verbose D:\Arduino\portable\sketchbook\libraries\PS2X_lib\examples\PS2X_Example\PS2X_Example.ino
D:\arduino\arduino-builder -compile -logger=machine -hardware D:\arduino\hardware -hardware D:\arduino\portable\packages -tools D:\arduino\tools-builder -tools D:\arduino\hardware\tools\avr -tools D:\arduino\portable\packages -built-in-libraries D:\arduino\libraries -libraries D:\arduino\portable\sketchbook\libraries -fqbn=arduino:sam:arduino_due_x_dbg -ide-version=10809 -build-path C:\Users\hw\AppData\Local\Temp\arduino_build_651464 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=D:\arduino\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=D:\arduino\portable\packages\arduino\tools\bossac\1.6.1-arduino -verbose D:\Arduino\portable\sketchbook\libraries\PS2X_lib\examples\PS2X_Example\PS2X_Example.ino
Using board 'arduino_due_x_dbg' from platform in folder: D:\arduino\portable\packages\arduino\hardware\sam\1.6.12
Using core 'arduino' from platform in folder: D:\arduino\portable\packages\arduino\hardware\sam\1.6.12
Build-Optionen wurden verändert, alles wird neu kompiliert
Detecting libraries used...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10809 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\variants\\arduino_due_x" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o nul
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10809 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o nul
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10809 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "D:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib\\PS2X_lib.cpp" -o nul
Generating function prototypes...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10809 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"D:\\arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10809 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp" -o "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\sketch\\PS2X_Example.ino.cpp.o"
Compiling libraries...
Compiling library "PS2X_lib"
"D:\\arduino\\portable\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -mcpu=cortex-m3 -mthumb -DF_CPU=84000000L -DARDUINO=10809 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Due\"" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/libsam" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/CMSIS/Include/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\system/CMSIS/Device/ATMEL/" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\cores\\arduino" "-ID:\\arduino\\portable\\packages\\arduino\\hardware\\sam\\1.6.12\\variants\\arduino_due_x" "-ID:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib" "D:\\arduino\\portable\\sketchbook\\libraries\\PS2X_lib\\PS2X_lib.cpp" -o "C:\\Users\\hw\\AppData\\Local\\Temp\\arduino_build_651464\\libraries\\PS2X_lib\\PS2X_lib.cpp.o"
D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp: In member function 'byte PS2X::config_gamepad(uint8_t, uint8_t, uint8_t, uint8_t, bool, bool)':

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:192:9: error: invalid conversion from 'Pio*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

   lport = digitalPinToPort(clk);

         ^

In file included from D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:201:0,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.h:84,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:1:

D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:193:20: note: in expansion of macro 'portOutputRegister'

   _clk_lport_set = portOutputRegister(lport) + 2;

                    ^

D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:194:20: note: in expansion of macro 'portOutputRegister'

   _clk_lport_clr = portOutputRegister(lport) + 1;

                    ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:197:9: error: invalid conversion from 'Pio*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

   lport = digitalPinToPort(cmd);

         ^

In file included from D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:201:0,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.h:84,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:1:

D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:198:20: note: in expansion of macro 'portOutputRegister'

   _cmd_lport_set = portOutputRegister(lport) + 2;

                    ^

D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:199:20: note: in expansion of macro 'portOutputRegister'

   _cmd_lport_clr = portOutputRegister(lport) + 1;

                    ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:202:9: error: invalid conversion from 'Pio*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

   lport = digitalPinToPort(att);

         ^

In file included from D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:201:0,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.h:84,

                 from D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:1:

D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:203:20: note: in expansion of macro 'portOutputRegister'

   _att_lport_set = portOutputRegister(lport) + 2;

                    ^

D:\arduino\portable\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )

                                            ^

D:\arduino\portable\sketchbook\libraries\PS2X_lib\PS2X_lib.cpp:204:20: note: in expansion of macro 'portOutputRegister'

   _att_lport_clr = portOutputRegister(lport) + 1;

                    ^

Mehrere Bibliotheken wurden für "PS2X_lib.h" gefunden
 Benutzt: D:\arduino\portable\sketchbook\libraries\PS2X_lib
 Nicht benutzt: D:\arduino\portable\sketchbook\libraries\PS2X_lib_Dexter
Bibliothek PS2X_lib im Ordner: D:\arduino\portable\sketchbook\libraries\PS2X_lib (legacy) wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Arduino Due (Programming Port).

@plainchan
Copy link

did you solved?

@dsyleixa
Copy link
Author

not solved yet.

@plainchan
Copy link

line190:
​  ​uint32_t​            lport;                   ​//
 Port number for this pin

revise:
 ​Pio*​            lport;                   ​//
 Port number for this pin

The example complied succeed,but serial print noticed that can't find controller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants