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
71894dcb
Commit
71894dcb
authored
Aug 05, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playing with USB
parent
368302bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
main.c
sw/usbdcdc/src/main.c
+16
-7
No files found.
sw/usbdcdc/src/main.c
View file @
71894dcb
...
...
@@ -96,7 +96,7 @@ EFM32_ALIGN(4)
EFM32_PACK_START
(
1
)
static
cdcLineCoding_TypeDef
__attribute__
((
aligned
(
4
)))
cdcLineCoding
=
{
115200
,
0
,
0
,
8
,
0
4800
,
2
,
0
,
8
,
0
};
EFM32_PACK_END
()
...
...
@@ -695,10 +695,6 @@ static void SerialPortInit(void)
GPIO_PinModeSet
(
gpioPortE
,
14
,
gpioModePushPull
,
1
);
GPIO_PinModeSet
(
gpioPortE
,
15
,
gpioModeInput
,
0
);
init
.
baudrate
=
4800
;
init
.
databits
=
leuartDatabits8
;
init
.
stopbits
=
leuartStopbits2
;
/* Enable CORE LE clock in order to access LE modules */
CMU_ClockEnable
(
cmuClock_CORELE
,
true
);
...
...
@@ -708,16 +704,29 @@ static void SerialPortInit(void)
/* Enable LEUART0 clock */
CMU_ClockEnable
(
cmuClock_LEUART0
,
true
);
/* Do not prescale clock */
CMU_ClockDivSet
(
cmuClock_LEUART0
,
cmuClkDiv_1
);
/* Configure UART for basic async operation */
init
.
enable
=
leuartDisable
;
init
.
baudrate
=
4800
;
init
.
databits
=
leuartDatabits8
;
init
.
stopbits
=
leuartStopbits2
;
LEUART_Init
(
leuart
,
&
init
);
// delay(1000);
/* Enable pins at LEUART0 location #2 */
leuart
->
ROUTE
=
LEUART_ROUTE_RXPEN
|
LEUART_ROUTE_TXPEN
|
LEUART_ROUTE_LOCATION_LOC2
;
// /* Clear previous RX interrupts */
// LEUART_IntClear(leuart, LEUART_IF_RXDATAV);
// NVIC_ClearPendingIRQ(LEUART0_IRQn);
//
// /* Enable RX interrupts */
// LEUART_IntEnable(leuart, LEUART_IF_RXDATAV);
// NVIC_EnableIRQ(LEUART0_IRQn);
/* Finally enable it */
LEUART_
Int
Enable
(
leuart
,
leuartEnable
);
LEUART_Enable
(
leuart
,
leuartEnable
);
}
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