Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
1c132c85
Commit
1c132c85
authored
May 13, 2015
by
Josef Gajdusek
Browse files
esp8266: Add configuration option for redirecting the built-in OS output
parent
40c6d578
Changes
2
Hide whitespace changes
Inline
Side-by-side
esp8266/Makefile
View file @
1c132c85
...
...
@@ -22,12 +22,15 @@ INC += -I../lib/timeutils
INC
+=
-I
$(BUILD)
INC
+=
-I
$(ESP_SDK)
/include
UART_OS
=
1
CFLAGS_XTENSA
=
-fsingle-precision-constant
-Wdouble-promotion
\
-D__ets__
-DICACHE_FLASH
\
-fno-inline-functions
\
-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
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))
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
echo
$(SCRIPTDIR)
>
$(SCRIPTDIR
_FILE))
else
ifneq
($(shell cat $(
SCRIPTDIR
_FILE)), $(SCRIPTDIR))
$(shell
echo
$(SCRIPTDIR)
>
$(SCRIPTDIR
_FILE))
$(shell
echo
$(SCRIPTDIR)
$(UART_OS)
>
$(CONFVARS
_FILE))
else
ifneq
($(shell cat $(
CONFVARS
_FILE)), $(SCRIPTDIR)
$(UART_OS)
)
$(shell
echo
$(SCRIPTDIR)
$(UART_OS)
>
$(CONFVARS
_FILE))
endif
$(BUILD)/frozen.c
:
$(wildcard $(SCRIPTDIR)/*) $(SCRIPTDIR_FILE)
$(BUILD)/uart.o
:
$(CONFVARS_FILE)
$(BUILD)/frozen.c
:
$(wildcard $(SCRIPTDIR)/*) $(CONFVARS_FILE)
$(ECHO)
"Generating
$@
"
$(Q)$(MAKE_FROZEN)
$(SCRIPTDIR)
>
$@
...
...
esp8266/uart.c
View file @
1c132c85
...
...
@@ -112,13 +112,13 @@ void uart_tx_one_char(uint8 uart, uint8 TxChar) {
* Returns : NONE
*******************************************************************************/
static
void
ICACHE_FLASH_ATTR
uart
1
_write_char
(
char
c
)
{
uart
_os
_write_char
(
char
c
)
{
if
(
c
==
'\n'
)
{
uart_tx_one_char
(
UART
1
,
'\r'
);
uart_tx_one_char
(
UART
1
,
'\n'
);
uart_tx_one_char
(
UART
_OS
,
'\r'
);
uart_tx_one_char
(
UART
_OS
,
'\n'
);
}
else
if
(
c
==
'\r'
)
{
}
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) {
ETS_UART_INTR_ENABLE
();
// 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
()
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment