Results 1 to 7 of 7

Thread: [RESOLVED] void pointer to interrupt function

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Resolved [RESOLVED] void pointer to interrupt function

    Hi All

    I am working with Hi-Tech's HC51-Lite compiler...its a nightmare.

    I am trying to assign an ISR to run on a certain interrupt vector.
    The Hi-Tech manual recommends a couple techniques only one of which works in my version: using inline asm code. The asm code means I need obtain a pointer to the ISR so I can place this in the ACC and thus reference it in the asm section.
    My current C code to do this is:
    Code:
    // ISR name= interrupt void ext1isr (void)
    	void (*pisr)(void);
    	pisr = &ext1isr;  // Line 23
    	ACC = ((int*)pisr);  // Line 24
    But the compiler gives me errors:

    Error : 23 undefined identifier "ext1isr"
    Warning : 23 illegal conversion between pointer types
    Warning : 24 illegal conversion of pointer to integer

    Frankly void pointers and pointers to functions are outside my level of knowledge so any help much appreciated.
    Thanks

    EDIT: just tried: interrupt voide (*pisr) (void); but no change
    Last edited by wolf99; Jan 19th, 2012 at 06:23 AM.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width