Skip to content

Commit c170794

Browse files
authored
Merge pull request #13 from Jason2866/2.7.4.9
2.7.4.9
2 parents df54dc8 + 5d6b884 commit c170794

32 files changed

+6872
-6280
lines changed

README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip
33

44
# Quick links
55

6-
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.4/)
6+
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.4_a/)
77
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
88
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))
99

@@ -30,13 +30,13 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
3030

3131
- Install the current upstream Arduino IDE at the 1.8.9 level or later. The current version is on the [Arduino website](https://www.arduino.cc/en/main/software).
3232
- Start Arduino and open the Preferences window.
33-
- Enter ```https://arduino.esp8266.com/stable/package_esp8266com_index.json``` into the *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
33+
- Enter ```https://arduino.esp8266.com/stable/package_esp8266com_index.json``` into the *File>Preferences>Additional Boards Manager URLs* field of the Arduino IDE. You can add multiple URLs, separating them with commas.
3434
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
3535

3636
#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
3737
Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`
3838

39-
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.4/](https://arduino-esp8266.readthedocs.io/en/2.7.4/)
39+
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.4_a/](https://arduino-esp8266.readthedocs.io/en/2.7.4_a/)
4040

4141
### Using git version
4242
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
@@ -108,7 +108,7 @@ ESP8266 core includes an xtensa gcc toolchain, which is also under GPL.
108108

109109
Esptool.py was initially created by Fredrik Ahlberg (@themadinventor, @kongo), and is currently maintained by Angus Gratton (@projectgus) under GPL 2.0 license.
110110

111-
Espressif SDK included in this build is under Espressif MIT License.
111+
[Espressif's NONOS SDK](https://github.com/espressif/ESP8266_NONOS_SDK) included in this build is under Espressif MIT License.
112112

113113
ESP8266 core files are licensed under LGPL.
114114

@@ -118,8 +118,6 @@ ESP8266 core files are licensed under LGPL.
118118

119119
[SoftwareSerial](https://github.com/plerup/espsoftwareserial) library and examples written by Peter Lerup. Distributed under LGPL 2.1.
120120

121-
[axTLS](http://axtls.sourceforge.net/) library written by Cameron Rich, built from https://github.com/igrr/axtls-8266, is used in this project. It is distributed under [BSD license](https://github.com/igrr/axtls-8266/blob/master/LICENSE).
122-
123121
[BearSSL](https://bearssl.org) library written by Thomas Pornin, built from https://github.com/earlephilhower/bearssl-esp8266, is used in this project. It is distributed under the [MIT License](https://bearssl.org/#legal-details).
124122

125123
[LittleFS](https://github.com/ARMmbed/littlefs) library written by ARM Limited and released under the [BSD 3-clause license](https://github.com/ARMmbed/littlefs/blob/master/LICENSE.md).

boards.txt

+6,083-6,137
Large diffs are not rendered by default.

cores/esp8266/Tone.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ static void _startTone(uint8_t _pin, uint32_t high, uint32_t low, uint32_t durat
3030
return;
3131
}
3232

33+
#ifndef WAVEFORM_LOCKED_PHASE
3334
// Stop any analogWrites (PWM) because they are a different generator
3435
_stopPWM(_pin);
36+
#endif
3537
// If there's another Tone or startWaveform on this pin
3638
// it will be changed on-the-fly (no need to stop it)
3739

cores/esp8266/core_esp8266_waveform.h

+5-81
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,7 @@
1-
/*
2-
esp8266_waveform - General purpose waveform generation and control,
3-
supporting outputs on all pins in parallel.
4-
5-
Copyright (c) 2018 Earle F. Philhower, III. All rights reserved.
6-
7-
The core idea is to have a programmable waveform generator with a unique
8-
high and low period (defined in microseconds or CPU clock cycles). TIMER1 is
9-
set to 1-shot mode and is always loaded with the time until the next edge
10-
of any live waveforms.
11-
12-
Up to one waveform generator per pin supported.
13-
14-
Each waveform generator is synchronized to the ESP clock cycle counter, not the
15-
timer. This allows for removing interrupt jitter and delay as the counter
16-
always increments once per 80MHz clock. Changes to a waveform are
17-
contiguous and only take effect on the next waveform transition,
18-
allowing for smooth transitions.
19-
20-
This replaces older tone(), analogWrite(), and the Servo classes.
21-
22-
Everywhere in the code where "cycles" is used, it means ESP.getCycleCount()
23-
clock cycle count, or an interval measured in CPU clock cycles, but not TIMER1
24-
cycles (which may be 2 CPU clock cycles @ 160MHz).
25-
26-
This library is free software; you can redistribute it and/or
27-
modify it under the terms of the GNU Lesser General Public
28-
License as published by the Free Software Foundation; either
29-
version 2.1 of the License, or (at your option) any later version.
30-
31-
This library is distributed in the hope that it will be useful,
32-
but WITHOUT ANY WARRANTY; without even the implied warranty of
33-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34-
Lesser General Public License for more details.
35-
36-
You should have received a copy of the GNU Lesser General Public
37-
License along with this library; if not, write to the Free Software
38-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
39-
*/
40-
41-
#include <Arduino.h>
42-
43-
#ifndef __ESP8266_WAVEFORM_H
44-
#define __ESP8266_WAVEFORM_H
45-
46-
#ifdef __cplusplus
47-
extern "C" {
48-
#endif
49-
50-
// Start or change a waveform of the specified high and low times on specific pin.
51-
// If runtimeUS > 0 then automatically stop it after that many usecs.
52-
// Returns true or false on success or failure.
53-
int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t runTimeUS);
54-
// Start or change a waveform of the specified high and low CPU clock cycles on specific pin.
55-
// If runtimeCycles > 0 then automatically stop it after that many CPU clock cycles.
56-
// Returns true or false on success or failure.
57-
int startWaveformClockCycles(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles);
58-
// Stop a waveform, if any, on the specified pin.
59-
// Returns true or false on success or failure.
60-
int stopWaveform(uint8_t pin);
61-
62-
// Add a callback function to be called on *EVERY* timer1 trigger. The
63-
// callback returns the number of microseconds until the next desired call.
64-
// However, since it is called every timer1 interrupt, it may be called
65-
// again before this period. It should therefore use the ESP Cycle Counter
66-
// to determine whether or not to perform an operation.
67-
// Pass in NULL to disable the callback and, if no other waveforms being
68-
// generated, stop the timer as well.
69-
// Make sure the CB function has the ICACHE_RAM_ATTR decorator.
70-
void setTimer1Callback(uint32_t (*fn)());
71-
72-
73-
74-
// Internal-only calls, not for applications
75-
extern void _setPWMFreq(uint32_t freq);
76-
extern bool _stopPWM(int pin);
77-
extern bool _setPWM(int pin, uint32_t val, uint32_t range);
78-
79-
#ifdef __cplusplus
80-
}
81-
#endif
1+
// Wrapper to include both versions of the waveform generator
822

3+
#ifdef WAVEFORM_LOCKED_PHASE
4+
#include "core_esp8266_waveform_phase.h"
5+
#else
6+
#include "core_esp8266_waveform_pwm.h"
837
#endif

0 commit comments

Comments
 (0)