Using Function Pointer from struct in PROGMEM in C on Arduino
<p>I am trying to read a function pointer from a structure stored in PROGMEM, then passing a value (input) to the corresponding function and save the returned value, but i can not find the correct syntax.</p>

<pre><code>uint8_t (*pStateFunc) (uint8_t);
uint8_t input; 
uint8_t nextstate;

enum MENUSTATES {STATE1, STATE2};

typedef struct PROGMEM {
  unsigned char state;
  uint16_t someNumber;   // Just arbitrary information
  uint8_t (*pFunc) (uint8_t input);
} MENU_STATE;

const MENU_STATE menu_state[] PROGMEM = {
  //  state  someNumber  pFunc
  {STATE1,   2,          NULL}, 
  {STATE2,   4,          doSomething},
  {0,        0,          NULL}
  };


// Get the Function 
pStateFunc = (PGM_VOID_P) pgm_read_byte(&amp;menu_state[1].pFunc); 

// Execute the Function and save the returned state
nextstate = pStateFunc(input);

// Function Definition
uint8_t doSomething(u8int_t input){
    return STATE1;
}
</code></pre>

<p>All i get is the following error from the Arduino IDE 1.6.5:</p>

<pre><code>invalid conversion from 'const void*' to 'uint8_t (*)(uint8_t) {aka unsigned char (*)(unsigned char)}' [-fpermissive]
</code></pre>

<p>How can i read the function from PROGMEM and execute it correctly?</p>