/* This function is called repetitively from the main program */ void labwork( void ) { delay( 1000 ); time2string( textstring, mytime ); display_string( 3, textstring ); display_update(); getbtns(); if (getbtns() == 1) mytime += (getsw() << 4); if (getbtns() == 2) mytime += (getsw() << 8); if (getbtns() == 4) mytime += (getsw() << 12); volatile int* porte = (volatile int*) 0xbf886110; tick( &mytime ); *porte += 1; display_image(96, icon); }
/* This function is called repetitively from the main program */ void labwork( void ){ prime = nextprime(prime); display_string(0, itoaconv(prime)); display_update(); int btns = getbtns(); if(btns){ int sw = getsw(); //BTN2 if(btns & 0x4){ mytime &= 0x0fff; //remove old digit mytime |= (sw<<12); //set new digit } //BTN3 if(btns & 0x2){ mytime &= 0xf0ff; mytime |= (sw<<8); } //BTN2 if(btns & 0x1){ mytime &= 0xff0f; mytime |= (sw<<4); } } }
//Update status int update_status() { getbtns(); getsw(); }