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
f11a5df9
Commit
f11a5df9
authored
Oct 27, 2015
by
Johny Mattsson
Browse files
Merge pull request #703 from DiUS/wdt-format-fix
Fix WDT resets during file.format().
parents
c223ecfe
b535be7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/modules/tmr.c
View file @
f11a5df9
...
@@ -121,11 +121,11 @@ static int tmr_delay( lua_State* L ){
...
@@ -121,11 +121,11 @@ static int tmr_delay( lua_State* L ){
while
(
us
>=
1000000
){
while
(
us
>=
1000000
){
us
-=
1000000
;
us
-=
1000000
;
os_delay_us
(
1000000
);
os_delay_us
(
1000000
);
WRITE_PERI_REG
(
0x60000914
,
0x73
);
system_soft_wdt_feed
(
);
}
}
if
(
us
>
0
){
if
(
us
>
0
){
os_delay_us
(
us
);
os_delay_us
(
us
);
WRITE_PERI_REG
(
0x60000914
,
0x73
);
system_soft_wdt_feed
(
);
}
}
return
0
;
return
0
;
}
}
...
@@ -256,7 +256,7 @@ why they are here*/
...
@@ -256,7 +256,7 @@ why they are here*/
// extern void update_key_led();
// extern void update_key_led();
// Lua: tmr.wdclr()
// Lua: tmr.wdclr()
static
int
tmr_wdclr
(
lua_State
*
L
){
static
int
tmr_wdclr
(
lua_State
*
L
){
WRITE_PERI_REG
(
0x60000914
,
0x73
);
system_soft_wdt_feed
(
);
// update_key_led();
// update_key_led();
return
0
;
return
0
;
}
}
...
...
app/platform/platform.c
View file @
f11a5df9
...
@@ -508,7 +508,7 @@ uint32_t platform_s_flash_write( const void *from, uint32_t toaddr, uint32_t siz
...
@@ -508,7 +508,7 @@ uint32_t platform_s_flash_write( const void *from, uint32_t toaddr, uint32_t siz
return
0
;
return
0
;
c_memcpy
(
apbuf
,
from
,
size
);
c_memcpy
(
apbuf
,
from
,
size
);
}
}
WRITE_PERI_REG
(
0x60000914
,
0x73
);
system_soft_wdt_feed
(
);
r
=
flash_write
(
toaddr
,
apbuf
?
(
uint32
*
)
apbuf
:
(
uint32
*
)
from
,
size
);
r
=
flash_write
(
toaddr
,
apbuf
?
(
uint32
*
)
apbuf
:
(
uint32
*
)
from
,
size
);
if
(
apbuf
)
if
(
apbuf
)
c_free
(
apbuf
);
c_free
(
apbuf
);
...
@@ -532,7 +532,7 @@ uint32_t platform_s_flash_read( void *to, uint32_t fromaddr, uint32_t size )
...
@@ -532,7 +532,7 @@ uint32_t platform_s_flash_read( void *to, uint32_t fromaddr, uint32_t size )
fromaddr
-=
INTERNAL_FLASH_START_ADDRESS
;
fromaddr
-=
INTERNAL_FLASH_START_ADDRESS
;
SpiFlashOpResult
r
;
SpiFlashOpResult
r
;
WRITE_PERI_REG
(
0x60000914
,
0x73
);
system_soft_wdt_feed
(
);
const
uint32_t
blkmask
=
(
INTERNAL_FLASH_READ_UNIT_SIZE
-
1
);
const
uint32_t
blkmask
=
(
INTERNAL_FLASH_READ_UNIT_SIZE
-
1
);
if
(
((
uint32_t
)
to
)
&
blkmask
)
if
(
((
uint32_t
)
to
)
&
blkmask
)
...
@@ -561,6 +561,6 @@ uint32_t platform_s_flash_read( void *to, uint32_t fromaddr, uint32_t size )
...
@@ -561,6 +561,6 @@ uint32_t platform_s_flash_read( void *to, uint32_t fromaddr, uint32_t size )
int
platform_flash_erase_sector
(
uint32_t
sector_id
)
int
platform_flash_erase_sector
(
uint32_t
sector_id
)
{
{
WRITE_PERI_REG
(
0x60000914
,
0x73
);
system_soft_wdt_feed
(
);
return
flash_erase
(
sector_id
)
==
SPI_FLASH_RESULT_OK
?
PLATFORM_OK
:
PLATFORM_ERR
;
return
flash_erase
(
sector_id
)
==
SPI_FLASH_RESULT_OK
?
PLATFORM_OK
:
PLATFORM_ERR
;
}
}
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