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
e1f8b604
Commit
e1f8b604
authored
Mar 24, 2015
by
funshine
Browse files
fix init_data detect flash api
parent
52ca40b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/platform/flash_api.c
View file @
e1f8b604
...
@@ -321,7 +321,7 @@ bool flash_init_data_written(void)
...
@@ -321,7 +321,7 @@ bool flash_init_data_written(void)
// FLASH SEC - 4
// FLASH SEC - 4
uint32_t
data
[
2
]
ICACHE_STORE_ATTR
;
uint32_t
data
[
2
]
ICACHE_STORE_ATTR
;
#if defined(FLASH_SAFE_API)
#if defined(FLASH_SAFE_API)
if
(
SPI_FLASH_RESULT_OK
==
flash_safe_read
((
flash_
rom
_get_sec_num
()
-
4
)
*
SPI_FLASH_SEC_SIZE
,
(
uint32
*
)
data
,
sizeof
(
data
)))
if
(
SPI_FLASH_RESULT_OK
==
flash_safe_read
((
flash_
safe
_get_sec_num
()
-
4
)
*
SPI_FLASH_SEC_SIZE
,
(
uint32
*
)
data
,
sizeof
(
data
)))
#else
#else
if
(
SPI_FLASH_RESULT_OK
==
spi_flash_read
((
flash_rom_get_sec_num
()
-
4
)
*
SPI_FLASH_SEC_SIZE
,
(
uint32
*
)
data
,
sizeof
(
data
)))
if
(
SPI_FLASH_RESULT_OK
==
spi_flash_read
((
flash_rom_get_sec_num
()
-
4
)
*
SPI_FLASH_SEC_SIZE
,
(
uint32
*
)
data
,
sizeof
(
data
)))
#endif // defined(FLASH_SAFE_API)
#endif // defined(FLASH_SAFE_API)
...
...
examples/fragment.lua
View file @
e1f8b604
...
@@ -381,3 +381,18 @@ function TestDNSLeak()
...
@@ -381,3 +381,18 @@ function TestDNSLeak()
tmr
.
alarm
(
1
,
3000
,
0
,
function
()
print
(
"hack socket close, MEM: "
..
node
.
heap
())
c
:
close
()
end
)
-- socket timeout hack
tmr
.
alarm
(
1
,
3000
,
0
,
function
()
print
(
"hack socket close, MEM: "
..
node
.
heap
())
c
:
close
()
end
)
-- socket timeout hack
print
(
"MEM: "
..
node
.
heap
())
print
(
"MEM: "
..
node
.
heap
())
end
end
v
=
"abc%0D%0Adef"
print
(
string.gsub
(
v
,
"%%(%x%x)"
,
function
(
x
)
return
string.char
(
tonumber
(
x
,
16
))
end
))
function
ex
(
x
)
string.find
(
"abc%0Ddef"
,
"bc"
)
return
's'
end
string.gsub
(
"abc%0Ddef"
,
"%%(%x%x)"
,
ex
)
function
ex
(
x
)
string.char
(
35
)
return
's'
end
string.gsub
(
"abc%0Ddef"
,
"%%(%x%x)"
,
ex
)
print
(
"hello"
)
function
ex
(
x
)
string.lower
(
'Ab'
)
return
's'
end
string.gsub
(
"abc%0Ddef"
,
"%%(%x%x)"
,
ex
)
print
(
"hello"
)
v
=
"abc%0D%0Adef"
pcall
(
function
()
print
(
string.gsub
(
v
,
"%%(%x%x)"
,
function
(
x
)
return
string.char
(
tonumber
(
x
,
16
))
end
))
end
)
\ No newline at end of file
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