I'm using a VU7PLUS capacitive touchscreen but the problem occurs even if it's not connected.
I blacklisted the sx865x module but it didn't make a difference.
I was able to see "both" on all 4 GPIO by using the "gpio edge xxx both" command
Unfortunately when I try in in C the last GPIO's edge is always "none".
Here is a simple porgram I used to set and check the GPIO status. The 4th pin is exported but always "none"
Does PITHREAD_CREATE take up an interrupt?
Code: Select all
#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int rot1_pin_a = 10; // rotary 1 pin a
int rot1_pin_b = 26; // rotary 1 pin b
int rot2_pin_a = 22; // rotary 2 pin a
int rot2_pin_b = 4; // rotary 2 pin b
PI_THREAD(rotary_loop)
{
void updateEncoders(void)
{
int r1a = digitalRead(rot1_pin_a);
int r1b = digitalRead(rot1_pin_b);
int r2a = digitalRead(rot2_pin_a);
int r2b = digitalRead(rot2_pin_b);
printf("rot1_pin_a: %d\t", r1a);
printf("rot1_pin_b: %d\t", r1b);
printf("rot2_pin_a: %d\t", r2a);
printf("rot2_pin_b: %d\n\r", r2b);
}
wiringPiISR(rot1_pin_a,INT_EDGE_BOTH, updateEncoders);
wiringPiISR(rot1_pin_b,INT_EDGE_BOTH, updateEncoders);
wiringPiISR(rot2_pin_a,INT_EDGE_BOTH, updateEncoders);
wiringPiISR(rot2_pin_b,INT_EDGE_BOTH, updateEncoders);
delay(10000000);
}
int main(void)
{
wiringPiSetup() ;
pinMode(rot1_pin_a, INPUT);
pinMode(rot1_pin_b, INPUT);
pinMode(rot2_pin_a, INPUT);
pinMode(rot2_pin_b, INPUT);
pullUpDnControl(rot1_pin_a, PUD_UP);
pullUpDnControl(rot1_pin_b, PUD_UP);
pullUpDnControl(rot2_pin_a, PUD_UP);
pullUpDnControl(rot2_pin_b, PUD_UP);
piThreadCreate (rotary_loop) ;
while (1){
delay(5);
}
return 0;
}