From 23d9812273d9c74af72ccdc3aa4cfea971f220a4 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Fri, 16 Jan 2009 10:34:40 +0000 Subject: loader-initialized global plugin API: struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by __header.api the loader uses this pointer to initialize rb before calling entry_point entry_point is no longer passed a pointer to the plugin API all plugins, and pluginlib functions, are modified to refer to the global rb pluginlib functions which only served to copy the API pointer are removed git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/test_sampr.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'apps/plugins/test_sampr.c') diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c index a23b907048..edfe261ab9 100644 --- a/apps/plugins/test_sampr.c +++ b/apps/plugins/test_sampr.c @@ -32,8 +32,6 @@ PLUGIN_HEADER PLUGIN_IRAM_DECLARE; -const struct plugin_api *rb; - static int hw_freq IDATA_ATTR = HW_FREQ_DEFAULT; static unsigned long hw_sampr IDATA_ATTR = HW_SAMPR_DEFAULT; @@ -275,8 +273,7 @@ static void play_tone(bool volume_set) /* Tests hardware sample rate switching */ /* TODO: needs a volume control */ -enum plugin_status plugin_start(const struct plugin_api *api, - const void *parameter) +enum plugin_status plugin_start(const void *parameter) { enum { @@ -304,12 +301,11 @@ enum plugin_status plugin_start(const struct plugin_api *api, int m; /* Disable all talking before initializing IRAM */ - api->talk_disable(true); + rb->talk_disable(true); - PLUGIN_IRAM_INIT(api); - rb = api; + PLUGIN_IRAM_INIT(rb); - m = menu_init(rb, items, ARRAYLEN(items), + m = menu_init(items, ARRAYLEN(items), NULL, NULL, NULL, NULL); while (!exit) -- cgit v1.2.3