Rev 111 | Rev 238 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 111 | Rev 112 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | #include <stdio.h> |
18 | #include <stdio.h> |
19 | #include "91x_lib.h" |
19 | #include "91x_lib.h" |
20 | #include "uart1.h" |
20 | #include "uart1.h" |
21 | #include "usb_lib.h" |
21 | #include "usb_lib.h" |
22 | #include "usb_desc.h" |
22 | #include "usb_desc.h" |
- | 23 | #include "usb.h" |
|
- | 24 | #include "mkprotocol.h" |
|
Line 23... | Line 25... | ||
23 | 25 | ||
24 | /* Private typedef -----------------------------------------------------------*/ |
26 | /* Private typedef -----------------------------------------------------------*/ |
25 | /* Private define ------------------------------------------------------------*/ |
27 | /* Private define ------------------------------------------------------------*/ |
26 | /* Private macro -------------------------------------------------------------*/ |
28 | /* Private macro -------------------------------------------------------------*/ |
27 | /* Private variables ---------------------------------------------------------*/ |
- | |
28 | u8 USB_BufferRx[VIRTUAL_COM_PORT_DATA_SIZE]; |
29 | /* Private variables ---------------------------------------------------------*/ |
29 | u8 USB_BufferTx[VIRTUAL_COM_PORT_DATA_SIZE]; |
30 | u8 USB_Buffer[VIRTUAL_COM_PORT_DATA_SIZE]; |
30 | u32 USB_BufferRxCount =0; |
31 | u32 USB_BufferCount =0; |
31 | u32 count_in = 0; |
32 | u32 count_in = 0; |
32 | /* Private function prototypes -----------------------------------------------*/ |
33 | /* Private function prototypes -----------------------------------------------*/ |
33 | /* Private functions ---------------------------------------------------------*/ |
34 | /* Private functions ---------------------------------------------------------*/ |
34 | /******************************************************************************* |
35 | /******************************************************************************* |
Line 38... | Line 39... | ||
38 | * Output : None. |
39 | * Output : None. |
39 | * Return : None. |
40 | * Return : None. |
40 | *******************************************************************************/ |
41 | *******************************************************************************/ |
41 | void EP3_OUT_Callback(void) |
42 | void EP3_OUT_Callback(void) |
42 | { |
43 | { |
- | 44 | u32 i; |
|
43 | USB_BufferRxCount= GetEPRxCount(ENDP3); |
45 | USB_BufferCount = GetEPRxCount(ENDP3); |
44 | PMAToUserBufferCopy(USB_BufferRx, ENDP3_RXADDR, USB_BufferRxCount ); |
46 | PMAToUserBufferCopy(USB_Buffer, ENDP3_RXADDR, USB_BufferCount ); |
- | 47 | for(i=0; i<USB_BufferCount; i++) |
|
- | 48 | { |
|
45 | USB_BufferRx[USB_BufferRxCount] = 0; // terminate buffer contents |
49 | MKProtocol_CollectSerialFrame(&USB_rx_buffer, USB_Buffer[i]); |
- | 50 | } |
|
46 | SetEPRxValid(ENDP3); |
51 | SetEPRxValid(ENDP3); |
Line 47... | Line 52... | ||
47 | 52 | ||
48 | sprintf(text,"USB (%ld): %s\n\r", USB_BufferRxCount, USB_BufferRx); |
53 | //sprintf(text,"USB (%ld): %s\n\r", USB_BufferRxCount, USB_BufferRx); |
49 | UART1_PutString(text); |
- | |
50 | - | ||
51 | // USB_Send_Data(RxdBuffer, AnzahlEmpfangsBytes); |
- | |
52 | // USB_Send_String("Rx.\0"); |
54 | //UART1_PutString(text); |
53 | } |
55 | } |
54 | /******************************************************************************* |
56 | /******************************************************************************* |
55 | * Function Name : EP1_IN_Callback |
57 | * Function Name : EP1_IN_Callback |
56 | * Description : |
58 | * Description : |