attachInterrupt not recognised
Posted: Thu May 18, 2023 9:14 am
I'm doing something very daft somewhere but I can't figure it out. Just starting to play with interrupts (ESP32, VSCode, ESP-IDF Framework, PlatformIO). I've commented my code down to the bare minimum and still get told at Build
Code (trimmed to just what I haven't commented out):
What's the stupid error I must be making please?
Code: Select all
implicit declaration of function 'attachInterrupt'; did you mean 'xthal_get_interrupt'? [-Werror=implicit-function-declaration]
Code: Select all
#include <inttypes.h>
#include <stdio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <sys/time.h>
#include <hd44780.h>
#include <pcf8574.h>
#include <string.h>
#include "driver/gpio.h"
void IRAM_ATTR isr() {
printf("pressed");
}
void setup() {
gpio_set_direction(GPIO_NUM_22, GPIO_MODE_INPUT);
attachInterrupt(22, isr, RISING);
}
void lcd_test(void *pvParameters)
{
while (1){
}
}
void app_main()
{
ESP_ERROR_CHECK(i2cdev_init());
xTaskCreate(lcd_test, "lcd_test", configMINIMAL_STACK_SIZE * 5, NULL, 5, NULL);
}
What's the stupid error I must be making please?