1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00
Commit Graph

487 Commits

Author SHA1 Message Date
d1149c53e6 Remove UART register reference from HardwareSerial 2016-01-26 22:58:00 +03:00
16c0f3f1d5 Implement HardwareSerial::peek 2016-01-26 22:58:00 +03:00
7960b63357 Move UART HAL into separate file, clean up code 2016-01-26 22:57:59 +03:00
e255f25cfd Bufferless and Interruptless HardwareSerial
Let's use the onboard buffers :)
2016-01-26 22:57:59 +03:00
531d748936 rename cbuf::getSize to cbuf::available (return available Bytes in cbuf)
add cbuf::size (return size of cbuf)
2016-01-26 18:21:42 +01:00
fa38ce4079 allow cbuf as chain 2016-01-26 17:40:01 +01:00
d9a51f9fa1 Added getResetReason in human readable form 2016-01-25 00:43:57 +01:00
bac5ce0490 make resize easier to read and add note 2016-01-23 23:23:02 +01:00
e2a73ef385 move function code of cbuf to cbuf.cpp
add peek for multiple bytes
add remove
add resizeAdd
add resize
2016-01-23 11:28:30 +01:00
8bd0b2a110 Merge remote-tracking branch 'upstream/master' 2016-01-18 13:14:35 +02:00
c1e91c722f manual merge of IPAddress from Arduino.cc e3909b4e2c 2016-01-17 09:43:07 -05:00
28c96179a0 Update core_esp8266_phy.c
add #include <string.h> to fix warning: incompatible implicit declaration of built-in function 'memcpy'
2016-01-14 16:30:26 -08:00
d68b9717b5 Use explicit TX pin number and add pins setting method 2016-01-14 17:55:57 +02:00
e97bc80cee Allow setting alternate TX for UART 0, so GPIO1 is available as SPI_CS1 2016-01-14 14:18:52 +02:00
377864f76b Merge remote-tracking branch 'esp8266/master' 2016-01-09 13:31:28 +02:00
489b9e77e6 Merge branch 'master' into MD5 2016-01-09 10:31:22 +02:00
2cf902cb76 use size_t in md5builder stream 2016-01-09 10:30:28 +02:00
1d2237bc9d fix pwm first step getting skipped 2016-01-09 00:12:36 +02:00
ce1b64bc43 Merge pull request #1320 from alltheblinkythings/SerialInterframeFixes
Fixes for poor HardwareSerial performance/crashes exacerbated by SDK1.5
2016-01-04 21:26:59 +08:00
e12b6ffa40 Merge branch 'master' of https://github.com/esp8266/Arduino into MD5 2016-01-04 13:06:16 +02:00
995f02f437 add more debug levels 2016-01-02 12:54:34 +01:00
2b23b005aa allow control of enabling debug and debug level from IDE 2016-01-02 12:25:39 +01:00
34db483bb5 fix wrong return type 2016-01-01 13:18:24 +00:00
7d54f5211c Improvements for MD5Builder with Stream 2016-01-01 12:43:35 +00:00
9d7c2fd5be Remove duplicate 'return' (copy-and-paste error). 2015-12-29 17:04:15 -05:00
bc9493e690 Remove tracking of whether write() was called.
Tracking _written was required on AVR devices to work around a hardware
limitation when implementing flush().  The ESP8266 doesn't have the same
issue, so we can remove the tracking and make write() more lightweight.

The cost is a minor increase in work done in flush() when write() was not
previously called, but this should be much rarer than individual character
writes.
2015-12-29 12:46:25 -05:00
4ef0466578 Don't trip the WDT if interrupts are disabled during write() or flush().
Prior to this change, if interrupts were disabled during a call to
HardwareSerial::write() when the circular buffer was full, or
HardwareSerial::flush() when the circular buffer was non-empty,
we would loop forever and trip a watchdog timeout.
2015-12-29 12:05:15 -05:00
d9a7a816d5 include core_esp8266_features.h in arduino.h for easier usage, and add WIFI_HAS_EVENT_CALLBACK 2015-12-29 17:44:00 +01:00
85905c12f2 allow multiple event callbacks and add filter option 2015-12-29 17:31:57 +01:00
7edcda4a0f IPAddress allow uint32_t compare 2015-12-29 15:26:14 +01:00
c8772cfcd0 Make HardwareSerial::begin() and end() interrupt safe and disable TX/RX if we can't allocate a buffer for them.
Prior to this change, the interrupt could fire during initialisation,
necessitating a deep check that the HardwareSerial structure had valid
_tx_buffer or _rx_buffer each time an interrupt occurred.

By keeping uart_t's and HardwareSerial's (txEnabled, _tx_buffer) and
(rxEnabled, _rx_buffer) in sync, we can remove this extra check, as
well as fixing a null pointer dereference if e.g. _tx_buffer allocation
failed and write() was subsequently called.
2015-12-28 19:11:12 -05:00
cfe7ae1118 Put HardwareSerial and cbuf methods called from interrupt context in RAM.
This is required per the non-OS SDK doc, which states:
  "Using non-OS SDK, please do not call any function defined with
  ICACHE_FLASH_ATTR in the interrupt handler."

This avoids an "Illegal instruction" exception with epc1 pointing at a valid
instruction (in flash) for one of the moved methods.
2015-12-28 18:35:27 -05:00
83398f6011 Don't bother testing isRxEnabled() on UART1 - it is always false. 2015-12-28 17:55:16 -05:00
e83dd4d241 Use lightweight tests when we only care if the buffer is empty or full. 2015-12-28 17:53:10 -05:00
e147314f97 Re-enable interrupts before directly enqueuing characters in the UART FIFO.
Not sure why, but this reduces the occurrence rate of an occasional ~3.25 or
~7μs intercharacter delay, which was interfering with use of the UART to
generate precise timing pulses (such as driving WS2812 LEDs).
2015-12-28 17:44:28 -05:00
50ad8ccdf5 rework StreamString::write to use String internal buffer direct.
#1289
2015-12-23 13:40:16 +01:00
1c7b81660b Merge pull request #1289 from gtalusan/short_writes
handle short writes
2015-12-23 10:15:57 +03:00
60baf802e1 Add function to measure stack high water mark (thanks @g3gg0) 2015-12-23 10:13:01 +03:00
66a88ac8d2 Fix bad DEBUGV argument (thanks @g3gg0) 2015-12-23 10:11:40 +03:00
70c85c0901 handle short writes 2015-12-22 21:31:30 -05:00
cda14204fe Fix SPIFFS path length check, add notes about FSInfo structure (#1273) 2015-12-22 11:52:50 +03:00
d460de8879 Merge branch 'me-no-dev-master'
* me-no-dev-master:
  fix identation
  optimize pwm interrupt handler for better precision
2015-12-22 11:17:33 +03:00
63f1e40106 Fix RAM corruption caused by our hook of register_chipv6_phy(init_data*).
"init_data", when non-NULL, is on the heap, and the register_chipv6_phy call
sometimes modifies data in (at least) the offset range [128:249], suggesting
that it is a buffer larger than 128 bytes in size (the size of our
"phy_init_data" buffer).  When we use our static buffer (prior to this
change), the call could would overwrite the .rodata section and lead to
undefined behaviour.

To address this, just patch the heap-allocated buffer with our data.

Move phy_init_data to flash as it's now readonly and never modified.
2015-12-21 19:18:29 -08:00
a33dba099f fix identation 2015-12-21 13:54:29 +02:00
1ae423021a optimize pwm interrupt handler for better precision 2015-12-21 13:50:29 +02:00
fa7f7bde81 add _verifyHeader and _verifyEnd
_verifyHeader is called before the beginning of the update progress to verify the first byte using peek
_verifyEnd is called on the end before the eboot command is written to verify first byte + flash config

add missing _reset() on timeout
2015-12-20 12:45:36 +01:00
53e01932d3 add magic byte check for Update class
Note: only check of first 0xE9 possible.
2015-12-20 11:46:00 +01:00
898737422e ESP class - move interpretation of magic bytes in function 2015-12-19 14:30:13 +01:00
8032f77476 add missing ! for the checkFlashConfig call 2015-12-18 08:37:25 +01:00
02e6b2fc16 setMD5 has now returns bool
handle setMD5 failed in HTTP update
reset UpdaterClass when MD5 check failed
see: #1244
2015-12-18 08:30:35 +01:00