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(); } }
static void refresh_display(void) { char text[16]; fb_clear(); /* header */ fb_setbg(FB_COLOR_WHITE); if (mode != MODE_SPECTRUM && !(mode == MODE_SYNC && cursor < 0)) { fb_setfg(FB_COLOR_BLUE); fb_setfont(FB_FONT_HELVR08); fb_gotoxy(0, 7); fb_putstr("Osmocom Monitor Tool", -1); fb_gotoxy(0, 10); fb_setfg(FB_COLOR_GREEN); fb_boxto(framebuffer->width - 1, 10); } fb_setfg(FB_COLOR_BLACK); fb_setfont(FB_FONT_C64); /* RACH */ if (mode == MODE_RACH) { unsigned long elapsed = jiffies - rach_when; fb_gotoxy(0,28); switch (assign) { case ASSIGN_NONE: fb_putstr("Rach sent...", -1); break; case ASSIGN_RESULT: sprintf(text, "TA = %d", ta); fb_putstr(text, -1); fb_gotoxy(0,36); sprintf(text, "(%dm)", ta * 554); fb_putstr(text, -1); break; case ASSIGN_REJECT: fb_putstr("Rejected!", -1); break; case ASSIGN_NO_TX: fb_putstr("TX disabled", -1); break; case ASSIGN_TIMEOUT: fb_putstr("Timeout", -1); break; } switch (assign) { case ASSIGN_RESULT: case ASSIGN_REJECT: fb_gotoxy(0,44); sprintf(text, "Delay:%ldms", elapsed * 1000 / HZ); fb_putstr(text, -1); break; default: break; } } /* SYNC / UL levels */ if (mode == MODE_SYNC && cursor < 0) { int i, tn, l; int offset = (framebuffer->width - 96) >> 1; int height = framebuffer->height - 25; fb_setfont(FB_FONT_HELVR08); for (i = 0; i < 8; i++) { if (uplink) tn = (i + 3) & 7; /* UL is shifted by 3 */ else tn = i; fb_setbg(FB_COLOR_WHITE); fb_gotoxy(offset + 12 * i, 7); l = (max) ? ul_max[tn] : ul_levels[tn]; l = 110 - l; if (l >= 100) l -= 100; sprintf(text, "%02d", l); fb_putstr(text, framebuffer->width); fb_setbg(FB_COLOR_BLACK); fb_gotoxy(offset + 3 + 12 * i, height + 10); fb_boxto(offset + 3 + 12 * i + 5, height + 10 - ul_levels[tn] * height / 64); if (max) { fb_gotoxy(offset + 3 + 12 * i, height + 10 - ul_max[tn] * height / 64); fb_boxto(offset + 3 + 12 * i + 5, height + 10 - ul_max[tn] * height / 64); } } fb_setbg(FB_COLOR_TRANSP); if (max) { fb_setfg(FB_COLOR_RED); fb_gotoxy(framebuffer->width - 16, 15); fb_putstr("max", framebuffer->width); } fb_setfont(FB_FONT_C64); fb_setfg(FB_COLOR_BLUE); fb_gotoxy(0, 16); if (pcs && ul_arfcn >= PCS_MIN && ul_arfcn <= PCS_MAX) sprintf(text, "%4dP", ul_arfcn); else if (ul_arfcn >= DCS_MIN && ul_arfcn <= DCS_MAX) sprintf(text, "%4dD", ul_arfcn); else sprintf(text, "%4d ", ul_arfcn); fb_putstr(text, framebuffer->width); fb_setbg(FB_COLOR_WHITE); fb_setfg(FB_COLOR_BLACK); }
static void fb_docmd(WINDISPLAY *mod, struct TVRequest *req) { switch (req->tvr_Req.io_Command) { case TVCMD_OPENWINDOW: fb_openwindow(mod, req); break; case TVCMD_CLOSEWINDOW: fb_closewindow(mod, req); break; case TVCMD_OPENFONT: fb_openfont(mod, req); break; case TVCMD_CLOSEFONT: fb_closefont(mod, req); break; case TVCMD_GETFONTATTRS: fb_getfontattrs(mod, req); break; case TVCMD_TEXTSIZE: fb_textsize(mod, req); break; case TVCMD_QUERYFONTS: fb_queryfonts(mod, req); break; case TVCMD_GETNEXTFONT: fb_getnextfont(mod, req); break; case TVCMD_SETINPUT: fb_setinput(mod, req); break; case TVCMD_GETATTRS: fb_getattrs(mod, req); break; case TVCMD_SETATTRS: fb_setattrs(mod, req); break; case TVCMD_ALLOCPEN: fb_allocpen(mod, req); break; case TVCMD_FREEPEN: fb_freepen(mod, req); break; case TVCMD_SETFONT: fb_setfont(mod, req); break; case TVCMD_CLEAR: fb_clear(mod, req); break; case TVCMD_RECT: fb_rect(mod, req); break; case TVCMD_FRECT: fb_frect(mod, req); break; case TVCMD_LINE: fb_line(mod, req); break; case TVCMD_PLOT: fb_plot(mod, req); break; case TVCMD_TEXT: fb_drawtext(mod, req); break; case TVCMD_DRAWSTRIP: fb_drawstrip(mod, req); break; case TVCMD_DRAWTAGS: fb_drawtags(mod, req); break; case TVCMD_DRAWFAN: fb_drawfan(mod, req); break; case TVCMD_COPYAREA: fb_copyarea(mod, req); break; case TVCMD_SETCLIPRECT: fb_setcliprect(mod, req); break; case TVCMD_UNSETCLIPRECT: fb_unsetcliprect(mod, req); break; case TVCMD_DRAWBUFFER: fb_drawbuffer(mod, req); break; default: TDBPRINTF(TDB_INFO,("Unknown command code: %08x\n", req->tvr_Req.io_Command)); } }
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(); }