title: Convert void (*)() to void (*)(unsigned char)
body: <p>I'm trying to convert a <code>void (*)()</code> to <code>void (*)(unsigned char)</code> but my knowledge in C++ isn't good enough. I searched, but I could not find any examples. So I thought to create a function of function but I get some error:</p>
  
  <pre><code>typedef void (* voidFuncPtr)();
  void castHandler(voidFuncPtr handler)(uint8_t gpio_num)
  {
      handler();
  }
  
  void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode)
  {
      // typedef void (* voidFuncPtr)();
      // typedef void (* gpio_interrupt_handler_t)(uint8_t gpio_num);
      // typedef void (* gpio_interrupt_handler_t)(unsigned char)
      gpio_set_interrupt(pin, GPIO_INTTYPE_EDGE_ANY, castHandler(handler));
  }
  </code></pre>
  
  <blockquote>
    <p>error: 'castHandler' declared as function returning a function  void
    castHandler(voidFuncPtr handler)(uint8_t gpio_num)</p>
    
    <p>error: 'castHandler' was not declared in this scope
         gpio_set_interrupt(pin, GPIO_INTTYPE_EDGE_ANY, castHandler(handler));</p>
  </blockquote>
  
  <p>Can someone help me?</p>