Commit Graph

84 Commits

Author SHA1 Message Date
TerryE 46ea2aa42e Make the wifi.smart functions options and remove wofs and upgrade
AFAIK no one uses the wifi.startsmart() and wifi.stopsmart().  Removing
them frees up an extra 20-25K of Flash to use as filesystem.  So I have
added a new config define WIFI_SMART_ENABLE which is enabled by default
so the default functionality is the same, but if this is commented out
then this code is omitted.

I have also removed wofs and upgrade from this build as we no longer
support these.
2016-02-26 17:23:38 +00:00
TerryE 0ef362472c Add node.egc.setmode() + constants as per #609 2016-02-20 19:15:52 +00:00
TerryE 49733f6f6d Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.

-   **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.

-   **Tasking I/F**.  New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit.  Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`

-   **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`

-   **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 17:13:17 +00: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 30f8f62420 Optimized node.bootreason() for size.
Reduces the size from 179 to 102 bytes.
2016-01-15 11:42:20 +11:00
philip dc5cc6d9f4 Add the exccause parameter into the bootreason block 2016-01-14 08:16:26 -05:00
Johny Mattsson 57917601b7 Expose extended reset info via node.bootreason(). 2016-01-12 17:29:46 +11:00
dnc40085 cb0a982dc3 Minor change to node module
node.dsleep was using sint32 to hold sleep time when it should be using
uint32
2016-01-02 03:10:27 -08: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
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 7512e628b6 Merge pull request #742 from TerryE/dev-stripdebug
Port of strip debug patch to the SDK 1.4-baseline dev
2015-11-10 12:20:36 +11:00
Johny Mattsson 382eea5079 Fix building with DEVKIT_0_9 defined.
This got broken in the 1.4.0 overhaul, mea culpa.
2015-11-09 12:15:40 +11:00
TerryE 83d06b667d Port of strip debug patch to the SDK 1.4-baseline dev 2015-11-08 23:46:08 +00:00
Johny Mattsson bf8ed500bf Moved node.key() & node.led() support into node module.
It was piggybacking on the Lua readline timer which no longer exists.

Also cleaned up injection of Lua commands via CoAP & node.input().
2015-10-12 13:26:05 +11:00
Johny Mattsson f1552605d9 Change os_update_cpu_freq... to ets_update_cpu_freq...
Again, the os_xxx version has been removed from the SDK.
2015-10-12 13:26:04 +11:00
devsaurus d0e6ab38df add write error detection in node_compile() 2015-08-11 00:08:49 +02:00
vowstar 67d785ffec Restore default data and init data before system restore. 2015-07-04 04:27:59 +08:00
vowstar 89aaf475d0 Add node.restore().
If NodeMCU can't connect Wi-Fi, please use it.
After reboot, all will be OK.
RESTORE ITEMS:
wifi_station_set_auto_connect, wifi_set_phy_mode, wifi_softap_set_config,  wifi_station_set_config, wifi_set_opmode.
2015-07-04 03:54:22 +08:00
Johny Mattsson 7bd10e8a17 Added node.bootreason() to inspect boot cause. 2015-06-27 12:34:03 +10:00
HuangRui 3dd1ac3739 Move node.readvdd33 to adc.readvdd33, fix #162. 2015-03-27 00:52:55 +08:00
Markus Gritsch b648e9a8db Added node.setcpufreq(mhz) function.
This function allows setting the CPU frequency to node.CPU80MHZ or
node.CPU160MHZ.
2015-03-17 10:23:45 +01:00
HuangRui 5c84359b5c ROM flash size can changed with detected size, fixed #283. 2015-03-16 05:40:43 +08:00
HuangRui dfce182622 Paste new version, make it can get correct flash size. 2015-03-16 00:51:47 +08:00
HuangRui ed87cbd96f Try to fix flash auto detection bug. 2015-03-16 00:48:28 +08:00
funshine bbef457e50 seperate user_config.h to speed-up compile when modules disabled/enabled 2015-03-06 11:59:04 +08:00
funshine 6e840a453f add node.compile() api 2015-02-13 15:11:59 +08:00
funshine 856b8553bf comment out ws2812 temporary. remove node.led, node.key 2015-02-12 11:05:28 +08:00
HuangRui 5894df1da6 Combined dsleep_set_options(option) to dsleep( us, option )
* dsleep( us, option )
Hardware has to support deep-sleep wake up (XPD_DCDC connects to EXT_RSTB with 0R). system_deep_sleep(0) ,set no wake up timer,connect a GPIO to pin RST, the chip will wake up by a falling-edge on pin RST.
** us: Integer
time to sleep.
if us = 0, it will sleep forever.
** option: Integer
option=0, init data byte 108 is valuable;
option>0, init data byte 108 is valueless.
More details as follows:
0, RF_CAL or not after deep-sleep wake up, depends on init data byte 108.
1, RF_CAL after deep-sleep wake up, there will belarge current.
2, no RF_CAL after deep-sleep wake up, there will only be small current.
4, disable RF after deep-sleep wake up, just like modem sleep, there will be the smallest current.
2015-01-29 14:21:38 +08:00
alonewolfx2 f4214294d3 new sleep set options added (from 0.9.5 sdk)
usage:
-- no wakeup until rst pin to low 
node.dsleep(0) 

-- 4 mean no RF after deepsleep.
node.dsleepsetoption(4)
2015-01-28 18:13:19 +02:00
alonewolfx2 4af0873122 for reading internal vdd33 pin voltage.
example usage and result
```
print(node.readvdd33())
3348
> 
```
2015-01-26 12:17:15 +02:00
HuangRui c04f2578ec Updated SDK to v0.9.5 and optimized memory. 2015-01-05 10:09:51 +08:00
funshine 04a5e67443 add node.info() to get version, chipid, flash info 2014-12-31 14:26:51 +08:00
HuangRui a93e62c444 Add node.flashid() and node.flashsize(). 2014-12-31 08:08:31 +08:00
funshine cdd13b1af3 source file first commit, folder structure refact 2014-12-22 19:35:05 +08:00