Commit Graph

17 Commits

Author SHA1 Message Date
Philip Gladstone 995114b736
Add support to set the clock rate and have sntp use it. (#3236) 2020-08-08 13:32:14 +02:00
Nathaniel Wesley Filardo 90beedfaba
rtctime: try harder to speak in integers (#3161)
Otherwise we might truncate precision with small floats and that's
unlikely to work out well for anyone.
2020-06-20 22:06:32 +02:00
Terry Ellison bbeb09b695 Squashed updates do get Lua51 and Lua53 working (#3075)
-  Lots of minor but nasty bugfixes to get all tests to run clean
-  core lua and test suite fixes to allow luac -F to run cleanly against test suite
-  next tranch to get LFS working
-  luac.cross -a options plus fixes from feedback
-  UART fixes and lua.c merge
-  commit of wip prior to rebaselining against current dev
-  more tweaks
2020-06-09 22:26:52 +02:00
Terry Ellison 1990f95740
Updated ROTables 1st tranch (#2742)
Updated ROTables
2019-05-08 14:08:20 +03:00
Terry Ellison 9a47107920
SDK 3.0 release (#2692)
* Rebaseline firmware to non-OS SDK version 3.0
* Note that SDK version 3.0 introduces the concept of a Flash Partition Table(PT).  This is located at Flash offset 0x10000 in our firmware build.
* The firmware is now PT aware with both LFS and SPIFFS taking their partition size and location from the PT
* A new tool `tools/nodemcu-partition.py` is now used to initialise these data and can also download LFS and SPIFFS images to these partitions.
2019-04-05 16:01:45 +01:00
Philip Gladstone 97e34ce520 Fix a number of issues with the gpio.pulse family of functions (#2260)
* Fix some subtle timing issues with gpio.pulse
* Add the pulse:update method
* Allow getstate to work on stopped pulsers
* Make gpio.mode(, gpio.OUTPUT) actually set the output mode
* Added some more documentation
2018-02-23 23:12:23 +01:00
Philip Gladstone d93465cd86 Add tracking and control of the rate error in the clock crystal. (#1697)
* Improve RTC timekeeping -- includes clock rate tracking
* Improved division by 1M
* Fix crash in sntp
* Disable RTC debug
* Get the offset correct
* Add comments on where the mysterious numbers came from
* Fix a crash with auto repeat mode and errors on repeat
2017-07-18 22:51:20 +02:00
Arnim Läuger 87e1abfb0f rtctime: change to lua_setfieldfor populating the table (#1746)
Looks good.
2017-01-22 14:17:46 -05:00
Johny Mattsson c5c0143b2f rtctime.dsleep() current draw improvements (#1659)
* Switch off interrupts before rtctime dsleep.

* Deal with the fact that MCU keeps running after being told to enter deep sleep
(It can keep running for quite a few instructions at times (and none at
all at others), and it appears that trying to cache additional code from
SPI flash while trying to go to sleep fails miserably at both....)

* Ensure flash is not active when going into deep sleep.
2016-12-14 12:39:31 +01:00
Arnim Läuger 56839fb20b Add rtctime.epoch2cal() (#1386) 2016-07-19 22:01:26 +02:00
Johny Mattsson 182d45f928 Enable -std=gnu11 for modules dir.
Plus boat-load of fixes to actually make that build.
2016-01-20 19:40:47 +11:00
Johny Mattsson 4e8ef87d03 Reworked module registration, removed modules.h
Module creation & registration now made a lot simpler. In essence,
each module file is now self-contained and only needs a

  NODEMCU_MODULE(MYNAME, "myname", myname_map, luaopen_myname);

line to both be automatically recognised by the Lua initialization
as well as honor the LUA_USE_MODULES_MYNAME #define.
2015-12-16 16:09:16 +11:00
TerryE b773290b8c Major cleanup of module registration pass 2.
carrying on Johny's edits as per my comments on #810
2015-12-16 11:21:40 +11:00
Johny Mattsson 6b6456be47 Major cleanup of module registration.
As per #810 & #796, only LUA_OPTIMIZE_MEMORY=2 & MIN_OPT_LEVEL=2 are
supported when building. This commit effects that limitation.

With this change modules/auxmods.h no longer needs to be updated for
every new module, nor do module writers need to cater for a hypothetical
LUA_OPTIMIZE_MEMORY < 2 scenario.
2015-12-12 15:03:40 +11:00
Johny Mattsson dd38a0a0e6 Imported reworked rtctime support. 2015-07-10 16:16:25 +10:00
Johny Mattsson 67e72c45df Imported RTC FIFO component + added Lua interface.
The rtcfifo module uses RTC memory to store sensor samples across deep-sleeps,
making it possible to batch up samples for less frequent uploads. This
component uses 9 RTC memory slots for control, and a variable number of
slots for sample storage (see rtcfifo.prepare() on how to control the
size/location of the latter).

When used together with the rtctime module, it also exposes the convenience
function rtcfifo.dsleep_until_sample() which can be used to easily take
readings on a regular basis without having to manually take into account
time spent awake to get an accurate sleep time.

The format used for storing samples is quite dense, and allows for 16 bits
of data in a fixed point format (per sample).
2015-07-10 15:12:31 +10:00
Johny Mattsson 2187424928 Imported RTC+sleep timekeeping from an internal DiUS project.
Added Lua module rtctime to interface with it.

This keeps as accurate time as is possible on the ESP8266, including across
deep sleeps (provided rtctime.dsleep() is used rather than node.dsleep()).
Intended to be used together with NTP for high accuracy time keeping. The
API is via rtctime.{get,set}timeofday(), working from Unix epoch.

Note that 160MHz CPU clock is not currently supported by the rtctime code,
as it is only aware of the 52MHz boot clock and the regular 80Mhz default
clock.

See rtctime.h for detailed info on how this all works.
2015-07-10 15:12:31 +10:00