AMX 68000 Target Guide
K
A
DAK
B-17
cjcfvol8 cjcfvol8cjcfvol16 cjcfvol16cjcfvol32 cjcfvol32cjcfvolpntr cjcfvolpntr
Purpose Fetch a Volatile 8-Bit, 16-Bit, 32-Bit or Pointer Value
Use these procedures to fetch the content of a volatile variable if the C
compiler does not support the C keyword volatile. These procedures (or
macros) also guarantee that multiple byte fetches will be done in an
indivisible fashion.
Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure
Setup Prototype in file
CJZZZTF.H or macro in file
CJZZZCC.H.
#include "CJZZZ.H"
CJ_T8 CJ_CCPP cjcfvol8(void *varp);
CJ_T16 CJ_CCPP cjcfvol16(void *varp);
CJ_T32 CJ_CCPP cjcfvol32(void *varp);
void * CJ_CCPP cjcfvolpntr(void *pntrp);
Description varp is a pointer to an 8, 16 or 32-bit variable.
pntrp is a pointer to a pointer variable.
Interrupts o Disabled o Enabled o Restored
Returns Cjcfvol8 returns an 8-bit signed value from *varp.
Cjcfvol16 returns a 16-bit signed value from *varp.
Cjcfvol32 returns a 32-bit signed value from *varp.
Cjcfvolpntr returns a pointer from *pntrp.
Example #include "CJZZZ.H"
extern CJ_T8 controlflag; /* Volatile control flag */
extern int *valuep; /* Volatile pointer */
int * CJ_CCPP readpntr(void) {
int *pntr;
/* Wait until access allowed */
while (cjcfvol8(&controlflag) == 0)
;
/* Wait for valid pointer */
while ((pntr = (int *)cjcfvolpntr(&valuep)) == CJ_NULL)
;
controlflag = 0;
return (pntr);
}