summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-04-08 17:31:43 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2022-04-08 18:11:21 -0400
commitbd444ebd0a6cb98faf7ca569c273f4ca860ab65d (patch)
tree0a1cce22bf09a1158686bb98e3e3973d4f23bdc4
parent132034346f12d9ce5fc7e7d88b517752264e2d78 (diff)
downloadrockbox-bd444ebd0a.tar.gz
rockbox-bd444ebd0a.zip
BUGFIX keyboard.c make vp alloc static
don't stop playback to alloc viewports for the keyboard For the moment it doesn't make much difference each vp takes about 40 bytes (double that in the sim?) so not the end of the world 120 extra bytes Change-Id: I482d7e3061cf9fb8065dc28bf62a6f830770f3c7
-rw-r--r--apps/recorder/keyboard.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index f06bd9bf7f..9ab44c0c6a 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -79,8 +79,6 @@
#define CHANGED_CURSOR 2
#define CHANGED_TEXT 3
-static int kbd_vpbuf_handle[NB_SCREENS] = {0};
-
enum ekbd_viewports
{
eKBD_VP_TEXT = 0,
@@ -195,35 +193,20 @@ static void keyboard_layout(struct viewport *kbd_vp,
static int kbd_create_viewports(struct keyboard_parameters * kbd_param)
{
- struct viewport *vp;
- size_t bufsz = (sizeof(struct viewport) * 3); /* different for remote??*/
- int i, h;
+ static struct viewport viewports[NB_SCREENS][eKBD_COUNT_VP_COUNT];
+ int i;
FOR_NB_SCREENS(l)
{
- h = core_alloc_ex("kbd vp", bufsz, &buflib_ops_locked);
- if (h <= 0)
- return h;
- kbd_vpbuf_handle[l] = h;
- kbd_param[l].kbd_viewports = ((struct viewport *) core_get_data(h));
+ kbd_param[l].kbd_viewports = viewports[l];
for (i = 0; i < eKBD_COUNT_VP_COUNT; i++)
{
- vp = &kbd_param[l].kbd_viewports[i];
+ struct viewport *vp = &kbd_param[l].kbd_viewports[i];
viewport_set_defaults(vp, l);
vp->font = FONT_UI;
}
}
- return bufsz;
-}
-static void kbd_destroy_viewports(void)
-{
- FOR_NB_SCREENS(l)
- {
- if (kbd_vpbuf_handle[l] > 0) /* free old buffer */
- {
- kbd_vpbuf_handle[l] = core_free(kbd_vpbuf_handle[l]);
- }
- }
+ return sizeof(viewports);
}
/* Loads a custom keyboard into memory
@@ -802,7 +785,6 @@ cleanup:
screens[l].setfont(FONT_UI);
viewportmanager_theme_undo(l, false);
}
- kbd_destroy_viewports();
return ret;
}
static void kbd_calc_pm_params(struct keyboard_parameters *pm,