From mailserv@gaia.ucs.orst.edu Mon Nov 21 14:21:53 1994
Precedence: Bulk
Date: Mon Nov 21 12:19:54 PST 1994
From: gus-sdk-request@gaia.ucs.orst.edu (GUS Programmer's Server)
Reply-To: gus-sdk@gaia.ucs.orst.edu (GUS Programmer's Digest)
Subject: GUS Programmer's Digest V14 #8

GUS Programmer's Digest     Mon, 21 Nov 94 12:19 PST     Volume 14: Issue   8 

Today's Topics:
                              interrupts

Standard Info:
	- Meta-info about the GUS can be found at the end of the Digest.
	- Before you ask a question, please READ THE FAQ.

----------------------------------------------------------------------

Date: Sun, 20 Nov 94 19:34:21 PST
From: toby@ccmrc.ucsb.edu (Toby Shepard)
Subject: interrupts

*********** completely bald at this point *******


Ok, so I'm not using printf() in my handler anymore, in fact
what could be more simple than this?


#includes......

unsigned char in;

void
main(int argc,char *argv[])

{
void midi(unsigned int,unsigned int);  /* my handler for midi in */
ULTRA_CFG config;

	UltraGetCfg(&config);
	UltraOpen(&config,14);

	UltraMidiRecvHandler(midi);
	UltraMidiEnableRecv();

	/* continue to report any incomming midi values */
	while(!kbhit()){
		if(in != 0){
			printf("got one!:%d\n",in);
			in = 0;
		}
	}

	UltraClose();
}

/** my "callback" **/

void midi(status,data)
unsigned int status;
unsigned int data;
{
/*ENTER_CRITICAL;  I tried it with and without these, just a thought */

in = data;

/*LEAVE_CRITICAL;*/
return ;
}

When I try this I either get stack overflow, or I get a response to
about four or five midi bytes ( and there codes are reflected correctly!)
and then nothing more.  What's strange is that I can touch a key and
return normally(?).

What is the big interrupt mystery here?
I have done what the sdk tells me (I think).
If nobody can find something wrong with my code, could you please
send me some code that works?  Any thing that defines interrupt callbacks
through the SDK.  Or maybe just tell me where to find some?

Thanks, I am one of those unfortunates who are doing projects this quarter
involving the GUS.  *finals are just around the corner*
             


	

------------------------------

End of GUS Programmer's Digest V14 #8
*************************************

To post to tomorrow's digest:                    <gus-sdk@mail.orst.edu>
To (un)subscribe or get help:            <gus-sdk-request@mail.orst.edu>
To contact a human (last resort):          <gus-sdk-owner@mail.orst.edu>

                       FTP Sites                     Archive Directories
                       ---------                     -------------------
Main N.American Site:  archive.orst.edu              pub/packages/gravis
                       wuarchive.wustl.edu           systems/ibmpc/ultrasound
Main Asian Site:       nctuccca.edu.tw               PC/ultrasound
Main European Site:    src.doc.ic.ac.uk              packages/ultrasound
Main Australian Site:  ftp.mpx.com.au                /ultrasound/general
                                                     /ultrasound/submit
South African Site:    ftp.sun.ac.za                 /pub/packages/ultrasound
Submissions:           archive.epas.utoronto.ca      pub/pc/ultrasound/submit
Newly Validated Files: archive.epas.utoronto.ca      pub/pc/ultrasound

Mirrors:               garbo.uwasa.fi                mirror/ultrasound
                       ftp.st.nepean.uws.edu.au      pc/ultrasound
                       ftp.luth.se                   pub/msdos/ultrasound

                       Gopher Sites                  Menu directory
                       ------------                  --------------
Main Site:             src.doc.ic.ac.uk              packages/ultrasound

                       WWW Pages
                       ---------
Main Site:             http://www.cs.utah.edu/~debry/gus.html

Main European Site:    http://src.doc.ic.ac.uk/packages/ultrasound/
Main Australian Site:  http://ftp.mpx.com.au/archive/ultrasound/general/
                       http://ftp.mpx.com.au/archive/ultrasound/submit/
                       http://ftp.mpx.com.au/gravis.html
                       
Mirrors:               http://www.st.nepean.uws.edu.au/pub/pc/ultrasound/

MailServer For Archive Access: Email to <mail-server@nike.rz.uni-konstanz.de>
                               Email to <ftpmail@doc.ic.ac.uk>

New Submit Files Mailing List: Email to <listproc@uni-konstanz.de>
                         with content "subscribe epas-list <your-name-here>"

Hints:
      - Get the FAQ from the FTP sites or the request server.
      - Mail to <gus-sdk-request@mail.orst.edu> for info about other GUS
	related mailing lists (general use, musician's, etc.).


