/** * \brief The clock Interrupt Service Routine * * It polls the etimer process if an etimer has expired. It also updates the * software clock tick and seconds counter. */ void clock_isr(void) { ENERGEST_ON(ENERGEST_TYPE_IRQ); update_ticks(); ENERGEST_OFF(ENERGEST_TYPE_IRQ); }
/** * \brief Adjust the clock following missed SysTick ISRs * * This function is useful when coming out of PM1/2, during which the system * clock is stopped. We adjust the clock counters like after any SysTick ISR. * * \note This function is only meant to be used by lpm_exit(). Applications * should really avoid calling this */ void clock_adjust(void) { /* Halt the SysTick while adjusting */ REG(SYSTICK_STCTRL) &= ~SYSTICK_STCTRL_ENABLE; update_ticks(); /* Re-Start the SysTick */ REG(SYSTICK_STCTRL) |= SYSTICK_STCTRL_ENABLE; }
void update_all(int gno) { update_set_lists(gno); update_world(gno); update_view(gno); update_status(gno, cur_statusitem, -1); update_ticks(gno); update_autos(gno); updatelegends(gno); updatesymbols(gno, -1); update_label_proc(); update_locator_items(gno); update_draw(); update_frame_items(gno); update_graph_items(); update_hotlinks(); }
/* * Create the ticks popup */ void create_ticks_frame(Widget w, XtPointer client_data, XtPointer call_data) { Widget wbut, rc; int x, y; int i; set_wait_cursor(); if (ticks_frame == NULL) { char *label1[2]; label1[0] = "Accept"; label1[1] = "Close"; XmGetPos(app_shell, 0, &x, &y); ticks_frame = XmCreateDialogShell(app_shell, "Axes", NULL, 0); handle_close(ticks_frame); XtVaSetValues(ticks_frame, XmNx, x, XmNy, y, NULL); ticks_panel = XmCreateRowColumn(ticks_frame, "ticks_rc", NULL, 0); editaxis = (Widget *) CreatePanelChoice(ticks_panel, "Edit:", 5, "X axis", "Y axis", "Zero X axis", "Zero Y axis", NULL, NULL); for (i = 0; i < 4; i++) { XtAddCallback(editaxis[2 + i], XmNactivateCallback, (XtCallbackProc) set_axis_proc, (XtPointer) (intptr_t) i); } XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); axislabel = CreateTextItem2(ticks_panel, 30, "Axis label:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); tmajor = CreateTextItem2(ticks_panel, 10, "Major tick spacing:"); tminor = CreateTextItem2(ticks_panel, 10, "Minor tick spacing:"); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); tlonoff = XtVaCreateManagedWidget("Display tick labels", xmToggleButtonWidgetClass, ticks_panel, NULL); tonoff = XtVaCreateManagedWidget("Display tick marks", xmToggleButtonWidgetClass, ticks_panel, NULL); baronoff = XtVaCreateManagedWidget("Display axis bar", xmToggleButtonWidgetClass, ticks_panel, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); rc = XmCreateRowColumn(ticks_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); wbut = XtVaCreateManagedWidget("Axis props...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axis_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("Axis label...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axislabel_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("Tick labels...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_ticklabels_proc, (XtPointer) 0); XtManageChild(rc); rc = XmCreateRowColumn(ticks_panel, "rc", NULL, 0); XtVaSetValues(rc, XmNorientation, XmHORIZONTAL, NULL); wbut = XtVaCreateManagedWidget("Tick marks...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_tickmarks_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("Axis bar...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_axisbar_proc, (XtPointer) 0); wbut = XtVaCreateManagedWidget("User ticks/tick labels...", xmPushButtonWidgetClass, rc, NULL); XtAddCallback(wbut, XmNactivateCallback, (XtCallbackProc) do_special_proc, (XtPointer) 0); XtManageChild(rc); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); axis_applyto = (Widget *) CreatePanelChoice(ticks_panel, "Apply to:", 5, "Current axis", "All axes, current graph", "Current axis, all graphs", "All axes, all graphs", NULL, NULL); XtVaCreateManagedWidget("sep", xmSeparatorWidgetClass, ticks_panel, NULL); CreateCommandButtons(ticks_panel, 2, but1, label1); XtAddCallback(but1[0], XmNactivateCallback, (XtCallbackProc) ticks_define_notify_proc, (XtPointer) 0); XtAddCallback(but1[1], XmNactivateCallback, (XtCallbackProc) destroy_dialog, (XtPointer) ticks_frame); XtManageChild(ticks_panel); } XtRaise(ticks_frame); update_ticks(cg); unset_wait_cursor(); }
static void set_axis_proc(Widget w, XtPointer client_data, XtPointer call_data) { int cd = (int) client_data; curaxis = cd; update_ticks(cg); }