diff --git a/README.md b/README.md
index 36524ac8..674c44e4 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,9 @@ support floating point LUA.
use macro LUA_NUMBER_INTEGRAL in user_config.h control this feature.
LUA_NUMBER_INTEGRAL to disable floating point support,
// LUA_NUMBER_INTEGRAL to enable floating point support.
+fix tmr.time(). #132
+fix filesystem length. #113
+fix ssl reboots. #134
build pre_build bin.
2015-01-26
diff --git a/app/Makefile b/app/Makefile
index 605534db..15ff75c4 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -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
diff --git a/app/modules/tmr.c b/app/modules/tmr.c
index 78221589..bd68503e 100644
--- a/app/modules/tmr.c
+++ b/app/modules/tmr.c
@@ -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 us
+// Lua: time() , return rtc time in second
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;
}
diff --git a/app/spiffs/spiffs.c b/app/spiffs/spiffs.c
index dc913754..f362580e 100644
--- a/app/spiffs/spiffs.c
+++ b/app/spiffs/spiffs.c
@@ -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);
diff --git a/pre_build/0.9.5/nodemcu_20150127.bin b/pre_build/0.9.5/nodemcu_20150127.bin
deleted file mode 100644
index 91614241..00000000
Binary files a/pre_build/0.9.5/nodemcu_20150127.bin and /dev/null differ
diff --git a/pre_build/latest/nodemcu_latest.bin b/pre_build/latest/nodemcu_latest.bin
index 91614241..16d57dfc 100644
Binary files a/pre_build/latest/nodemcu_latest.bin and b/pre_build/latest/nodemcu_latest.bin differ