Hi,
My aim is to call a member function without an object is created, therefore I resorted to using a static function. This function's purpose is to toggle some LEDs and change the frequency of interrupt service routine. Code snippet:
"
class Flags
{
public:
volatile static bool IP_flag;
volatile static bool IP_flag2;
static void changeFreq();
private:
LEDs LED[8] = {LED8,LED6,LED4,LED3,LED5,LED7,LED9,LED10};
};
volatile bool Flags::IP_flag {};
volatile bool Flags::IP_flag2{};// both set to 0/false
void Flags::changeFreq()
{
LED[3].toggle();
LED[7].toggle();// toggle the red LEDs
/* other code */
}
"
error: invalid use of member 'Flags::LED' in static member function
How to fix this error?
(Note: The full code cannot be provided as it contains large libraries for a microcontroller. )