#: 21483 S12/OS9/68000 (OSK)
11-Oct-96 08:48:13
Sb: #21482-#Fast IRQ
Fm: J. Eberbach 106147,521
To: J. Eberbach 106147,521 (X)
since noone ever replied, and since I also didn'T get any help from Microware
or Dr. Keil, I had to find out for myself.
So here is an example:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "/mwos/os9/src/defs/machine/reg.h"
/*make this program system state */
_asm("_sysattr: equ 0xA001");
/**********************************************************************/
int irqsvc_f_t1();
void *get_global_base(void);
int irq_timer1(char *system_globals) {
/* do your interrupt service */
return(0);
}
/**********************************************************************/
#define CLEAN_UP \
/* cleanup paths */ \
prc->_path[0]=0; \
prc->_path[1]=0; \
prc->_path[2]=0;
main () {
error_code err;
register procid *prc = sysglob(procid*, D_Proc);
/* fix up standard i/o for a system state process */
stdin -> _fd = prc->_path[0];
stdout -> _fd = prc->_path[1];
stderr -> _fd = prc->_path[2];
_from_new(stdin); _from_new(stdout); _from_new(stderr);
/* install interrupt service routines */
if (err = _os_firq(VMEVT1, 0, irqsvc_f_t1, get_global_base()))
exit(_errmsg(error, "Can't install timer1 interrupt service
routine.\n"));
else{
printf ("Timer1 Interrupt service routine installed!\n");
}
/* Setup hardware to produce interrupts */
/* enable interrupts */
/* do your stuff */
/* disable inhrwhu
atRsO- ema eae0(-2mreoditrprsoeeoteVE2 odbalt ae,M,b omsapctn
tsrbb o ng.
Rad,
JtPs
|