Exemple #1
0
extern void
persistfile(	/* open persist file and lock it */
    char	*pfn
)
{
    persistfd = open(pfn, O_WRONLY|O_CREAT|O_EXCL, 0644);
    if (persistfd >= 0) {
        persistfname = pfn;
        pflock(1);
        return;
    }
    /* file exists -- switch to i/o process */
    persistfd = open(pfn, O_RDWR);
    if (persistfd < 0) {
        sprintf(errmsg, "cannot open persist file \"%s\"", pfn);
        error(SYSTEM, errmsg);
    }
    pflock(1);
    io_process();	/* never returns */
}
Exemple #2
0
//SysTick Handler that will be called several times per second (see TICKS_PER_SECOND). This is an interrupt.
void SysTick_Handler() {
    ticks++; 
    io_process(); //Process button presses
}