common: Implement USB0 interrupt handler.
[gps-watch.git] / src / common / virtual_com.c
index d9e507fbc617df4c2b330ffc3147826b5b7d21ac..abf0a322e9b3625251b7d4e078c986ca217b81f8 100644 (file)
@@ -32,8 +32,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "fsl_device_registers.h"
-#include "clock_config.h"
-#include "board.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -578,12 +576,10 @@ void USB_VcomWriteBlocking(usb_device_handle baseAddr, const uint8_t *buf, size_
 {
     while ((s_cdcVcom.attach != 1) || (s_cdcVcom.startTransactions != 1))
     {
-        __NOP();
     };
     USB_DeviceSendRequest((usb_device_handle)baseAddr, USB_CDC_VCOM_BULK_IN_ENDPOINT, (uint8_t *)buf, count);
     while (!s_sendComplete)
     {
-        __NOP();
     };
     s_sendComplete = 0;
 }
@@ -598,7 +594,6 @@ status_t USB_VcomReadBlocking(usb_device_handle baseAddr, uint8_t *buf, size_t c
     /* Waiting for the USB ready. */
     while ((s_cdcVcom.attach != 1) || (s_cdcVcom.startTransactions != 1))
     {
-        __NOP();
     };
 
     do
@@ -616,7 +611,6 @@ status_t USB_VcomReadBlocking(usb_device_handle baseAddr, uint8_t *buf, size_t c
         /* Waiting for data received by virtual com. */
         while (s_recvSize <= 0)
         {
-            __NOP();
         };
 
         /* When receive request is error. */
@@ -625,7 +619,6 @@ status_t USB_VcomReadBlocking(usb_device_handle baseAddr, uint8_t *buf, size_t c
             /* Waiting for the USB ready and transfer started. */
             while ((s_cdcVcom.attach != 1) || (s_cdcVcom.startTransactions != 1))
             {
-                __NOP();
             };
             s_recvSize = 0;
         }
@@ -691,3 +684,9 @@ void USB_VcomDeinit(usb_device_handle deviceHandle)
 /* enable USB IP clock,user code. */
 #endif /* USB_DEVICE_CONFIG_LPCIP3511HS */
 }
+
+void
+USB0_IRQHandler (void)
+{
+       USB_DeviceKhciIsrFunction (s_cdcVcom.deviceHandle);
+}