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

649 Commits

Author SHA1 Message Date
mrwgx3
3934d10f21 Correct millis() drift, issue #3078 (#4264)
* Correct millis() drift, issue 3078

* Add 'test_millis_mm.ino' runtime benchmark

* Eliminate 'punning' warning

Add union 'acc' in millis() to eliminate 'punning' compiler warning

* Correct minor typo

* Eliminate 'punning' warning

 Add union 'acc' to eliminate 'punning' compiler warning  in 'millis_test'_DEBUG() and 'millis_test()'
2018-03-12 15:28:04 -03:00
Earle F. Philhower, III
afcbcd5cc9
Add support for hardware Sigma Delta generator
Provides a simple interface to attach/detach pins to the sigma-delta generator, and get/set the 2 parameters prescaler & target.  Working example that fades the onboard LED is provided.  Code and sample by @stefaandesmet2003.
2018-03-10 12:07:04 -08:00
Ivan Grokhotkov
3b269c4a96 postmortem: raise exception when assert happens
Fixes https://github.com/esp8266/Arduino/issues/4480
2018-03-09 12:47:22 +08:00
Ivan Grokhotkov
170911a689 gdbstub, postmortem: clean up
- Move GDB stub hooks into a separate file, provide header for it
- Use syscall instruction raise user mode exception
- Remove unused code in postmortem.c

fixup

fixup
2018-03-09 12:47:22 +08:00
Kyle Fleming
70f522cff8 Fix stack trace unwinding within continuation lib (#4385) 2018-03-08 17:21:47 -03:00
Maurice Ribble
7f0b9d1be9 Rx fifo latency fix (#4328)
* Flush the rx fifo when checking available bytes in fifo.  This gives a more correct result rather than waiting until either the fifo is full or until a serial rx timeout occurs.

* When rx_avaiable is checked return rx_buffer plus rx_fifo.  Then during rx_read and rx_peek functions copy over the data in the fifo as needed.

* Clean up early out case.

* Set the rx full fifo ISR to trigger a little sooner.  This makes the uart rx isr more robust in cases where the ISR can't trigger very fast
2018-03-08 12:16:14 -03:00
david gauchard
8053f285b1 provide full version descriptor, displayed in debug mode (#4467)
* provide full version descriptor, displayed in debug mode

* unix: shows core version like under windows when git is unavailable

* store strings in progmem

* version string honours NDEBUG

* add ARDUINO_ESP8266_GIT_DESC
restore ARDUINO_ESP8266_GIT_VER
restore global variable "core_version"
don't print full version on setDebugOutput(true)
set platform.txt version to 2.4.1-pre
hide irrelevant boot version
fix typo

* lwip2: fix disconnection/reconnection issue
also:
improve version string
remove useless message

* lwip2: bump tag before 2.4.1

* lwip2: improve netif flags management on git side

* full-version string: remove useless NDEBUG in separate source file

* do not automatically enable sdk messages along with core messages

* automatically reenable sdk messages along with core messages *before* setup not after

* check serial port when showing version-string + move sdk messages enabler in hardware serial

* + license header

* updated and tested windows commands in platform.txt (without git)

* updated and tested windows commands in platform.txt (without git)

* update package builder accordingly
2018-03-08 11:37:03 +08:00
Ivan Grokhotkov
429f40d321 sdk: update to 2.2.0
- update libraries and header files
- remove libmesh
- update PHY init data
2018-02-19 12:43:01 +03:00
Develo
cda72a07e0
Changed TIM_DIV265 for deprecation (#4326) 2018-02-08 14:07:47 -03:00
Develo
9694b3e688
Fix spiffs lseek typo for seek_end (#4287) 2018-02-06 19:59:16 -03:00
devyte
8da1d78cb4 Change argument to Esp.deepSleep from uint32 to uint64 to match SDK, add deepSleepMax based on the cali_proc function per SDK 2018-01-28 19:12:12 +08:00
Earle F. Philhower, III
589eb29eb3 Clear calloc block only if malloc succeeds
Calloc was calling memset(0) on NULL when its implicit malloc failed,
causing a crash in UMM.  Instead, only do the memset if the memory
allocation succeeds.

Fixes issue #4207
2018-01-21 13:54:53 +08:00
Kristijan Gjoshev
0fe725909e Update I2S base frequency and frequency dividers to real ones (#4031)
* Fix I2S base frequency
* Update frequency dividers for I2S
Reference: https://github.com/espressif/ESP8266_MP3_DECODER/blob/master/mp3/driver/i2s_freertos.c
* fixed i2s_set_rate, added i2s_get_real_rate() and i2s_set_dividers
* Minimise float calculations
2018-01-20 15:58:42 -08:00
egemenertugrul
d5c43f0102 Utilized UPDATE_ERROR_ERASE, added _setError function and refactored code (#4190)
* Added _setError function in the header file

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.

* Added _setError function

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.
2018-01-18 13:34:35 -03:00
david gauchard
28253c5bd3 boards.txt generator (#3722)
+ generates boards.rst
+ generate and replace boards section in package.json
+ generate ldscripts
+ new debug option: OOM
+ new led menu for generic board
2018-01-08 11:06:01 -03:00
ijm7
4b319d9b0c UpdaterClass::printError now accepts the Print object 2018-01-08 18:35:27 +08:00
hreintke
f9c60a226a Prevent endless loop in run_scheduled_functions (#4048) 2017-12-31 03:53:42 -03:00
Develo
a2d16f38d4
Extern C blocks (#1352) (#4044)
* Add extern C guard blocks to SDK header files #1352

* fixed some extern C blocks in core and libraries
2017-12-30 02:03:26 -03:00
Victor Tseng
2b868aac00 allow disabling global Serial and Serial1 object (#2807)
allow the user to disable specific global `Serial` objects to save
memory.

that's 0x1c bytes per object.
2017-12-29 11:11:00 -03:00
david gauchard
0b2df35117 follow arduino API: pure virtual Stream::flush() moved to empty virtual Print::flush() (#4029)
re fix #4018
2017-12-29 01:16:41 -03:00
OverEasy
e4043e9ba7 Fix boundary condition on resize (#4016)
cbuf.size() must be at least one byte larger than cbuf.available() for
logic to work.  reject request to resize = available.
2017-12-26 00:38:07 -03:00
david gauchard
9913e52107 handle tv.tv_usec in settimeofday() (#4001)
optional settimeofday()'s callback
fix #1679
2017-12-24 17:48:25 -03:00
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