User`s manual

UC-7408 User’s Manual Programmer’s Guide
5-18
act.sa_flags=0;
sigemptyset(&act.sa_mask);
sigaction(SIGALRM,&act,NULL);
}
int main(int argc, char * argv[])
{
pthread_t dio_test;
init_sigaction();
set_dout_state(0, 0); // set the DOUT0 as high
set_din_event(0, low2highevent, DIN_EVENT_LOW_TO_HIGH, duration[1][0]);
dio_test_function();
while( nDuration < DURATION_NUM )
usleep(100000);
}
DIO Program Make File Example
FNAME=tdio
FNAME1=tduration
CC=mxscaleb-gcc
STRIP=mxscaleb-strip
release:
$(CC) -o $(FNAME) $(FNAME).c -lmoxalib -lpthread
$(CC) -o $(FNAME1) $(FNAME1).c -lmoxalib -lpthread
$(STRIP) -s $(FNAME)
$(STRIP) -s $(FNAME1)
debug:
$(CC) -DDEBUG -o $(FNAME)-dbg $(FNAME).cxx -lmoxalib -lpthread
$(CC) -DDEBUG -o $(FNAME1)-dbg $(FNAME1).cxx -lmoxalib -lpthread
clean:
/bin/rm -f $(FNAME) $(FNAME)-dbg $(FNAME1) $(FNAME1)-dbg *.o
Make File Example
The following Makefile file example codes are copied from the Hello example on UC-7408’s
CD-ROM.
CC = /usr/local/mxscaleb/mxscaleb-gcc
CPP = /usr/local/mxscaleb/mxscaleb-gcc
SOURCES = hello.c
OBJS = $(SOURCES:.c=.o)
all: hello
hello: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
clean:
rm -f $(OBJS) hello core *.gdb