problem using uint32_t return argument in EFR32FG14

Thread Starter

yef smith

Joined Aug 2, 2020
699
Hello, I am trying to store the value which returns GPIO_IntGet function.
the function it self is shown in the end ,
I have defined a uint32_t variable and put it on the left side of the function signature.
How ever i get an error.
Where did i go wrong in collecting the retuned value?

Code:
// Clear all even pin interrupt flags
    uint32_t res;
    res=GPIO_IntGet(void);
ERROR:
^~~~~~~~~~~
C:/Users/Asus/Documents/peripheral_examples-master/peripheral_examples-master/series1/gpio/switch_led_interrupt/src/main_s1.c:51:11: warning: variable 'res' set but not used [-Wunused-but-set-variable]
uint32_t res;
^~~
make: *** [src/main_s1.o] Error 1

01:18:37 Build Finished (took 1s.227ms)

View attachment 181046

View attachment 181047
 

nsaspook

Joined Aug 27, 2009
12,861
Hello, I am trying to store the value which returns GPIO_IntGet function.
the function it self is shown in the end ,
I have defined a uint32_t variable and put it on the left side of the function signature.
How ever i get an error.
Where did i go wrong in collecting the retuned value?

Code:
// Clear all even pin interrupt flags
    uint32_t res;
    res=GPIO_IntGet(void);
ERROR:
^~~~~~~~~~~
C:/Users/Asus/Documents/peripheral_examples-master/peripheral_examples-master/series1/gpio/switch_led_interrupt/src/main_s1.c:51:11: warning: variable 'res' set but not used [-Wunused-but-set-variable]
uint32_t res;
^~~
make: *** [src/main_s1.o] Error 1

01:18:37 Build Finished (took 1s.227ms)

View attachment 181046

View attachment 181047
It's a warning for not using res after it's been set but you have a compile option somewhere to upgrade that warning to a compile error.

The solution is easy, actually use res.
 
Top