Hallo,
obwohl über diesen Fehler viel geschrieben wurde, habe ich ihn nicht eliminieren können.
Board: genericESP8266 (Di Mini pro) mit Standardeinstellungen.
Muster-Sketch ButtonRotaryEncoder aus der Bibliothek IoAbstaraction
Peripherie. Encoder PinA an D3(GPIO0) und PinB an D4(GPIO2). Encoderswitch an D7(GPIO13) Zusätzlicher Taster an D6(GPIO12).
Mustersketch 1:1 übernommen mit den Änderungen bezüglich der Pinnummer/GPIO.
#include<IoAbstraction.h>
// The pin onto which we connected the rotary encoders switch
const int spinwheelClickPin = 13;
// The pin onto which we connected the repeat button switch
const int repeatButtonPin = 12;
// The two pins where we connected the A and B pins of the encoder. I recomend you dont change these
// as the pin must support interrupts.
const int encoderAPin = 0;
const int encoderBPin = 2;
// the maximum (0 based) value that we want the encoder to represent.
const int maximumEncoderValue = 128;
//
// When the spinwheel is clicked, this function will be run as we registered it as a callback
//
void onSpinwheelClicked(uint8_t pin, bool heldDown) {
Serial.print("Button pressed ");
Serial.println(heldDown ? "Held" : "Pressed");
}
//
// When the repeat button is pressed, this function will be repeatedly called. It's also a callback
//
void onRepeatButtonClicked(uint8_t pin, bool heldDown) {
Serial.println("Repeat button pressed");
}
//
// Each time the encoder value changes, this function runs, as we registered it as a callback
//
// void onEncoderChange(int newValue) {
ICACHE_RAM_ATTR void onEncoderChange(int newValue){
Serial.print("Encoder change ");
Serial.println(newValue);
}
void setup() {
Serial.begin(115200);
// First we set up the switches library, giving it the task manager and tell it to use arduino pins
// We could also of chosen IO through an i2c device that supports interrupts.
// If you want to use PULL DOWN instead of PULL UP logic, change the true to false below.
switches.initialise(ioUsingArduino(), true);
// now we add the switches, we dont want the spinwheel button to repeat, so leave off the last parameter
// which is the repeat interval (millis / 20 basically) Repeat button does repeat as we can see.
switches.addSwitch(spinwheelClickPin, onSpinwheelClicked);
switches.addSwitch(repeatButtonPin, onRepeatButtonClicked, 25);
// now we set up the rotary encoder, first we give the A pin and the B pin.
// we give the encoder a max value of 128, always minumum of 0.
setupRotaryEncoderWithInterrupt(encoderAPin, encoderBPin, onEncoderChange);
switches.changeEncoderPrecision(maximumEncoderValue, 100);
}
void loop() {
taskManager.runLoop();
}
Wegen des Fehlers ISR is not in IRAM habe ich das ICACHE_RAM_ATTR vor void onEncoderChange(int newValue) hinzugefügt. Normalerweise sollte die Fehlermeldung verschwunden sein. Bei mir aber nicht. Ich bekomme in regelmäßigen Abständen ein Reboot irgendwoher.
Auf Serial:
>>>stack>>>
ctx: cont
sp: 3ffffd30 end: 3fffffc0 offset: 01b0
3ffffee0: 00000000 4bc6a7f0 ac49ba5e 00000000
3ffffef0: 00000000 00000000 4bc6a7f0 00000000
3fffff00: 00000002 00000002 3ffee2e4 40100492
3fffff10: 00000000 feefeffe feefeffe 402011de
3fffff20: 0000499f feefeffe feefeffe 40201d68
3fffff30: 4020368d 402037f6 00000100 40201551
3fffff40: 00000000 3ffee27c 3ffef44c 4020163c
3fffff50: 00000000 401000a0 00000014 00000002
3fffff60: 00000000 401000a0 3ffee27c 4020168a
3fffff70: 3ffef44c 00000000 00000004 402015b4
3fffff80: 3fffdad0 00000000 3ffee27c 3ffee550
3fffff90: 3fffdad0 00000000 3ffee27c 402010cc
3fffffa0: feefeffe feefeffe 3ffee520 40202850
3fffffb0: feefeffe feefeffe 3ffe84f4 4010077d
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v8b899c12
~ld
ISR not in IRAM!
Abort called
Ich weiß jetzt nicht wo ich weitersuchen sollte. Wer kann helfen?
Viele Grüße
Eberhard