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
425e6641
Commit
425e6641
authored
Jan 27, 2015
by
funshine
Browse files
fix #132, #113, switch to lib/libssl.a
parent
5ec77af8
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
425e6641
...
...
@@ -33,6 +33,9 @@ support floating point LUA.<br />
use macro LUA_NUMBER_INTEGRAL in user_config.h control this feature.
<br
/>
LUA_NUMBER_INTEGRAL to disable floating point support,
<br
/>
// LUA_NUMBER_INTEGRAL to enable floating point support.
<br
/>
fix tmr.time(). #132
<br
/>
fix filesystem length. #113
<br
/>
fix ssl reboots. #134
<br
/>
build pre_build bin.
2015-01-26
<br
/>
...
...
app/Makefile
View file @
425e6641
...
...
@@ -26,7 +26,6 @@ SUBDIRS= \
driver
\
lwip
\
json
\
ssl
\
upgrade
\
platform
\
libc
\
...
...
@@ -73,7 +72,6 @@ COMPONENTS_eagle.app.v6 = \
driver/libdriver.a
\
lwip/liblwip.a
\
json/libjson.a
\
ssl/libssl.a
\
upgrade/libupgrade.a
\
platform/libplatform.a
\
libc/liblibc.a
\
...
...
@@ -102,6 +100,7 @@ LINKFLAGS_eagle.app.v6 = \
-lmain
\
-ljson
\
-lsmartconfig
\
-lssl
\
$(DEP_LIBS_eagle.app.v6)
\
-Wl
,--end-group
...
...
app/modules/tmr.c
View file @
425e6641
...
...
@@ -148,31 +148,24 @@ static int tmr_wdclr( lua_State* L )
}
static
os_timer_t
rtc_timer_updator
;
static
unsigned
rtc_second
=
0
;
// TODO: load from rtc memory
static
uint64_t
cur_count
=
0
;
static
uint64_t
rtc_
count
=
0
;
static
uint64_t
rtc_
us
=
0
;
void
rtc_timer_update_cb
(
void
*
arg
){
uint64_t
t
=
(
uint64_t
)
system_get_rtc_time
();
uint64_t
delta
=
(
t
>=
cur_count
)
?
(
t
-
cur_count
)
:
(
0x100000000
+
t
-
cur_count
);
// NODE_ERR("%x\n",t);
if
(
t
>=
cur_count
){
rtc_count
+=
t
-
cur_count
;
cur_count
=
t
;
}
else
{
rtc_count
+=
0x100000000
+
t
-
cur_count
;
cur_count
=
t
;
}
cur_count
=
t
;
unsigned
c
=
system_rtc_clock_cali_proc
();
uint64_t
itg
=
c
>>
12
;
uint64_t
dec
=
c
&
0xFFF
;
uint64_t
second
=
(
cur_count
*
itg
+
((
cur_count
*
dec
)
>>
12
))
/
1000000
;
// NODE_ERR("%x\n",second);
rtc_second
=
(
unsigned
)
second
;
// TODO: store rtc_count, rtc_second to rtc memory.
rtc_us
+=
(
delta
*
itg
+
((
delta
*
dec
)
>>
12
));
// TODO: store rtc_us to rtc memory.
}
// Lua: time() , return rtc time in
u
s
// Lua: time() , return rtc time in s
econd
static
int
tmr_time
(
lua_State
*
L
)
{
lua_pushinteger
(
L
,
rtc_second
&
0x7FFFFFFF
);
uint64_t
local
=
rtc_us
;
lua_pushinteger
(
L
,
((
uint32_t
)(
local
/
1000000
))
&
0x7FFFFFFF
);
return
1
;
}
...
...
app/spiffs/spiffs.c
View file @
425e6641
...
...
@@ -45,6 +45,8 @@ The small 4KB sectors allow for greater flexibility in applications th
void
spiffs_mount
()
{
spiffs_config
cfg
;
cfg
.
phys_addr
=
(
u32_t
)
platform_flash_get_first_free_block_address
(
NULL
);
cfg
.
phys_addr
+=
0x4000
;
cfg
.
phys_addr
&=
0xFFFFC000
;
// align to 4 sector.
cfg
.
phys_size
=
INTERNAL_FLASH_SIZE
-
(
(
u32_t
)
cfg
.
phys_addr
-
INTERNAL_FLASH_START_ADDRESS
);
cfg
.
phys_erase_block
=
INTERNAL_FLASH_SECTOR_SIZE
;
// according to datasheet
cfg
.
log_block_size
=
INTERNAL_FLASH_SECTOR_SIZE
;
// let us not complicate things
...
...
@@ -74,6 +76,8 @@ int myspiffs_format( void )
SPIFFS_unmount
(
&
fs
);
u32_t
sect_first
,
sect_last
;
sect_first
=
(
u32_t
)
platform_flash_get_first_free_block_address
(
NULL
);
sect_first
+=
0x4000
;
sect_first
&=
0xFFFFC000
;
// align to 4 sector.
sect_first
=
platform_flash_get_sector_of_address
(
sect_first
);
sect_last
=
INTERNAL_FLASH_SIZE
+
INTERNAL_FLASH_START_ADDRESS
-
4
;
sect_last
=
platform_flash_get_sector_of_address
(
sect_last
);
...
...
pre_build/0.9.5/nodemcu_20150127.bin
deleted
100644 → 0
View file @
5ec77af8
File deleted
pre_build/latest/nodemcu_latest.bin
View file @
425e6641
No preview for this file type
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