summaryrefslogtreecommitdiff
path: root/apps/plugins/test_sampr.c
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-01-16 10:34:40 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-01-16 10:34:40 +0000
commit23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch)
tree8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/test_sampr.c
parent35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff)
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
Diffstat (limited to 'apps/plugins/test_sampr.c')
-rw-r--r--apps/plugins/test_sampr.c12
1 files changed, 4 insertions, 8 deletions
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)