How to disable and anable this function "attachInterrupt" when when i call the action server.on("/update", HTTP_POST, .
attachInterrupt(digitalPinToInterrupt(buttonPin), pulseCounter, RISING);//
server.on("/update", HTTP_POST, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
ESP.restart();
}, []() {
HTTPUpload& upload = server.upload();
});
example :
if(update )
{
attachInterrupt(digitalPinToInterrupt(buttonPin), pulseCounter, RISING);// Desable
}else{
attachInterrupt(digitalPinToInterrupt(buttonPin), pulseCounter, RISING);// enable