From 371c86bf3f4d1708fc40db2aa7fa572eb429d0b4 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 7 Dec 2012 01:50:52 -0500 Subject: Adapt OSD in plugin lib to be greylib compatible. Requires addition of viewports and alternate framebuffers to greylib which are essentially similar to the core implementation except that the framebuffer can be any size and relationship to a viewport. Drawing is always fully clipped to the intersecting area. Adapt oscilloscope.c to the API change. FFT will use the new features (later update). Get rid of silly and wrong lcd_bmp_part use in OSD. Remove it from plugin API (must be made incompatible now). Change-Id: Iafa5e2174148fb8ad11db6b9d4add0dcabc5c563 --- apps/plugins/oscilloscope.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apps/plugins/oscilloscope.c') diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 4fbf96939d..c418f127fc 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -727,7 +727,14 @@ static void osc_osd_init(void) /* Grab the plugin buffer for the OSD back buffer */ size_t bufsize; void *buf = rb->plugin_get_buffer(&bufsize); - osd_init(buf, bufsize, osd_lcd_draw_cb); + + int width, height; + rb->lcd_setfont(FONT_UI); + rb->lcd_getstringsize("M", NULL, &height); + width = LCD_WIDTH; + height += 2 + 2*OSC_OSD_MARGIN_SIZE; + osd_init(OSD_INIT_MAJOR_HEIGHT | OSD_INIT_MINOR_MAX, buf, bufsize, + osd_lcd_draw_cb, &width, &height, NULL); } /* Format a message by ID and show the OSD */ @@ -1826,7 +1833,7 @@ static long oscilloscope_draw(void) static void osc_cleanup(void) { - osd_init(NULL, 0, NULL); + osd_destroy(); #ifdef OSCILLOSCOPE_GRAPHMODE anim_waveform_exit(); -- cgit v1.2.3