1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

740 Commits

Author SHA1 Message Date
jpmendoza
af0f5ed956 Issue #1062: Implement support for HSPI overlap mode. 2017-05-08 03:04:11 -05:00
Beau Hardy
157698bef9 Base64: add option to disable any newlines in output. (#3208)
Closes #3194
2017-05-08 03:01:24 -05:00
Ivan Grokhotkov
0b672668bf progmem: replace C version of pgm_read_{word,byte} with assembly
See discussion in https://github.com/esp8266/Arduino/issues/3140
2017-04-28 11:47:09 +08:00
Sergio Tomasello
a9224266f3 Arduino boards with ESP8266 (#3121)
default crystal freq 26M for all boards, 40M for arduino
2017-04-11 10:19:30 -05:00
Ivan Grokhotkov
ae13809c81 Update SDK to 2.0.0
- Update SDK header files and libraries to SDK 2.0.0 plus 2.0.0_16_08_09
  patch
- Remove mem_manager.o from libmain.a (replaced with umm_malloc)
- Disable switch from DIO to QIO mode for certain flash chips (saves
  IRAM space)
- Add user_rf_cal_sector_set; it points to rf_init_data sector.
- Change the way rf_init_data is spoofed.
  This is now done by wrapping spi_flash_read and returning the data we
  need during startup sequence.
- Place lwip library into flash using linker script instead of section
  attributes (saves IRAM space)
2017-02-03 04:21:20 +03:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
Rodion Kvashnin
d85e783806 Fixed libb64 decoder. (#2883)
* Fixed libb64 decoder.

Libb64 decoder works when "char" type is signed. In esp8266 xtensa gcc "char" is unsigned, so libb64 decoder does not work. In the implementation file I replaced "char" to "int8_t" and created function wrappers in order to keep existing interface.

* For style consistency.
2017-01-20 16:37:53 +08:00
Родион Квашнин
9791a48d4a Fixed incorrect usage of memset() in PWM code which leads to incomplete initialization of struct. Thanks to GCC warning -Wsizeof-pointer-memaccess. 2017-01-19 20:18:31 +08:00
pfeerick
a444898900 Prevent divide by zero error causing tone() to crash (#2780)
* Prevent divide by zero error causing code to crash

As per the issue at #2491, there is a divide by error issue resulting from the specification of 0 as the frequency. This does not appear to affect the AVR implementation, but it crashes on ESP8266s. I have merely removed the division if the frequency is zero, which appears to be giving the expected results (no tone), without any code crashes. 

To test, simply load the toneMelody sketch included with the Arduino IDE (Examples -> 02. Digital -> toneMelody) and change the piezo to something else if you need to. On the Witty module used to test this, I could also tell by the wifi led blinking every time the code crashed as the ESP8266 immediately rebooted.

* Use noTone when frequency is zero

When a frequency of zero is given to tone(), instead call noTone() and exit. Placed after some of the initialisation stuff to ensure the pin is mapped as a output, etc. Tested as functional against a Node MCU 1.0 board and the toneMelody example sketch, using GPIO5 (pin D1).

* Errant tab in formatting

* Rest of tabs that crept in from web editor

Defaulted to tabs and 8 indent :sigh:
2017-01-17 10:09:08 +08:00
Ivan Grokhotkov
da4cab5b27 Merge pull request #2554 from Makuna/SPIFFSFileSeek
Add Arduino File standard seek call
2016-11-14 11:02:46 -06:00
Michael Miller
b5b7169e51 Add Arduino File standard seek call 2016-09-26 23:54:53 -07:00
Victor Tseng
5666ec2ec1 const-correctness IPAddress::toString()
it doesn't modify any member variables, should be safe to be const.
2016-09-13 00:32:29 +08:00
Ivan Grokhotkov
7f6e0c98f6 core: fix bug in gettimeofday
gettimeofday used to return timestamps which had tv_sec 1000 times smaller than the correct value.
s_bootTime is in seconds, so no need to divide it by 1000.
2016-08-25 12:51:57 +08:00
Me No Dev
497d19d039 out_min should not be in divisor (#2408)
fixes fb00e64a6f error
2016-08-18 12:38:01 +03:00
Me No Dev
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
Me No Dev
b250381d80 make updater fail if there is not enough space to fit the new firmware (#2405) 2016-08-18 09:59:35 +03:00
Me No Dev
8cd331a8ba optimize uart rx isr and lower fifo full treshold (#2355) 2016-08-01 12:34:32 +03:00
Clemens Kirchgatterer
18297458be allows global object instances be switch off with defines (#2344) 2016-08-01 11:21:50 +08:00
Me No Dev
f50a6c0a8a Add support for 8 and 16 MB Flash (#2351)
Add to core dev config initially
2016-08-01 11:20:53 +08:00
Me No Dev
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
Me No Dev
7900132225 fix uart triggering wdt on recalling begin (#2307) 2016-07-21 00:20:58 +03:00
Me No Dev
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
Pauline Middelink
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
Me No Dev
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
Me No Dev
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
Ivan Grokhotkov
6d3109e8c7 Remove implementations of non-ISO libc functions which are present in newlib 2016-06-27 21:10:41 +08:00
Ivan Grokhotkov
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
Tijn Kooijmans
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
unaiur
3bfd5d51b4 Add missing pgm_read_ptr{_near/_far} macros (#2160) 2016-06-20 12:08:51 +08:00
Ivan Grokhotkov
79883e9d35 Fix UART pins setting (#2098) (#2141) 2016-06-20 12:08:33 +08:00
Ivan Grokhotkov
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
Charles
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
Ivan Grokhotkov
a14ac2cbdd Bring back old semantics to random and randomSeed, add secureRandom (#1710) (#2142) 2016-06-14 07:17:54 +08:00
Ivan Grokhotkov
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
Ivan Grokhotkov
90bbec9f50 Changes to MD5Builder missing from the last commit 2016-06-13 13:31:43 +08:00
Ivan Grokhotkov
063e4cc88f Add tests for MD5Builder, reformat and clean up code 2016-06-13 12:47:33 +08:00
Sven Eliasson
3640757692 MD5Builder::addStream: fixed falsy calculated hash for len > filelength (#2126) 2016-06-13 10:37:05 +08:00
Ivan Grokhotkov
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
Ivan Grokhotkov
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
Me No Dev
2f933e20fa Make Updater be able to run inside async callbacks (#2096) 2016-06-05 18:00:10 +08:00
Ivan Grokhotkov
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
Ivan Grokhotkov
4b43860276 Add offset parameter to rtcUserMemoryRead/Write, expose RTC_USER_MEM in esp8266_peri.h 2016-06-02 13:39:53 +08:00
unaiur
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
Ivan Grokhotkov
8176cbb28b Remove DISABLED macro (#2072) 2016-06-01 11:23:51 +08:00
Macro Yau
2a4081b079 Added support for RTC user memory in ESP-specific APIs. (#1836) 2016-06-01 11:13:33 +08:00
Ivan Grokhotkov
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
Ed Coyne
b8ae0c0792 Fixed typo 2016-05-26 15:28:29 -07:00
Ed Coyne
75bcaf01a0 Added __throw_out_of_range 2016-05-26 15:23:46 -07:00
Dave P
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
Ivan Grokhotkov
5313c56f24 Add SPIFFS::end (#1657) 2016-05-20 10:20:04 +08:00