04.06.2013 Views

Dynamic C function reference

Dynamic C function reference

Dynamic C function reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• isr_ptr getvect( unsigned intrno )<br />

Gets the address of the handler of interrupt number intrno. For this<br />

<strong>function</strong>, number must be even and less than 255. The <strong>function</strong> returns<br />

the address of the handler. The type isr_ptr is a pointer to a <strong>function</strong><br />

that returns void and takes no arguments.<br />

• void setvect( unsigned intrno, isr_ptr isr )<br />

Sets a new handler isr for interrupt number intrno. The term<br />

intrno must be even and less than 255. The type isr_ptr is a<br />

pointer to a <strong>function</strong> that returns void and takes no arguments.<br />

• int iff( void )<br />

Checks whether the interrupt flag is on. The <strong>function</strong> returns 1 if the<br />

interrupt flag is on, and 0 otherwise.<br />

• void setireg( char value )<br />

Sets the Z180 interrupt register with the upper 8 bits of the specified<br />

16-bit value.<br />

• char readireg( void )<br />

Returns the value of the Z180 interrupt register as the upper 8 bits of<br />

the returned value. The lower 8 bits are set to zero.<br />

• void _prot_init( void )<br />

Performs super initialization. The <strong>function</strong> initializes internal data<br />

needed for recovery of protected variables after a crash. To ensure<br />

that the protection mechanism works, call this <strong>function</strong> once in a<br />

program before any protected variables are set.<br />

• void _prot_recover( void )<br />

Performs recovery of a partially completed assignment to a protected<br />

variable. Call this <strong>function</strong> after a power failure or a similar<br />

situation that does not lose memory.<br />

• void reload_vec( unsigned vector, int(*isr)() )<br />

Loads an interrupt service routine to specified vector location at run<br />

time. vector is the interrupt vector to be served, *isr is the address<br />

of the interrupt service routine.<br />

reload_vec writes to the Flash EPROM memory when<br />

executed on a controller which is Flash EPROM equipped.<br />

Since <strong>Dynamic</strong> C 32 v. 6.30, reload_vec prevents rewriting<br />

!<br />

existing Flash data because the Flash has a maximum life of<br />

about 10,000 writes. Exercise care to ensure that the application<br />

does not call reload_vec to write different data repeatedly<br />

to the same Flash address.<br />

34 s General Support Libraries<br />

<strong>Dynamic</strong> C 32 v. 6.x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!