diff --git a/hardware/arduino/sam/cores/sam/USB/CDC.cpp b/hardware/arduino/sam/cores/sam/USB/CDC.cpp index bee073d2d..8992a2e63 100644 --- a/hardware/arduino/sam/cores/sam/USB/CDC.cpp +++ b/hardware/arduino/sam/cores/sam/USB/CDC.cpp @@ -51,9 +51,7 @@ static volatile LineInfo _usbLineInfo = { 57600, 0x00, 0x00, 0x00, 0x00 }; _Pragma("pack(1)") static const CDCDescriptor _cdcInterface = { -#ifdef HID_ENABLED D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,1), -#endif // CDC communication interface D_INTERFACE(CDC_ACM_INTERFACE,1,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,0), diff --git a/hardware/arduino/sam/cores/sam/USB/USBCore.h b/hardware/arduino/sam/cores/sam/USB/USBCore.h index c21398f77..68b18ff65 100644 --- a/hardware/arduino/sam/cores/sam/USB/USBCore.h +++ b/hardware/arduino/sam/cores/sam/USB/USBCore.h @@ -234,10 +234,8 @@ typedef struct typedef struct { -#ifdef HID_ENABLED // IAD IADDescriptor iad; // Only needed on compound device -#endif // Control InterfaceDescriptor cif; // diff --git a/hardware/arduino/sam/cores/sam/libsam_sam3x8e_gcc_dbg.a b/hardware/arduino/sam/cores/sam/libsam_sam3x8e_gcc_dbg.a index 49dec1323..e59285c72 100644 Binary files a/hardware/arduino/sam/cores/sam/libsam_sam3x8e_gcc_dbg.a and b/hardware/arduino/sam/cores/sam/libsam_sam3x8e_gcc_dbg.a differ diff --git a/hardware/arduino/sam/cores/sam/validation_usb_device/test_usb_device.cpp b/hardware/arduino/sam/cores/sam/validation_usb_device/test_usb_device.cpp index 4e32153a4..6df7ee14c 100644 --- a/hardware/arduino/sam/cores/sam/validation_usb_device/test_usb_device.cpp +++ b/hardware/arduino/sam/cores/sam/validation_usb_device/test_usb_device.cpp @@ -29,62 +29,20 @@ const int mouseButton = 6; int range = 5; // output range of X or Y movement; affects movement speed int responseDelay = 10; // response delay of the mouse, in ms +/* +void setup() { + Mouse.begin(); +} -//void setup() { - // initialize the buttons' inputs: - /* pinMode(upButton, INPUT); - pinMode(downButton, INPUT); - pinMode(leftButton, INPUT); - pinMode(rightButton, INPUT); - pinMode(mouseButton, INPUT);*/ - // initialize mouse control: - // Mouse.begin(); -//} - -//void loop() { - // read the buttons: - /* int upState = digitalRead(upButton); - int downState = digitalRead(downButton); - int rightState = digitalRead(rightButton); - int leftState = digitalRead(leftButton); - int clickState = digitalRead(mouseButton); - - // calculate the movement distance based on the button states: - int xDistance = (leftState - rightState)*range; - int yDistance = (upState - downState)*range; - - // if X or Y is non-zero, move: - if ((xDistance != 0) || (yDistance != 0)) { - Mouse.move(xDistance, yDistance, 0); - } - - // if the mouse button is pressed: - if (clickState == HIGH) { - // if the mouse is not pressed, press it: - if (!Mouse.isPressed(MOUSE_LEFT)) { - Mouse.press(MOUSE_LEFT); - } - } - // else the mouse button is not pressed: - else { - // if the mouse is pressed, release it: - if (Mouse.isPressed(MOUSE_LEFT)) { - Mouse.release(MOUSE_LEFT); - } - }*/ -/*Mouse.move(10, 0, 0); - // a delay so the mouse doesn't move too fast: - delay(1000); -}*/ +void loop() { + Mouse.move(10, 0, 0); + delay(1000); +} +*/ - -//#include "USBAPI.h" - - - -// Cet exemple fonctionne !!! ;-) -/*void setup() { +/* +void setup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: //pinMode(13, OUTPUT); @@ -98,34 +56,21 @@ void loop() { //digitalWrite(13, LOW); // set the LED off delay(1000); // wait for a second printf("loop...\r\n"); -}*/ - +} +*/ void setup() { - // open the serial port: -Serial.begin(57600); - // initialize control over the keyboard: -// Keyboard.begin(); + Serial.begin(57600); } void loop() { - // check for incoming serial data: - //if (Serial.available() > 0) { - // read incoming serial data: - //char inChar = Serial.read(); - // Type the next ASCII value from what you received: - // Keyboard.write(inChar+1); - //Serial.print("toto\r\n"); - // check for incoming serial data: - if (Serial.available() > 0) { - // read incoming serial data: + if (Serial.available() > 0) + { char inChar = Serial.read(); - // Type the next ASCII value from what you received: Serial.print(inChar); Serial1.print(inChar); } delay(10); } - diff --git a/hardware/arduino/sam/system/libsam/source/uotghs.c b/hardware/arduino/sam/system/libsam/source/uotghs.c index 276a69015..10d1c9505 100644 --- a/hardware/arduino/sam/system/libsam/source/uotghs.c +++ b/hardware/arduino/sam/system/libsam/source/uotghs.c @@ -75,8 +75,8 @@ uint32_t UDD_Init(void) otg_unfreeze_clock(); // Check USB clock - while (!Is_otg_clock_usable()) - ; + //while (!Is_otg_clock_usable()) + // ; udd_low_speed_disable(); udd_high_speed_disable(); diff --git a/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a b/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a index f090389d0..ab3148aeb 100644 Binary files a/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a and b/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a differ