int Party::getNextWeek() { resetCheck(); #pragma omp parallel for for(int i = 0; i < size; ++i){ for(int j = 0; j < size; ++j){ int newColor = getNextColour(i, j); #pragma omp critical check[newColor] = true; nextWeek[i][j] = newColor; } } for(int i = 0; i < (int)check.size(); ++i){ if(!check[i]){ for(int j = 0; j < (int)colours.size(); ++j){ if(i == colours[j]){ colours.erase(colours.begin() + j); } } } } int** tmp_week = currentWeek; currentWeek = nextWeek; nextWeek = tmp_week; std::vector<int> s = senatorNumber(); exportSenators(s); return 1; }
int main() { //setup internal clock for 80MHz/40MIPS //7.37/2=3.685*43=158.455/2=79.2275 CLKDIVbits.PLLPRE=0; // PLLPRE (N2) 0=/2 PLLFBD=41; //pll multiplier (M) = +2 CLKDIVbits.PLLPOST=0;// PLLPOST (N1) 0=/2 while(!OSCCONbits.LOCK);//wait for PLL ready SRbits.IPL = 0; // All interupt levels enabled dbg_setup_uart(); printf("DP Web Platform - %s started.\n", version); resetCheck(); randomSeed(); rtimer_init(); printf("main: leds init\n"); leds_init(); printf("main: process init\n"); process_init(); printf("main: etimer init\n"); process_start(&etimer_process, NULL); printf("main: clock init\n"); clock_init(); // Note, readMAC() uses eeprom routines, which require clock_init() to setup clock hardware readMAC(); printf("main: eth start\n"); process_start(&enc28j60_process, NULL); printf("main: tcpip start\n"); process_start(&tcpip_process, NULL); // invokes uip_init(); process_start(&announce_process, NULL); process_start(&dhcp_process, NULL); process_start(&resolv_process, NULL); process_start(&ntp_process, NULL); printf("main: autostart\n"); autostart_start(autostart_processes); printf("main: all processes running\n"); while(1) { do { } while(process_run() > 0); idle_count++; /* Idle! */ } return 0; }
/*********************************************************** * * systemCheck * ***********************************************************/ void TTUI::systemCheck() { if(trapActive_ == true) { if(triggers[currentTrigger]->getStop() == true) //stop the UI if the trigger requests a stop { initStart(millis()); } } resetCheck(); }
void CmdProcessor::setup(Stream &s, Mirobot &m){ httpState = WAITING; _s = &s; _m = &m; resetCheck(); }