1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00
Commit Graph

577 Commits

Author SHA1 Message Date
497d19d039 out_min should not be in divisor (#2408)
fixes fb00e64a6f error
2016-08-18 12:38:01 +03:00
fb00e64a6f detect division by zero in map() to prevent exceptions (#2397)
Will return -1 like AVR would
2016-08-18 10:50:59 +03:00
b250381d80 make updater fail if there is not enough space to fit the new firmware (#2405) 2016-08-18 09:59:35 +03:00
8cd331a8ba optimize uart rx isr and lower fifo full treshold (#2355) 2016-08-01 12:34:32 +03:00
18297458be allows global object instances be switch off with defines (#2344) 2016-08-01 11:21:50 +08:00
f50a6c0a8a Add support for 8 and 16 MB Flash (#2351)
Add to core dev config initially
2016-08-01 11:20:53 +08:00
b7c7bc038d digitalWrite and digitalRead cancel analogWrite enabled on a pin (#2328)
related to https://github.com/esp8266/Arduino/issues/2175
2016-07-26 14:16:02 +03:00
7900132225 fix uart triggering wdt on recalling begin (#2307) 2016-07-21 00:20:58 +03:00
6feecc5122 Fix analogWrite (#2299)
* Fix analogWrite

Move to NMI interrupt
Rework the whole ISR to take less and more constant cycles
Current defaults run 10bits/1KHz@160MHz and 9bit/1KHz@80MHz (soft
mapped)

* astyle and remove STORE_ATTR
2016-07-19 19:34:11 +08:00
3f1ab1fd81 Updated String library to use C++11 iterators. (#2267)
This will allow using the String library in a ranged for loop:

```C++
String s("Hi, this is a test");

for (const char& ch : s) {
  Serial.print(ch);
}
```

and even modify

```C++
String s("Hi, this is another test");

for (char& ch : s) {
  ch++;
}
Serial.println(s);
```
2016-07-18 19:31:34 +08:00
e35ebf137d Add support to Print::printf for printing from flash (#2266)
* Add support to Print::printf for printing from flash
2016-07-15 10:15:44 +03:00
f8a8a2a359 Implement Serial RX Buffer (#2239)
In connection with:
https://github.com/esp8266/Arduino/issues/2237
https://github.com/esp8266/Arduino/issues/2037
https://github.com/esp8266/Arduino/issues/1683
2016-07-08 10:11:14 +08:00
6d3109e8c7 Remove implementations of non-ISO libc functions which are present in newlib 2016-06-27 21:10:41 +08:00
d7d98d03ca Use libc from newlib (#1752)
* Use newlib libc library

This change adds libcmin.a, which is created from newlib libc by selectively removing some of the object files (mostly related to heap management).
The list of files is available in tools/sdk/lib/make_libcmin.sh. Files which are not needed are commented out.
This change adds support for various functions which were missing, like sscanf, strftime, etc.

* Fix some of the time functions

* Redirect stdout to serial

* Implement __putc_r

* Switch to custom newlib build

Built from https://github.com/igrr/newlib-xtensa using:
./configure --with-newlib --enable-multilib --disable-newlib-io-c99-formats --enable-newlib-supplied-syscalls --enable-target-optspace --program-transform-name="s&^&xtensa-lx106-elf-&" --disable-option-checking --with-target-subdir=xtensa-lx106-elf --target=xtensa-lx106-elf --enable-newlib-nano-formatted-io --enable-newlib-reent-small  --prefix=path-to-arduino-core/tools/sdk/libc
CROSS_CFLAGS="-DMALLOC_PROVIDED -DSIGNAL_PROVIDED -DABORT_PROVIDED" make
make install

* Update tests
2016-06-23 17:27:57 +08:00
3b81557810 added macro for maximum open SPIFFS files, settings it to 1 saves about 1k heap. (#2167) 2016-06-20 12:09:21 +08:00
3bfd5d51b4 Add missing pgm_read_ptr{_near/_far} macros (#2160) 2016-06-20 12:08:51 +08:00
79883e9d35 Fix UART pins setting (#2098) (#2141) 2016-06-20 12:08:33 +08:00
1640cc302d Fix ESP.getSketchSize, add ESP.getSketchMD5 (#2158)
* return true sketch size using ESP.getSketchSize() https://github.com/esp8266/Arduino/issues/2153
add MD5 for current binary ESP.getSketchMD5()

* Simplify ESP.getSketchSize, fix ESP.getSketchMD5
2016-06-16 21:05:43 +08:00
44d27228c5 Added Serial.baudRate() to get current baud rate (#2079)
* Changed WifInfo settings and WeMos board name

* Added board name to have in sketch and MDNS/OTA

* board naming convention

https://github.com/esp8266/Arduino/pull/2054

* Added Serial.baudRate() to get current baud rate

* Added more description

- Added note about Software Serial Implementation
- Indicate this will works on ESP8266 boards only
2016-06-15 18:35:33 +08:00
a14ac2cbdd Bring back old semantics to random and randomSeed, add secureRandom (#1710) (#2142) 2016-06-14 07:17:54 +08:00
b9dfe01903 Fix SPIFFS.openDir("") (#2143)
* Update spiffs_api.cpp

Fixes a bug where un-prefixed files are irretrievable with openDir(""). Described: https://github.com/esp8266/Arduino/issues/1818.

* Update FS test cases
2016-06-14 07:15:55 +08:00
90bbec9f50 Changes to MD5Builder missing from the last commit 2016-06-13 13:31:43 +08:00
063e4cc88f Add tests for MD5Builder, reformat and clean up code 2016-06-13 12:47:33 +08:00
3640757692 MD5Builder::addStream: fixed falsy calculated hash for len > filelength (#2126) 2016-06-13 10:37:05 +08:00
5eb6a7f449 Add mechanism for posting functions to the main loop (#2082)
* Add mechanism for posting functions to the main loop (#1064)

* Fix indentation, add note that API is not stable
2016-06-08 11:22:48 +08:00
32bd42b028 Store git version of the core in the compiled binary (#2099)
* Store git version of the core in the compiled binary

* Don't update version number when using boards manager package
2016-06-06 14:37:39 +08:00
2f933e20fa Make Updater be able to run inside async callbacks (#2096) 2016-06-05 18:00:10 +08:00
d1fc7002c1 Move timer detachInterrupt functions into IRAM (#2083)
These functions are used from ISR in Servo library, so must be in IRAM.
2016-06-03 15:09:03 +08:00
4b43860276 Add offset parameter to rtcUserMemoryRead/Write, expose RTC_USER_MEM in esp8266_peri.h 2016-06-02 13:39:53 +08:00
1dd50fb72c Execute global constructors in correct order (#2074)
Walk .ctors array from back to front, like gcc's gbl-ctors.h does
2016-06-01 14:45:59 +08:00
8176cbb28b Remove DISABLED macro (#2072) 2016-06-01 11:23:51 +08:00
2a4081b079 Added support for RTC user memory in ESP-specific APIs. (#1836) 2016-06-01 11:13:33 +08:00
3cfad27e38 Merge pull request #2058 from dave-prosee/master
I2C bus reset with status info to user, re issue 1025
2016-06-01 11:09:15 +08:00
b8ae0c0792 Fixed typo 2016-05-26 15:28:29 -07:00
75bcaf01a0 Added __throw_out_of_range 2016-05-26 15:23:46 -07:00
099f3a4147 I2C bus reset with info to user
I2C slave might stil have something to send when ESP826 starts I2C, thus
keeping the bus stuck.
Happens e.g. when power failure/reset during transmission.
Thanks to work of drmpf there is a solution.
Implemented as separate method so as not to interfere with existing.
Usage:

Wire.begin();
if (Wire.status() != I2C_OK) Serial.writeln("Something wrong with I2C
bus that cannot be recovered. Perform power cycle or search for other
masters on bus.";
2016-05-26 12:53:48 +02:00
5313c56f24 Add SPIFFS::end (#1657) 2016-05-20 10:20:04 +08:00
43fb139ed8 Add option to keep FS classes in namespace (#2030)
Putting `#define FS_NO_GLOBALS` before `#include <FS.h>` will disable `using` declarations for FS classes.
2016-05-16 11:08:33 +08:00
542b05e543 If GDBStub library is used, break into gdb on assert and panic 2016-05-10 21:30:53 +08:00
5b264af1d6 umm_malloc: print block start address before heap corruption callback is triggered 2016-05-10 21:28:17 +08:00
4c587e28bc Fix Exception 2 when using printf or vprintf
ets_vprintf signature is not the same as vprintf, it takes an output function as a first argument.
2016-04-17 02:12:01 +03:00
2e849e30d2 Merge pull request #1768 from esp8266/pulsein_fix
Fix pulseIn
2016-03-30 21:10:06 +03:00
29186ecb7d Merge pull request #1832 from esp8266/sdk-1.5.2
Update SDK to 1.5.2 (#1653)
2016-03-30 21:07:37 +03:00
05c078ba5b Don't set RF mode on boot unless it was overridden
The change in 297bb17 enabled RF after deep sleep, even if deep sleep was done with RF_DISABLED option (thanks @vlast3k for pointing this out).
Now we check the value returned by __get_rf_mode, and only call system_phy_set_rfoption if RF_MODE override was provided by user.
2016-03-30 08:47:50 +03:00
477e9cfb8a Update SDK to 1.5.2 (#1653)
patch included: http://bbs.espressif.com/viewtopic.php?f=46&t=1856
2016-03-29 17:24:37 +03:00
91cc6ff4f9 Avoid multiple instances of INADDR_NONE
By moving the definition from the header to the source we now only use
one instance for the entire app with a little saving in space.
2016-03-24 09:47:02 +02:00
3d3c928e2e Enable heap poisoning only when debug options are enabled (#1800) 2016-03-24 01:34:25 +03:00
5227b32531 Accept both named constant and ADC channel number in analogRead (#1766) 2016-03-16 12:34:51 +03:00
32c6176e24 Fix pulseIn (#1072, #1149)
- fix return value on timeout
- add optimistic_yield to allow WiFi/network tasks to run
- use ccount instead of micros (which causes an integer division on every call)
2016-03-14 00:28:09 +03:00
652703ef41 Move micros, delayMicroseconds, millis to IRAM (#1326) 2016-03-13 23:00:53 +03:00