common: Implement USB0 interrupt handler.
[gps-watch.git] / src / common / virtual_com.c
index 013e84fa51e80db473009d6d47de295cb54643d7..abf0a322e9b3625251b7d4e078c986ca217b81f8 100644 (file)
@@ -576,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;
 }
@@ -596,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
@@ -614,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. */
@@ -623,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;
         }
@@ -689,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);
+}