#include <sys/neutrino.h>

int interruptID;

const struct sigevent *
intHandler (void *arg, int id)
{
    ...
}

int
main (int argc, char **argv)
{
    ...
    interruptID = InterruptAttach (HW_SERIAL_IRQ, 
                                   intHandler, 
                                   &event, 
                                   sizeof (event), 
                                   0);
    if (interruptID == -1) {
        fprintf (stderr, "%s:  can't attach to IRQ %d\n",  
                 progname, HW_SERIAL_IRQ);
        perror (NULL);
        exit (EXIT_FAILURE);
    }
    ...
    return (EXIT_SUCCESS);
}

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2021-07-15
  • 2021-09-28
  • 2021-12-24
  • 2021-07-27
  • 2021-08-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-15
  • 2021-05-19
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案