@@ -14,7 +14,7 @@ __xdata uint8_t LineCoding[LINE_CODEING_SIZE]={0x00,0xe1,0x00,0x00,0x00,0x00,0x0
1414volatile __xdata uint8_t USBByteCountEP2 = 0 ; //Bytes of received data on USB endpoint
1515volatile __xdata uint8_t USBBufOutPointEP2 = 0 ; //Data pointer for fetching
1616
17- volatile __xdata uint8_t UpPoint2_Busy = 0 ; //Flag of whether upload pointer is busy
17+ volatile __bit UpPoint2BusyFlag = 0 ; //Flag of whether upload pointer is busy
1818volatile __xdata uint8_t controlLineState = 0 ;
1919
2020__xdata uint8_t usbWritePointer = 0 ;
@@ -24,7 +24,7 @@ void delayMicroseconds(uint16_t us);
2424void resetCDCParameters (){
2525
2626 USBByteCountEP2 = 0 ; //Bytes of received data on USB endpoint
27- UpPoint2_Busy = 0 ;
27+ UpPoint2BusyFlag = 0 ;
2828}
2929
3030void setLineCodingHandler (){
@@ -71,10 +71,10 @@ bool USBSerial(){
7171
7272
7373void USBSerial_flush (void ){
74- if (!UpPoint2_Busy && usbWritePointer > 0 ){
74+ if (!UpPoint2BusyFlag && usbWritePointer > 0 ){
7575 UEP2_T_LEN = usbWritePointer ;
7676 UEP2_CTRL = UEP2_CTRL & ~ MASK_UEP_T_RES | UEP_T_RES_ACK ; //Respond ACK
77- UpPoint2_Busy = 1 ;
77+ UpPoint2BusyFlag = 1 ;
7878 usbWritePointer = 0 ;
7979 }
8080}
@@ -84,7 +84,7 @@ uint8_t USBSerial_write(char c){ //3 bytes generic pointer
8484 if (controlLineState > 0 ) {
8585 while (true){
8686 waitWriteCount = 0 ;
87- while (UpPoint2_Busy ){//wait for 250ms or give up, on my mac it takes about 256us
87+ while (UpPoint2BusyFlag ){//wait for 250ms or give up, on my mac it takes about 256us
8888 waitWriteCount ++ ;
8989 delayMicroseconds (5 );
9090 if (waitWriteCount >=50000 ) return 0 ;
@@ -106,7 +106,7 @@ uint8_t USBSerial_print_n(uint8_t * __xdata buf, __xdata int len){ //3 bytes ge
106106 if (controlLineState > 0 ) {
107107 while (len > 0 ){
108108 waitWriteCount = 0 ;
109- while (UpPoint2_Busy ){//wait for 250ms or give up, on my mac it takes about 256us
109+ while (UpPoint2BusyFlag ){//wait for 250ms or give up, on my mac it takes about 256us
110110 waitWriteCount ++ ;
111111 delayMicroseconds (5 );
112112 if (waitWriteCount >=50000 ) return 0 ;
@@ -144,7 +144,7 @@ char USBSerial_read(){
144144void USB_EP2_IN (){
145145 UEP2_T_LEN = 0 ; // No data to send anymore
146146 UEP2_CTRL = UEP2_CTRL & ~ MASK_UEP_T_RES | UEP_T_RES_NAK ; //Respond NAK by default
147- UpPoint2_Busy = 0 ; //Clear busy flag
147+ UpPoint2BusyFlag = 0 ; //Clear busy flag
148148}
149149
150150void USB_EP2_OUT (){
0 commit comments