/* * * Usage: * procname flush */ HIDDEN int fbo_flush_tcl(void *clientData, int argc, const char **argv) { struct fb_obj *fbop = (struct fb_obj *)clientData; if (argc != 2 || !BU_STR_EQUIV(argv[1], "flush")) { bu_log("ERROR: expecting two arguments\n"); return BRLCAD_ERROR; } fb_flush(fbop->fbo_fbs.fbs_fbp); return BRLCAD_OK; }
/* * * Usage: * procname flush */ HIDDEN int fbo_flush_tcl(ClientData clientData, Tcl_Interp *interp, int argc, char **argv) { struct fb_obj *fbop = (struct fb_obj *)clientData; if (argc != 2) { struct bu_vls vls; bu_vls_init(&vls); bu_vls_printf(&vls, "helplib fb_flush"); Tcl_Eval(interp, bu_vls_addr(&vls)); bu_vls_free(&vls); return TCL_ERROR; } fb_flush(fbop->fbo_fbs.fbs_fbp); return TCL_OK; }
int main(void) { board_init(); puts("\n\nOSMOCOM Compal DSP Dumper (revision " GIT_REVISION ")\n"); puts(hr); /* Dump device identification */ dump_dev_id(); puts(hr); fb_clear(); fb_setfg(FB_COLOR_BLACK); fb_setbg(FB_COLOR_WHITE); fb_setfont(FB_FONT_HELVB14); fb_gotoxy(2,20); fb_putstr("DSP Dump",framebuffer->width-4); fb_setfg(FB_COLOR_RED); fb_setbg(FB_COLOR_BLUE); fb_gotoxy(2,25); fb_boxto(framebuffer->width-3,38); fb_setfg(FB_COLOR_WHITE); fb_setfont(FB_FONT_HELVR08); fb_gotoxy(8,33); fb_putstr("osmocom-bb",framebuffer->width-4); fb_flush(); /* Dump DSP content */ dsp_dump(); while (1) { osmo_timers_update(); } }
HIDDEN int mem_flush(FBIO *ifp) { /* * Flush memory/cmap to attached frame buffer if any */ if (MI(ifp)->fbp != FBIO_NULL) { if (MI(ifp)->cmap_dirty) { fb_wmap(MI(ifp)->fbp, &(MI(ifp)->cmap)); MI(ifp)->cmap_dirty = 0; } if (MI(ifp)->mem_dirty) { fb_writerect(MI(ifp)->fbp, 0, 0, ifp->if_width, ifp->if_height, (unsigned char *)MI(ifp)->mem); MI(ifp)->mem_dirty = 0; } return fb_flush(MI(ifp)->fbp); } MI(ifp)->cmap_dirty = 0; MI(ifp)->mem_dirty = 0; return 0; /* success */ }
void display_Temps(int xmin, int ymin) { int x, y; int interval = ((grid_sz*3+2)/4)/(S_BINS+2); int xmax = xmin+(interval*S_BINS); int ymax; fastf_t xrange = xmax - xmin; /* Avoid page thrashing of frame buffer. */ ymin = adjust_Page(ymin); ymax = ymin + interval; /* Initialize ir_table if necessary. */ if (! ir_Chk_Table()) return; for (y = ymin; y <= ymax; y++) { x = xmin; if (fb_seek(fbiop, x, y) == -1) { bu_log("\"%s\"(%d) fb_seek to pixel <%d, %d> failed.\n", __FILE__, __LINE__, x, y ); return; } for (; x <= xmax + interval; x++) { fastf_t percent; static RGBpixel *pixel; percent = D_XPOS / xrange; if (D_XPOS % interval == 0) { int temp = AMBIENT+percent*RANGE; int lgtindex = temp - ir_min; pixel = (RGBpixel *) ir_table[(lgtindex < ir_max_index ? lgtindex : ir_max_index)]; /* this should be an &ir_table..., allowed by ANSI C, but not K&R compilers. */ (void) fb_wpixel(fbiop, (unsigned char *) black); } else { (void) fb_wpixel(fbiop, (unsigned char *) pixel); } } } font = get_font((char *) NULL, bu_log); if (font.ffdes == NULL) { bu_log("Could not load font.\n"); fb_flush(fbiop); return; } y = ymin; for (x = xmin; x <= xmax; x += interval) { char tempstr[4]; fastf_t percent = D_XPOS / xrange; int temp = AMBIENT+percent*RANGE; int shrinkfactor = fb_getwidth(fbiop)/grid_sz; (void) sprintf(tempstr, "%3d", temp); do_line(x+2, y+(interval-(12/shrinkfactor))/2, tempstr /*, shrinkfactor*/ ); } fb_flush(fbiop); return; }
int main(void) { /* Simulate a compal loader saying "ACK" */ unsigned i = 0; for (i = 0; i < sizeof(phone_ack); i++) { putchar_asm(phone_ack[i]); } /* initialize board without interrupts */ board_init(0); sercomm_uart = sercomm_get_uart(); /* Say hi */ puts("\n\nOsmocomBB Loader (revision " GIT_REVISION ")\n"); puts(hr); fb_clear(); fb_setfg(FB_COLOR_BLACK); fb_setbg(FB_COLOR_WHITE); fb_setfont(FB_FONT_HELVB14); fb_gotoxy(2,20); fb_putstr("loader",framebuffer->width-4); fb_setfg(FB_COLOR_RED); fb_setbg(FB_COLOR_BLUE); fb_gotoxy(2,25); fb_boxto(framebuffer->width-3,38); fb_setfg(FB_COLOR_WHITE); fb_setfont(FB_FONT_HELVR08); fb_gotoxy(8,33); fb_putstr("osmocom-bb",framebuffer->width-4); fb_flush(); /* Identify environment */ printf("Running on %s in environment %s\n", manifest_board, manifest_environment); /* Initialize flash driver */ if (flash_init(&the_flash, 0)) { puts("Failed to initialize flash!\n"); } else { printf("Found flash of %zu bytes at 0x%p with %zu regions\n", the_flash.f_size, the_flash.f_base, the_flash.f_nregions); for (i = 0; i < the_flash.f_nregions; i++) { printf(" Region %d of %zu pages with %zu bytes each.\n", i, the_flash.f_regions[i].fr_bnum, the_flash.f_regions[i].fr_bsize); } } /* Set up a key handler for powering off */ keypad_set_handler(&key_handler); /* Set up loader communications */ sercomm_register_rx_cb(SC_DLCI_LOADER, &cmd_handler); /* Notify any running osmoload about our startup */ loader_send_init(SC_DLCI_LOADER); /* Wait for events */ while (1) { keypad_poll(); uart_poll(sercomm_uart); } /* NOT REACHED */ twl3025_power_off(); }
int main(void) { uint8_t atr[20]; uint8_t atrLength = 0; board_init(1); puts("\n\nOsmocomBB Layer 1 (revision " GIT_REVISION ")\n"); puts(hr); /* Dump device identification */ dump_dev_id(); puts(hr); keypad_set_handler(&key_handler); /* Dump clock config after PLL set */ calypso_clk_dump(); puts(hr); fb_clear(); fb_setfg(FB_COLOR_BLACK); fb_setbg(FB_COLOR_WHITE); fb_setfont(FB_FONT_HELVB14); fb_gotoxy(2,20); fb_putstr("Layer 1",framebuffer->width-4); fb_setfg(FB_COLOR_RED); fb_setbg(FB_COLOR_BLUE); fb_gotoxy(2,25); fb_boxto(framebuffer->width-3,38); fb_setfg(FB_COLOR_WHITE); fb_setfont(FB_FONT_HELVR08); fb_gotoxy(8,33); fb_putstr("osmocom-bb",framebuffer->width-4); fb_flush(); /* initialize SIM */ calypso_sim_init(); puts("Power up simcard:\n"); memset(atr,0,sizeof(atr)); atrLength = calypso_sim_powerup(atr); layer1_init(); tpu_frame_irq_en(1, 1); while (1) { l1a_compl_execute(); osmo_timers_update(); sim_handler(); l1a_l23_handler(); } /* NOT REACHED */ twl3025_power_off(); }