cancel
Showing results for 
Search instead for 
Did you mean: 

STM82103F programming issue

gavin3
Associate II

HI Guys,

 now I use STM8S103F2 series MCU develop, find there was some issue that can not solve, but i checked that bool types constant has no problem, so do you have same issue? thanks!

gavin3_0-1701829793263.png

 

3 REPLIES 3
TDK
Guru

Looks like the problem is BUTTON_TYPE_MAX. How is that defined? The definition isn't in your screenshot.

It needs to be a #defined constant in order for the compiler to know how big the arrays should be. It can't be a variable.

If you feel a post has answered your question, please click "Accept as Solution".
gavin3
Associate II

I put it is button.h files, following :

gavin3_0-1701833172879.png

 

TDK
Guru

And what happens if you #define it as 2 instead?

If you feel a post has answered your question, please click "Accept as Solution".