Exemple #1
0
PRIVATE void msg_hardware(void) {

	u32_t     i;
	int j = 0;

	dprint("%s: handling hardware message\n", drv.DriverName);

	/* while we have an interrupt  */
	while ( drv_int_sum()) {
		/* loop over all sub devices */
		for ( i = 0; i < drv.NrOfSubDevices; i++) {
			/* if interrupt from sub device and Dma transfer 
			   was actually busy, take care of business */
			if( drv_int(i) && sub_dev[i].DmaBusy ) {
				if (sub_dev[i].DmaMode == DEV_WRITE_S) handle_int_write(i);
				if (sub_dev[i].DmaMode == DEV_READ_S) handle_int_read(i);  
			}
		}
	}

	/* As IRQ_REENABLE is not on in sys_irqsetpolicy, we must
	 * re-enable out interrupt after every interrupt.
	 */
	if ((sys_irqenable(&irq_hook_id)) != OK) {
	  error("%s: msg_hardware: Couldn't enable IRQ\n", drv.DriverName);
	}
}
PRIVATE void msg_hardware(void) {
  
  u32_t     i;
  int j = 0;
  
  dprint("%s: handling hardware message\n", drv.DriverName);
  
  /* while we have an interrupt  */
  while ( drv_int_sum()) {
    /* loop over all sub devices */
    for ( i = 0; i < drv.NrOfSubDevices; i++) {
      /* if interrupt from sub device and Dma transfer 
         was actually busy, take care of business */
      if( drv_int(i) && sub_dev[i].DmaBusy ) {
        if (sub_dev[i].DmaMode == DEV_WRITE) handle_int_write(i);
        if (sub_dev[i].DmaMode == DEV_READ) handle_int_read(i);  
      }
    }
  }
}