Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By sh4d0w
#15102
Code saved to ROM have limitation: it can't be called from interrupt, because flash cahe can be disabled in that time. Sming, by default, store all user code to ROM, so you should add attribute IRAM_ATTR to your handler method.
If you will build small example of interrupt usage, it will be really great to make pull-request of that!


Awesome, thanks! Will try it out.

Once I have it working I will make a pull request.
User avatar
By sh4d0w
#15202 Hey anakod,

so I tried the following:
Code: Select all#include <user_config.h>
#include <SmingCore/SmingCore.h>
//#include "myInterrupts.h"

#define IR_PIN 12 // GPIO12

void IRAM_ATTR inter_call()
{
   //interruptMode(IR_PIN, 99); // Disable interupts
   Serial.println("Interupting...");
}

void init()
{
   Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
   Serial.println("Setting up...");
   attachInterrupt(IR_PIN, inter_call, RISING);
   interrupts();
   Serial.println("Ready...");
}


and it still failed.

I then went on to hack your interrupt code, mainly changing your InterruptHandler.
Code: Select allstatic void IRAM_ATTR interruptHandler(void *arg)
{
   gpio_pin_intr_state_set(GPIO_ID_PIN(interrupt_pin), GPIO_PIN_INTR_DISABLE);
   GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, BIT(interrupt_pin));
   tempCallback();
}


and it worked perfectly.
Am I missing something?

I will experiment a bit more when I get a chance but the issue seems to be with this line
Code: Select allGPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, gpio_status & BIT(i));

It just gets stuck there.

I can move on using my altered interrupt code but would also like to help you solve this bug if it is indeed one.
User avatar
By j0hncc
#15250
anakod wrote:MQTT was added
First commit.

Based on popular powerful library libemqtt for best compatibility with MQTT protocol but provide standard Sming high level access methods.


This is great!!! But how is the best way to import the new sming with mqtt into Eclipse workspace that already has the existing Sming?