Compilation error: base operand of '->' is not a pointer
Posted: Thu Jan 23, 2025 2:52 pm
Hi guys, I am using an STM 32 F401CEU6 Black Pill Board, in this I am trying to build a program that triggers an interrupt when it detects a state change on pin PB10 of the STM.
BELOW IS MY CODE
===============================================================================================================================
uint32_t now, receiver_input1, receiver_input1_previous;
void setup() {
Serial.begin(57600);
attachInterrupt(PB10, ch1, CHANGE);
// put your setup code here, to run once:
}
void loop() {
delayMicroseconds(3500);
Serial.println(receiver_input1); // put your main code here, to run repeatedly:
}
void ch1(){
now = micros();
if(0B1 & GPIOB_BASE->IDR >> 10 )receiver_input1_previous = now;
else receiver_input1 = now - receiver_input1_previous;
}
===============================================================================================================================
I am getting a compilation error on if(0B1 & GPIOB_BASE->IDR >> 10 ), where it is saying base operand of '->' is not a pointer.
I hope someone can help.
Thanks
BELOW IS MY CODE
===============================================================================================================================
uint32_t now, receiver_input1, receiver_input1_previous;
void setup() {
Serial.begin(57600);
attachInterrupt(PB10, ch1, CHANGE);
// put your setup code here, to run once:
}
void loop() {
delayMicroseconds(3500);
Serial.println(receiver_input1); // put your main code here, to run repeatedly:
}
void ch1(){
now = micros();
if(0B1 & GPIOB_BASE->IDR >> 10 )receiver_input1_previous = now;
else receiver_input1 = now - receiver_input1_previous;
}
===============================================================================================================================
I am getting a compilation error on if(0B1 & GPIOB_BASE->IDR >> 10 ), where it is saying base operand of '->' is not a pointer.
I hope someone can help.
Thanks