static int imx_ccm_post_load(void *opaque, int version_id) { IMXCCMState *s = (IMXCCMState *)opaque; update_clocks(s); return 0; }
int ZoomBar::update() { sample_zoom->update(mwindow->edl->local_session->zoom_sample); amp_zoom->update(mwindow->edl->local_session->zoom_y); track_zoom->update(mwindow->edl->local_session->zoom_track); update_autozoom(); update_clocks(); return 0; }
void update_clocks_min(void *arg) { // remember old_sec because after suspend/hibernate the clock should be updated directly, and not // on next minute change static time_t old_sec = 0; gettimeofday(&time_clock, 0); if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60 || (time1_format && !buf_time[0]) || (time2_format && !buf_date[0])) update_clocks(); old_sec = time_clock.tv_sec; change_timer(&clock_timer, true, ms_until_second_change(&time_clock), 0, update_clocks_min, 0); }
void ZoomBar::redraw_time_dependancies() { // Recalculate sample zoom menu sample_zoom->update_menu(); sample_zoom->update(mwindow->edl->local_session->zoom_sample); update_formatting(from_value); update_formatting(length_value); update_formatting(to_value); update_autozoom(); update_clocks(); }
static void imx_ccm_reset(DeviceState *dev) { IMXCCMState *s = container_of(dev, IMXCCMState, busdev.qdev); s->ccmr = 0x074b0b7b; s->pdr0 = 0xff870b48; s->pdr1 = 0x49fcfe7f; s->mpctl = PLL_PD(1) | PLL_MFD(0) | PLL_MFI(6) | PLL_MFN(0); s->cgr[0] = s->cgr[1] = s->cgr[2] = 0xffffffff; s->spctl = PLL_PD(1) | PLL_MFD(4) | PLL_MFI(0xc) | PLL_MFN(1); s->pmcr0 = 0x80209828; update_clocks(s); }
static void imx_ccm_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { IMXCCMState *s = (IMXCCMState *)opaque; DPRINTF("write(offset=%x, value = %x)\n", offset >> 2, (unsigned int)value); switch (offset >> 2) { case 0: s->ccmr = CCMR_FPMF | (value & 0x3b6fdfff); break; case 1: s->pdr0 = value & 0xff9f3fff; break; case 2: s->pdr1 = value; break; case 4: s->mpctl = value & 0xbfff3fff; break; case 6: s->spctl = value & 0xbfff3fff; break; case 8: s->cgr[0] = value; return; case 9: s->cgr[1] = value; return; case 10: s->cgr[2] = value; return; default: return; } update_clocks(s); }
void update_clocks_sec(void *arg) { gettimeofday(&time_clock, 0); update_clocks(); change_timer(&clock_timer, true, ms_until_second_change(&time_clock), 0, update_clocks_sec, 0); }
/** stop_search(): This checks for time and input to see if need to stop searching. Created 091006; last modified 030709 **/ BOOL stop_search(void) { CMD_RESULT cmd_result; BOOL stop = FALSE; GAME_ENTRY *current; if (zct->stop_search) stop = TRUE; /* Check for input, because we might enter this function more than once before fully stopping when unwinding the stack. */ else if (zct->input_buffer[0]) stop = TRUE; else if (time_is_up()) stop = TRUE; else if (input_available()) { /* Return to the root position. Some commands, such as "display" work on the root position instead of the current one. */ current = board.game_entry; while (board.game_entry > root_entry) unmake_move(); /* When pondering, the root entry is after the ponder move. */ if (zct->engine_state == PONDERING) unmake_move(); /* Read the command and parse it. */ read_line(); cmd_result = command(zct->input_buffer); /* Command() returns CMD_STOP_SEARCH when we need to exit the search to handle a command. */ if (cmd_result == CMD_STOP_SEARCH) stop = TRUE; /* If the command was a move, either stop or make the move. */ else if (zct->engine_state != NORMAL && cmd_result == CMD_BAD && input_move(zct->input_buffer, INPUT_CHECK_MOVE)) { /* If we are pondering, check if the move entered was the ponder move. If so, we don't need to stop. */ if (zct->engine_state == PONDERING && input_move(zct->input_buffer, INPUT_GET_MOVE) == zct->ponder_move) { zct->input_buffer[0] = '\0'; make_move(zct->ponder_move); zct->engine_state = NORMAL; update_clocks(); } else stop = TRUE; } else if (cmd_result == CMD_BAD) { zct->input_buffer[0] = '\0'; if (zct->protocol != UCI) print("Error.\n"); } /* Check for ping here in UCI mode. */ if (zct->ping && zct->protocol == UCI) { print("readyok\n"); zct->ping = 0; } /* Go back to the position we were in before checking. This is kind of hacky in that it relies on the game history after undoing all the moves to be the same. */ while (board.game_entry < current) make_move(board.game_entry->move); } /* If we're stopping the search, set a flag to make sure we don't come back here and decide to keep going, thereby introducing bugs... */ if (stop) zct->stop_search = TRUE; return stop; }