mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 05:36:39 +00:00
Prepare for next core version
Prepare for next core version using updated PWM library
This commit is contained in:
parent
baa46d3caa
commit
88455b696c
@ -18,6 +18,10 @@
|
|||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
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 "wiring_private.h"
|
||||||
#include "pins_arduino.h"
|
#include "pins_arduino.h"
|
||||||
|
|
||||||
@ -101,3 +105,5 @@ void ICACHE_RAM_ATTR timer0_detachInterrupt() {
|
|||||||
timer0_user_cb = NULL;
|
timer0_user_cb = NULL;
|
||||||
ETS_CCOMPARE0_DISABLE();
|
ETS_CCOMPARE0_DISABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
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
|
#define ARDUINO_MAIN
|
||||||
#include "wiring_private.h"
|
#include "wiring_private.h"
|
||||||
#include "pins_arduino.h"
|
#include "pins_arduino.h"
|
||||||
@ -130,12 +134,12 @@ void ICACHE_RAM_ATTR interrupt_handler(void *arg) {
|
|||||||
while(!(changedbits & (1 << i))) i++;
|
while(!(changedbits & (1 << i))) i++;
|
||||||
changedbits &= ~(1 << i);
|
changedbits &= ~(1 << i);
|
||||||
interrupt_handler_t *handler = &interrupt_handlers[i];
|
interrupt_handler_t *handler = &interrupt_handlers[i];
|
||||||
if (handler->fn &&
|
if (handler->fn &&
|
||||||
(handler->mode == CHANGE ||
|
(handler->mode == CHANGE ||
|
||||||
(handler->mode & 1) == !!(levels & (1 << i)))) {
|
(handler->mode & 1) == !!(levels & (1 << i)))) {
|
||||||
// to make ISR compatible to Arduino AVR model where interrupts are disabled
|
// to make ISR compatible to Arduino AVR model where interrupts are disabled
|
||||||
// we disable them before we call the client ISR
|
// 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)
|
if (handler->arg)
|
||||||
{
|
{
|
||||||
((voidFuncPtrArg)handler->fn)(handler->arg);
|
((voidFuncPtrArg)handler->fn)(handler->arg);
|
||||||
@ -197,7 +201,7 @@ void initPins() {
|
|||||||
for (int i = 12; i <= 16; ++i) {
|
for (int i = 12; i <= 16; ++i) {
|
||||||
pinMode(i, INPUT);
|
pinMode(i, INPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
|
ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
|
||||||
ETS_GPIO_INTR_ENABLE();
|
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 attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
|
||||||
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
|
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
|
||||||
|
|
||||||
|
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
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 "wiring_private.h"
|
||||||
#include "pins_arduino.h"
|
#include "pins_arduino.h"
|
||||||
#include "c_types.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 analogWrite(uint8_t pin, int val) __attribute__ ((weak, alias("__analogWrite")));
|
||||||
extern void analogWriteFreq(uint32_t freq) __attribute__ ((weak, alias("__analogWriteFreq")));
|
extern void analogWriteFreq(uint32_t freq) __attribute__ ((weak, alias("__analogWriteFreq")));
|
||||||
extern void analogWriteRange(uint32_t range) __attribute__ ((weak, alias("__analogWriteRange")));
|
extern void analogWriteRange(uint32_t range) __attribute__ ((weak, alias("__analogWriteRange")));
|
||||||
|
|
||||||
|
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user