The arguments passed to `Callback<void()>`'s constructor were the wrong way round,
thus preventing the `attach` function from being instantiated.
This patch corrects that by switching the order of the arguments.
Set correct SYSMPU register for proper USB operation. This bug was
introduced when the SYSMPU register names and defines were updated
in the commit:
"K64F: Updated the SYSMPU SDK driver"
93f8cfed05
Only clear the USB read buffer when endpointRead is called. This
allows data to be read with endpointReadResult without also allowing
USB to transfer more data. Instead additional data is transferred explicitly
with a call to endpointRead.
If a SETUP packet arrives shortly after an IN then the packets will be
processed in the wrong order - SETUP first then IN. This causes
the subsequent control transfer to fail. Fix this problem by processing
IN packets before processing SETUP packets.
Make the following improvements and fixes:
1.
Update the Kinetis USB driver so that endpointReadResult only reads the
result of the last read and does not trigger a new read. Instead
move the code to trigger new reads into endpointRead.
2.
Fix the race condition in controlIn caused by a call to
EP0read() followed immediately by EP0readStage(). This is done by
setting up to read the next setup packet (ignoring the status stage)
in endpointReadResult rather than in EP0readStage. This makes the
function EP0readStage unnecissary.
3.
Remove the Kinetis workaround in controlOut in USBDevice.cpp since
point 2 fixes this bug. For more info on this see the PR which
added this workaround - https://github.com/ARMmbed/mbed-os/pull/414
The ISTAT register is write 1 to clear. Because of this ORing this
register with itself fill clear all bits that are set. This patch
updates the code to use plain assignment so only desired
bit is cleared.
Attach callbacks with the assignment operator rather than with the
deprecated attach function. This fixes deprecation warnings.
This patch also adds the ability to attach a Callback directly.
The local static initialization in USB was causing multiple problems:
-Configurable descriptor values are set only once
-USB descriptor initialization causes a trap in debug builds since
this is acquiring a mutex in an interrupt handler
-Extra ram used since all descriptors are in RAM
This patch fixes these problems by making fixed descriptors
static const so they are stored in flash and never need to be
initialized and by making descriptors that do change a member
of the class so they are always initialized when requested
rather than once though lazy static local initialization.
Merged from the existing TARGET_DISCO_F413ZH code (which has the same MCU)
and TARGET_NUCLEO_F412ZG code (which has the same Nucleo-144 board and
pinout).
Move memory allocation to be done at a different location. Currently allocated
in a function that is called from the interrupt handler.
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
Minor change - List of key modifiers updated to include the
logo/GUI/windows key. Also added the options to specify the right hand
versions of the keys rather than just the left if for some reason
someone wants to do this.
Changes are limited to the keyboard header file and are backwards
compatible.
The new modifier values are in line with the table given on page 56 of
this document http://www.usb.org/developers/hidpage/HID1_11.pdf
1. added call to busReset() to KL25Z HAL; now the USB stack survives if you disconnect the cable, similar to LPC40 2. busReset callback to update terminal_connected in USBCDC 3. new bool USBSerial::connected() to read protected terminal_connected property, useful when you want to check if the terminal is ready from main app