Prepare for next core version

Prepare for next core version using updated PWM library
This commit is contained in:
Theo Arends 2018-08-02 17:45:09 +02:00
parent baa46d3caa
commit 88455b696c
3 changed files with 21 additions and 4 deletions

View File

@ -18,6 +18,10 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <core_version.h>
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
#warning **** Tasmota is using v2.4.0 timer.c as planned ****
#include "wiring_private.h"
#include "pins_arduino.h"
@ -101,3 +105,5 @@ void ICACHE_RAM_ATTR timer0_detachInterrupt() {
timer0_user_cb = NULL;
ETS_CCOMPARE0_DISABLE();
}
#endif // ARDUINO_ESP8266_RELEASE_2_3_0

View File

@ -18,6 +18,10 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <core_version.h>
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
#warning **** Tasmota is using v2.4.0 wiring_digital.c as planned ****
#define ARDUINO_MAIN
#include "wiring_private.h"
#include "pins_arduino.h"
@ -130,12 +134,12 @@ void ICACHE_RAM_ATTR interrupt_handler(void *arg) {
while(!(changedbits & (1 << i))) i++;
changedbits &= ~(1 << i);
interrupt_handler_t *handler = &interrupt_handlers[i];
if (handler->fn &&
(handler->mode == CHANGE ||
if (handler->fn &&
(handler->mode == CHANGE ||
(handler->mode & 1) == !!(levels & (1 << i)))) {
// to make ISR compatible to Arduino AVR model where interrupts are disabled
// we disable them before we call the client ISR
uint32_t savedPS = xt_rsil(15); // stop other interrupts
uint32_t savedPS = xt_rsil(15); // stop other interrupts
if (handler->arg)
{
((voidFuncPtrArg)handler->fn)(handler->arg);
@ -197,7 +201,7 @@ void initPins() {
for (int i = 12; i <= 16; ++i) {
pinMode(i, INPUT);
}
ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
ETS_GPIO_INTR_ENABLE();
}
@ -208,3 +212,4 @@ extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")
extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
#endif // ARDUINO_ESP8266_RELEASE_2_3_0

View File

@ -18,6 +18,10 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <core_version.h>
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
#warning **** Tasmota is using v2.4.0 wiring_pwm.c as planned ****
#include "wiring_private.h"
#include "pins_arduino.h"
#include "c_types.h"
@ -219,3 +223,5 @@ extern void __analogWriteRange(uint32_t range)
extern void analogWrite(uint8_t pin, int val) __attribute__ ((weak, alias("__analogWrite")));
extern void analogWriteFreq(uint32_t freq) __attribute__ ((weak, alias("__analogWriteFreq")));
extern void analogWriteRange(uint32_t range) __attribute__ ((weak, alias("__analogWriteRange")));
#endif // ARDUINO_ESP8266_RELEASE_2_3_0