Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
075ca645
Commit
075ca645
authored
Oct 21, 2015
by
danicampora
Browse files
Options
Downloads
Patches
Plain Diff
cc3200: Fix UART tests after correcting uart.read() behaviour.
parent
be2879ce
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cc3200/mods/pybuart.c
+5
-5
5 additions, 5 deletions
cc3200/mods/pybuart.c
tests/wipy/uart.py
+6
-7
6 additions, 7 deletions
tests/wipy/uart.py
with
11 additions
and
12 deletions
cc3200/mods/pybuart.c
+
5
−
5
View file @
075ca645
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
*******-***********************************************************************/
*******-***********************************************************************/
#define PYBUART_FRAME_TIME_US(baud) ((11 * 1000000) / baud)
#define PYBUART_FRAME_TIME_US(baud) ((11 * 1000000) / baud)
#define PYBUART_2_FRAMES_TIME_US(baud) (PYBUART_FRAME_TIME_US(baud) * 2)
#define PYBUART_2_FRAMES_TIME_US(baud) (PYBUART_FRAME_TIME_US(baud) * 2)
#define PYBUART_RX_TIMEOUT_US(baud) (PYBUART_2_FRAMES_TIME_US(baud)
)
#define PYBUART_RX_TIMEOUT_US(baud) (PYBUART_2_FRAMES_TIME_US(baud)
* 8) // we need at least characters in the FIFO
#define PYBUART_TX_WAIT_US(baud) ((PYBUART_FRAME_TIME_US(baud)) + 1)
#define PYBUART_TX_WAIT_US(baud) ((PYBUART_FRAME_TIME_US(baud)) + 1)
#define PYBUART_TX_MAX_TIMEOUT_MS (5)
#define PYBUART_TX_MAX_TIMEOUT_MS (5)
...
...
This diff is collapsed.
Click to expand it.
tests/wipy/uart.py
+
6
−
7
View file @
075ca645
...
@@ -54,7 +54,7 @@ print(uart1.read() == b'123456')
...
@@ -54,7 +54,7 @@ print(uart1.read() == b'123456')
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart0
.
read
(
1
)
==
b
'
1
'
)
print
(
uart0
.
read
(
1
)
==
b
'
1
'
)
print
(
uart0
.
read
(
2
)
==
b
'
23
'
)
print
(
uart0
.
read
(
2
)
==
b
'
23
'
)
print
(
uart0
.
read
()
==
b
''
)
print
(
uart0
.
read
()
==
None
)
uart0
.
write
(
b
'
123
'
)
uart0
.
write
(
b
'
123
'
)
buf
=
bytearray
(
3
)
buf
=
bytearray
(
3
)
...
@@ -79,28 +79,28 @@ uart0 = UART(0, 1000000, pins=('GP12', None))
...
@@ -79,28 +79,28 @@ uart0 = UART(0, 1000000, pins=('GP12', None))
print
(
uart0
.
write
(
b
'
123456
'
)
==
6
)
print
(
uart0
.
write
(
b
'
123456
'
)
==
6
)
print
(
uart1
.
read
()
==
b
'
123456
'
)
print
(
uart1
.
read
()
==
b
'
123456
'
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart0
.
read
()
==
b
''
)
print
(
uart0
.
read
()
==
None
)
# rx only mode
# rx only mode
uart0
=
UART
(
0
,
1000000
,
pins
=
(
None
,
'
GP13
'
))
uart0
=
UART
(
0
,
1000000
,
pins
=
(
None
,
'
GP13
'
))
print
(
uart0
.
write
(
b
'
123456
'
)
==
6
)
print
(
uart0
.
write
(
b
'
123456
'
)
==
6
)
print
(
uart1
.
read
()
==
b
''
)
print
(
uart1
.
read
()
==
None
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart0
.
read
()
==
b
'
123
'
)
print
(
uart0
.
read
()
==
b
'
123
'
)
# leave pins as they were (rx only mode)
# leave pins as they were (rx only mode)
uart0
=
UART
(
0
,
1000000
,
pins
=
None
)
uart0
=
UART
(
0
,
1000000
,
pins
=
None
)
print
(
uart0
.
write
(
b
'
123456
'
)
==
6
)
print
(
uart0
.
write
(
b
'
123456
'
)
==
6
)
print
(
uart1
.
read
()
==
b
''
)
print
(
uart1
.
read
()
==
None
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart1
.
write
(
b
'
123
'
)
==
3
)
print
(
uart0
.
read
()
==
b
'
123
'
)
print
(
uart0
.
read
()
==
b
'
123
'
)
# no pin assignemnt
# no pin assignemnt
uart0
=
UART
(
0
,
1000000
,
pins
=
(
None
,
None
))
uart0
=
UART
(
0
,
1000000
,
pins
=
(
None
,
None
))
print
(
uart0
.
write
(
b
'
123456789
'
)
==
9
)
print
(
uart0
.
write
(
b
'
123456789
'
)
==
9
)
print
(
uart1
.
read
()
==
b
''
)
print
(
uart1
.
read
()
==
None
)
print
(
uart1
.
write
(
b
'
123456789
'
)
==
9
)
print
(
uart1
.
write
(
b
'
123456789
'
)
==
9
)
print
(
uart0
.
read
()
==
b
''
)
print
(
uart0
.
read
()
==
None
)
print
(
Pin
.
board
.
GP12
)
print
(
Pin
.
board
.
GP12
)
print
(
Pin
.
board
.
GP13
)
print
(
Pin
.
board
.
GP13
)
...
@@ -156,4 +156,3 @@ for uart_id in uart_id_range:
...
@@ -156,4 +156,3 @@ for uart_id in uart_id_range:
uart
.
init
(
115200
)
uart
.
init
(
115200
)
print
(
uart
)
print
(
uart
)
uart
.
read
()
uart
.
read
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment