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

627 Commits

Author SHA1 Message Date
aguaviva
08cdf153d4 added int16_t i2s_available(); it returns the number of samples than can be (#3988)
written before blocking
2017-12-17 21:34:38 -03:00
Sebastian Andersson
4a0cdca28c Export pgmspace symbols to C (#3955) 2017-12-14 14:38:09 +08:00
david gauchard
cb723a5960 realloc bug: fix #3953 (#3957)
fix #3699
2017-12-13 10:30:33 -03:00
liebman
3b0c395837 cleanup warnings (#3934) 2017-12-08 02:08:54 -03:00
Alessio Leoncini
fecacf167c Added Serial.setRxBufferSize method description in libraries reference document (#3862)
* Added null pointer check

* Fixed typo

* Added Serial.setRxBufferSize method description in libraries reference document
2017-11-22 14:30:11 -03:00
Alessio Leoncini
03f1a540ca Added constant time string comparison to avoid possible time-based attacks. (#3836)
* Added constant time strings comparison to avoid possible time-based attacks

* Fixed data types

* Fixed indentation

* Moved string comnparison in constant time to String class; modified function body to assure constant time comparison despite compiler optimizations

* Removed wrong code

* Fixed error and prevented compiler optimization to delete u1 local variable

* Avoid timing attacks on string comparison

* Minor

* changed counter names, removed else
2017-11-21 01:56:05 -03:00
david gauchard
cbfbc1ad63 lwip2 fixes and time/ntp management
core: +settimeofday()
core: +coredecls.h +sntp-lwip2.c
core: fix clock_gettime() with micros64()
core: honor DST in configTime()
core: internal clock is automatically started
examples: +esp8266/NTP-TZ-DST.ino
lwip2: sntp client removed
lwip2: fix crashing with WiFi.softAPConfig(ip,ip,ip)
fix #3852
2017-11-21 10:50:48 +08:00
Develo
cb0a30c22b
Removed unused function that serves no purpose (#3854) 2017-11-20 17:51:25 -03:00
Mystic-Mirage
117bc875ff Fix too wide 'word' type -- it should be 16-bit instead of 32-bit (#3851) 2017-11-19 19:42:15 -03:00
Brandon White
5b925697ec Added micros64 and used to fix and improve gettimeofday. 2017-11-14 12:44:41 +08:00
Ivan Grokhotkov
7ad89e58cd Use isnan and isinf from std:: 2017-11-05 14:46:36 +08:00
Ivan Grokhotkov
dfcaa1b854 Use min and max from std:: 2017-11-05 14:46:36 +08:00
WereCatf
9fce9c792c Add a workaround-delay in Serial.flush() (#3714)
* Add a workaround-delay in Serial.flush()

In relation to #2536 and #2502

Tested at 80MHz and 160MHz with flash-frequency at both 40MHz and 80MHz, the bug mentioned in the above issues manifests in all cases. The proposed workaround seems to work fine, I tested at 2400bps, 9600bps, 115200bps, 230400bps and 2Mbps and didn't see anomalous output.

* Remove extraneous character

* Update HardwareSerial.cpp
2017-10-15 02:05:49 -05:00
Ivan Grokhotkov
80aeacfb80 Fix erase size in ESP.eraseConfig
SDK uses final 4 sectors of flash for configuration data.
ESP.eraseConfig would only erase 2 sectors, so in some cases of
corrupted data ("system param error"), users could not fix the issue
using ESP.eraseConfig, and had to use esptool instead.

Thanks @HugoML for reporting this.
2017-10-15 02:02:05 -05:00
Juppit
1c8bcf6cb2 fix gettimeofday()
tp->tv_usec = micros() not micros() * 1000
2017-10-15 14:43:03 +08:00
Ivan Grokhotkov
371d1412fe provide implementation of _exit (#3698) 2017-10-13 02:18:53 +08:00
Ivan Grokhotkov
10edfc211e debug: hexdump arguments should be const 2017-10-13 02:17:56 +08:00
Ivan Grokhotkov
de9e8e024b pgmspace: zero out memory in strncpy_P (#2633)
strncpy should write 'size' characters, padding with zeroes if src is
shorter than 'size'.
2017-10-13 02:17:06 +08:00
Ivan Grokhotkov
7a93478a99 pgmspace: expand varargs correctly in printf_P (#2819) 2017-10-13 02:15:32 +08:00
Peter N Lewis
c5b26e487e Fixed comment InterruptLock "disable interrupts" 2017-10-11 11:11:22 -05:00
Ivan Grokhotkov
35d5fabe33 Revert SPIFFS_USE_MAGIC_LENGTH to 0 (#3612) 2017-09-22 18:38:01 +08:00
Ahmed El Sharnoby
1683b12dd7 SPIFFS: update to f5e26c4, fixes #3612 (#3623) 2017-09-22 03:49:41 -05:00
Ivan Grokhotkov
e68e3402fa core: mask GPIO interrupts while attaching/detaching ISR handler (#3598)
Fixes https://github.com/esp8266/Arduino/issues/2916.
2017-09-12 22:28:26 -05:00
me-no-dev
6ac48124bd Update spiffs 0.3.7 to and mkspiffs 0.1.3 2017-09-12 19:21:08 +08:00
adams13x13
613f04c195 Update WString.cpp
realloc() is called with newSize > 0 (at least 16), so newbuffer==0 means the old memory was not deallocated. Therefore, the pointer should still point to the old buffer. This change should resolve issue #3516.
2017-09-11 05:10:17 -05:00
hreintke
ba0e049b83 Functional Interrupts initial 2017-08-27 01:39:53 -05:00
Earle F. Philhower, III
4bed115abd Move debug constant strings to PROGMEM (#3478)
UMM debugging strings are normally placed in RODATA, which uses up scarse
memory.  Move them to PROGMEM and use macros to replace printf with a
version that can handle ROM strings.
2017-08-07 15:43:28 +03:00
Earle F. Philhower, III
a662e81146 Move ASSERT() macro file text to PMEM (#3477)
Every assert() includes a __FILE__ constant string to RODATA which
can be quite large as it includes the complete path as well as
the filename.

Move that string into PMEM, and update the postmortem to work with
either PMEM or RAM strings for dumping abort/assert/exception
information.
2017-08-01 18:37:26 +03:00
Kristian Sloth Lauszus
b6958986d1 Fixed unused-function warning
See: d55efd3e14 (diff-67390c99ad4faa2080719586ebf73b9e) and https://travis-ci.org/felis/USB_Host_Shield_2.0/jobs/213822247#L1248
2017-06-14 08:10:58 -05:00
Wolfgang Kraft
c52b0da11c Fix according to the discussion of issue #3140 https://github.com/esp8266/Arduino/issues/3140
pgm_read_byte() and pgm_read_word() need to be macros, as some third party libraries and sketches testing macro existence.
2017-06-05 01:35:00 -05:00
Ivan Grokhotkov
f211014dd3 SPIFFS: fix unaligned read in HAL (#3261)
Ref. #3065
2017-05-21 10:30:03 -05:00
david gauchard
8c7d1b780e automate crash for GDBStub 2017-05-18 06:43:22 -05:00
Sven Eliasson
2404a602af Const-correctness for MD5Builder (#3222)
Resolves #1175
2017-05-12 01:03:14 -05:00
Ivan Grokhotkov
01e1c586cb Updater: if low on heap memory, use smaller write buffer 2017-05-09 06:17:06 -05:00
Ivan Grokhotkov
9b0ad39e94 Updater: check boot mode before starting update
ref. https://github.com/esp8266/Arduino/issues/1017
2017-05-09 06:17:06 -05:00
Ivan Grokhotkov
22c7d792f0 Updater: place debug strings into progmem 2017-05-09 06:17:06 -05:00
Pablo Mendoza
db4d3e0098 Free memory we allocated and actually stop i2s. (#3191) 2017-05-08 03:33:20 -05:00
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