Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
8576d840
Commit
8576d840
authored
Aug 13, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to print stuff from usbcdc LineCodingReceived fcn
parent
d8722d71
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
main.c
sw/usbdcdc/src/main.c
+27
-24
No files found.
sw/usbdcdc/src/main.c
View file @
8576d840
...
...
@@ -159,8 +159,8 @@ int main(void)
GPIO_PinModeSet
(
gpioPortE
,
11
,
gpioModePushPull
,
0
);;
GPIO_PinModeSet
(
gpioPortE
,
12
,
gpioModePushPull
,
1
);;
//
SerialPortInit();
//
DmaSetup();
SerialPortInit
();
DmaSetup
();
USBD_Init
(
&
initstruct
);
/*
...
...
@@ -279,31 +279,34 @@ static int UsbDataTransmitted(USB_Status_TypeDef status,
{
(
void
)
xferred
;
/* Unused parameter */
(
void
)
remaining
;
/* Unused parameter */
char
tmp
[
7
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'\n'
};
if
(
status
==
USB_STATUS_OK
)
{
if
(
!
dmaRxActive
)
{
/* dmaRxActive = false means that a new UART Rx DMA can be started. */
USBD_Write
(
EP_DATA_IN
,
(
void
*
)
uartRxBuffer
[
uartRxIndex
^
1
],
uartRxCount
,
UsbDataTransmitted
);
LastUsbTxCnt
=
uartRxCount
;
dmaRxActive
=
true
;
dmaRxCompleted
=
true
;
DMA_ActivateBasic
(
1
,
true
,
false
,
(
void
*
)
uartRxBuffer
[
uartRxIndex
],
(
void
*
)
&
(
LEUART0
->
RXDATA
),
USB_TX_BUF_SIZ
-
1
);
uartRxCount
=
0
;
USBTIMER_Start
(
0
,
RX_TIMEOUT
,
UartRxTimeout
);
}
else
{
/* The UART receive DMA callback function will start a new DMA. */
usbTxActive
=
false
;
}
delay
(
100
);
USBD_Write
(
0
,
(
void
*
)
tmp
,
7
,
UsbDataTransmitted
);
// if (!dmaRxActive)
// {
// /* dmaRxActive = false means that a new UART Rx DMA can be started. */
//
// USBD_Write(EP_DATA_IN, (void*) uartRxBuffer[ uartRxIndex ^ 1],
// uartRxCount, UsbDataTransmitted);
// LastUsbTxCnt = uartRxCount;
//
// dmaRxActive = true;
// dmaRxCompleted = true;
// DMA_ActivateBasic(1, true, false,
// (void *) uartRxBuffer[ uartRxIndex ],
// (void *) &(LEUART0->RXDATA),
// USB_TX_BUF_SIZ - 1);
// uartRxCount = 0;
// USBTIMER_Start(0, RX_TIMEOUT, UartRxTimeout);
// }
// else
// {
// /* The UART receive DMA callback function will start a new DMA. */
// usbTxActive = false;
// }
}
return
USB_STATUS_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment