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
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
c4e26dd1
Commit
c4e26dd1
authored
9 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
esp8266/uart: Remove obsolete UART rx buffering code.
It's now completely replaced by the ringbuf implementation.
parent
d46bea9f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
esp8266/uart.c
+0
-38
0 additions, 38 deletions
esp8266/uart.c
with
0 additions
and
38 deletions
esp8266/uart.c
+
0
−
38
View file @
c4e26dd1
...
...
@@ -27,14 +27,6 @@ extern UartDevice UartDev;
// the uart to which OS messages go; -1 to disable
static
int
uart_os
=
UART_OS
;
/* unused
// circular buffer for RX buffering
#define RX_BUF_SIZE (256)
static uint16_t rx_buf_in;
static uint16_t rx_buf_out;
static uint8_t rx_buf[RX_BUF_SIZE];
*/
#if MICROPY_REPL_EVENT_DRIVEN
static
os_event_t
uart_evt_queue
[
16
];
#endif
...
...
@@ -94,12 +86,6 @@ static void ICACHE_FLASH_ATTR uart_config(uint8 uart_no) {
WRITE_PERI_REG
(
UART_INT_CLR
(
uart_no
),
0xffff
);
// enable rx_interrupt
SET_PERI_REG_MASK
(
UART_INT_ENA
(
uart_no
),
UART_RXFIFO_FULL_INT_ENA
);
/* unused
// init RX buffer
rx_buf_in = 0;
rx_buf_out = 0;
*/
}
/******************************************************************************
...
...
@@ -179,7 +165,6 @@ static void uart0_rx_intr_handler(void *para) {
goto
read_chars
;
}
else
if
(
UART_RXFIFO_TOUT_INT_ST
==
(
READ_PERI_REG
(
UART_INT_ST
(
uart_no
))
&
UART_RXFIFO_TOUT_INT_ST
))
{
read_chars:
#if 1 //MICROPY_REPL_EVENT_DRIVEN is not available here
ETS_UART_INTR_DISABLE
();
while
(
READ_PERI_REG
(
UART_STATUS
(
uart_no
))
&
(
UART_RXFIFO_CNT
<<
UART_RXFIFO_CNT_S
))
{
...
...
@@ -196,31 +181,8 @@ static void uart0_rx_intr_handler(void *para) {
// Clear pending FIFO interrupts
WRITE_PERI_REG
(
UART_INT_CLR
(
UART_REPL
),
UART_RXFIFO_TOUT_INT_CLR
|
UART_RXFIFO_FULL_INT_ST
);
ETS_UART_INTR_ENABLE
();
#else
while
(
READ_PERI_REG
(
UART_STATUS
(
uart_no
))
&
(
UART_RXFIFO_CNT
<<
UART_RXFIFO_CNT_S
))
{
uint8
RcvChar
=
READ_PERI_REG
(
UART_FIFO
(
uart_no
))
&
0xff
;
uint16_t
rx_buf_in_next
=
(
rx_buf_in
+
1
)
%
RX_BUF_SIZE
;
if
(
rx_buf_in_next
!=
rx_buf_out
)
{
rx_buf
[
rx_buf_in
]
=
RcvChar
;
rx_buf_in
=
rx_buf_in_next
;
}
}
#endif
}
}
/* unused
int uart0_rx(void) {
if (rx_buf_out != rx_buf_in) {
int chr = rx_buf[rx_buf_out];
rx_buf_out = (rx_buf_out + 1) % RX_BUF_SIZE;
return chr;
} else {
return -1;
}
}
*/
// Waits at most timeout microseconds for at least 1 char to become ready for reading.
// Returns true if something available, false if not.
...
...
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