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
1c132c85
Commit
1c132c85
authored
10 years ago
by
Josef Gajdusek
Browse files
Options
Downloads
Patches
Plain Diff
esp8266: Add configuration option for redirecting the built-in OS output
parent
40c6d578
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
esp8266/Makefile
+12
-7
12 additions, 7 deletions
esp8266/Makefile
esp8266/uart.c
+5
-5
5 additions, 5 deletions
esp8266/uart.c
with
17 additions
and
12 deletions
esp8266/Makefile
+
12
−
7
View file @
1c132c85
...
@@ -22,12 +22,15 @@ INC += -I../lib/timeutils
...
@@ -22,12 +22,15 @@ INC += -I../lib/timeutils
INC
+=
-I
$(
BUILD
)
INC
+=
-I
$(
BUILD
)
INC
+=
-I
$(
ESP_SDK
)
/include
INC
+=
-I
$(
ESP_SDK
)
/include
UART_OS
=
1
CFLAGS_XTENSA
=
-fsingle-precision-constant
-Wdouble-promotion
\
CFLAGS_XTENSA
=
-fsingle-precision-constant
-Wdouble-promotion
\
-D__ets__
-DICACHE_FLASH
\
-D__ets__
-DICACHE_FLASH
\
-fno-inline-functions
\
-fno-inline-functions
\
-Wl
,-EL
-mlongcalls
-mtext-section-literals
\
-Wl
,-EL
-mlongcalls
-mtext-section-literals
\
CFLAGS
=
$(
INC
)
-Wall
-Wpointer-arith
-Werror
-ansi
-std
=
gnu99
-nostdlib
$(
CFLAGS_XTENSA
)
$(
COPT
)
CFLAGS
=
$(
INC
)
-Wall
-Wpointer-arith
-Werror
-ansi
-std
=
gnu99
-nostdlib
-DUART_OS
=
$(
UART_OS
)
\
$(
CFLAGS_XTENSA
)
$(
COPT
)
LDFLAGS
=
-nostdlib
-T
esp8266.ld
-Map
=
$(
@:.elf
=
.map
)
--cref
LDFLAGS
=
-nostdlib
-T
esp8266.ld
-Map
=
$(
@:.elf
=
.map
)
--cref
LIBS
=
-L
$(
ESP_SDK
)
/lib
-lmain
-ljson
-llwip
-lpp
-lnet80211
-lwpa
-lphy
-lnet80211
LIBS
=
-L
$(
ESP_SDK
)
/lib
-lmain
-ljson
-llwip
-lpp
-lnet80211
-lwpa
-lphy
-lnet80211
...
@@ -85,16 +88,18 @@ OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
...
@@ -85,16 +88,18 @@ OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
all
:
$(BUILD)/firmware-combined.bin
all
:
$(BUILD)/firmware-combined.bin
SCRIPTDIR
_FILE
=
$(
BUILD
)
/
scriptdir
CONFVARS
_FILE
=
$(
BUILD
)
/
confvars
ifeq
($(wildcard $(
SCRIPTDIR
_FILE)),)
ifeq
($(wildcard $(
CONFVARS
_FILE)),)
$(
shell
$(
MKDIR
)
-p
$(
BUILD
))
$(
shell
$(
MKDIR
)
-p
$(
BUILD
))
$(
shell
echo
$(
SCRIPTDIR
)
>
$(
SCRIPTDIR
_FILE
))
$(
shell
echo
$(
SCRIPTDIR
)
$(
UART_OS
)
>
$(
CONFVARS
_FILE
))
else
ifneq
($(shell cat $(
SCRIPTDIR
_FILE)), $(SCRIPTDIR))
else
ifneq
($(shell cat $(
CONFVARS
_FILE)), $(SCRIPTDIR)
$(UART_OS)
)
$(
shell
echo
$(
SCRIPTDIR
)
>
$(
SCRIPTDIR
_FILE
))
$(
shell
echo
$(
SCRIPTDIR
)
$(
UART_OS
)
>
$(
CONFVARS
_FILE
))
endif
endif
$(BUILD)/frozen.c
:
$(wildcard $(SCRIPTDIR)/*) $(SCRIPTDIR_FILE)
$(BUILD)/uart.o
:
$(CONFVARS_FILE)
$(BUILD)/frozen.c
:
$(wildcard $(SCRIPTDIR)/*) $(CONFVARS_FILE)
$(
ECHO
)
"Generating
$@
"
$(
ECHO
)
"Generating
$@
"
$(
Q
)$(
MAKE_FROZEN
)
$(
SCRIPTDIR
)
>
$@
$(
Q
)$(
MAKE_FROZEN
)
$(
SCRIPTDIR
)
>
$@
...
...
This diff is collapsed.
Click to expand it.
esp8266/uart.c
+
5
−
5
View file @
1c132c85
...
@@ -112,13 +112,13 @@ void uart_tx_one_char(uint8 uart, uint8 TxChar) {
...
@@ -112,13 +112,13 @@ void uart_tx_one_char(uint8 uart, uint8 TxChar) {
* Returns : NONE
* Returns : NONE
*******************************************************************************/
*******************************************************************************/
static
void
ICACHE_FLASH_ATTR
static
void
ICACHE_FLASH_ATTR
uart
1
_write_char
(
char
c
)
{
uart
_os
_write_char
(
char
c
)
{
if
(
c
==
'\n'
)
{
if
(
c
==
'\n'
)
{
uart_tx_one_char
(
UART
1
,
'\r'
);
uart_tx_one_char
(
UART
_OS
,
'\r'
);
uart_tx_one_char
(
UART
1
,
'\n'
);
uart_tx_one_char
(
UART
_OS
,
'\n'
);
}
else
if
(
c
==
'\r'
)
{
}
else
if
(
c
==
'\r'
)
{
}
else
{
}
else
{
uart_tx_one_char
(
UART
1
,
c
);
uart_tx_one_char
(
UART
_OS
,
c
);
}
}
}
}
...
@@ -191,7 +191,7 @@ void ICACHE_FLASH_ATTR uart_init(UartBautRate uart0_br, UartBautRate uart1_br) {
...
@@ -191,7 +191,7 @@ void ICACHE_FLASH_ATTR uart_init(UartBautRate uart0_br, UartBautRate uart1_br) {
ETS_UART_INTR_ENABLE
();
ETS_UART_INTR_ENABLE
();
// install uart1 putc callback
// install uart1 putc callback
os_install_putc1
((
void
*
)
uart
1
_write_char
);
os_install_putc1
((
void
*
)
uart
_os
_write_char
);
}
}
void
ICACHE_FLASH_ATTR
uart_reattach
()
{
void
ICACHE_FLASH_ATTR
uart_reattach
()
{
...
...
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