Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
860aa47d
Commit
860aa47d
authored
Jun 02, 2016
by
Johny Mattsson
Browse files
Replacement system_set_os_print() function.
parent
c3782980
Changes
3
Show whitespace changes
Inline
Side-by-side
app/user/wrap_printf.s
View file @
860aa47d
...
...
@@ -44,7 +44,13 @@
.
align
4
.
literal_position
__wrap_printf
:
addi
a1
,
a1
,
-
48
/*
get
some
stack
space
*/
movi
a9
,
os_printf_enabled
/*
a9
is
caller
saved
*/
l8ui
a9
,
a9
,
0
/*
load
os_printf_enabled
flag
*/
bnez
a9
,
1
f
/*
if
it
's enabled, we print everything */
movi
a9
,
_irom0_sdktext_end
/*
else
we
check
if
it
's SDK called */
bgeu
a0
,
a9
,
1
f
/*
...
and
only
print
from
user
code
*/
ret
1
:
addi
a1
,
a1
,
-
48
/*
get
some
stack
space
*/
s32i
a0
,
a1
,
0
/*
store
a0
at
the
bottom
*/
s32i
a2
,
a1
,
16
/*
copy
the
formatting
string
and
first
few
arguments
*/
s32i
a3
,
a1
,
20
/*
...
onto
the
stack
in
a
way
that
we
get
a
struct
*/
...
...
@@ -61,3 +67,9 @@ __wrap_printf:
l32i
a0
,
a1
,
0
/*
restore
return
address
into
a0
*/
addi
a1
,
a1
,
48
/*
release
the
stack
*/
ret
/*
all
done
*/
/*
Flag
for
controlling
whether
SDK
printf
()
s
are
suppressed
or
not
.
*
This
is
to
provide
an
RTOS
-
safe
reimplementation
of
system_set_os_print
()
.
*/
.
section
".
data
"
.
globl
os_printf_enabled
os_printf_enabled
:
.
byte
1
ld/nodemcu.ld
View file @
860aa47d
...
...
@@ -91,6 +91,12 @@ SECTIONS
.irom0.text : ALIGN(0x1000)
{
_irom0_text_start = ABSOLUTE(.);
/* To be able to suppress SDK printfs, we place all SDK code first, with
* a marker at the end that we can easily compare against. */
*/rtos-sdk/lib/lib*.a:*.o(.irom*)
_irom0_sdktext_end = ABSOLUTE(.);
*(.servercert.flash)
*(.clientcert.flash)
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
...
...
@@ -108,10 +114,6 @@ SECTIONS
KEEP(*(.lua_rotable))
LONG(0) LONG(0) /* Null-terminate the array */
/* SDK doesn't use libc functions, and are therefore safe to put in flash */
*/libc.a:*.o(.text* .literal*)
/* end libc functions */
_irom0_text_end = ABSOLUTE(.);
_flash_used_end = ABSOLUTE(.);
} >irom0_0_seg :irom0_0_phdr =0xffffffff
...
...
sdk-overrides/include/user_interface.h
View file @
860aa47d
...
...
@@ -3,7 +3,6 @@
#define ets_timer_arm_new(tmr, ms, rpt, isms) os_timer_arm(tmr,ms,rpt)
//#include_next "user_interface.h"
#include "espressif/esp_system.h"
#include "espressif/esp_misc.h"
#include "espressif/esp_wifi.h"
...
...
@@ -11,9 +10,10 @@
#include "espressif/esp_softap.h"
#include "espressif/esp_timer.h"
// FIXME
static
inline
void
system_set_os_print
(
uint8
onoff
)
{
(
void
)
onoff
;
}
static
inline
void
system_set_os_print
(
uint8_t
onoff
)
{
extern
uint8_t
os_printf_enabled
;
os_printf_enabled
=
onoff
;
}
bool
wifi_softap_deauth
(
uint8
mac
[
6
]);
...
...
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