Change application selection in configure. Make android raaa compile.
[kugel-rb.git] / firmware / target / hosted / android / kernel-android.c
blob121f65200313597ad0c7d2285750e026a17124ba
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (c) 2010 Thomas Martitz
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
23 #include <jni.h>
24 #include "config.h"
25 #include "system.h"
27 extern JNIEnv *env_ptr;
28 extern jclass RockboxActivity_class;
29 extern jobject RockboxActivity_instance;
31 static jclass RockboxTimer_class;
32 static jobject RockboxTimer_instance;
34 int set_irq_level(int level)
36 (void)level;
37 return 0;
41 JNIEXPORT void JNICALL
42 Java_org_rockbox_RockboxTimer_timerTask(JNIEnv *env, jobject this)
44 (void)env;
45 (void)this;
46 call_tick_tasks();
49 void tick_start(unsigned int interval_in_ms)
51 /* first, get the RockboxTimer instance allocated by RockboxActivity */
52 jfieldID tim = (*env_ptr)->GetFieldID(env_ptr,
53 RockboxActivity_class,
54 "tim",
55 "Lorg/rockbox/RockboxTimer;");
57 RockboxTimer_instance = (*env_ptr)->GetObjectField(env_ptr,
58 RockboxActivity_instance,
59 tim);
60 RockboxTimer_class = (*env_ptr)->GetObjectClass(env_ptr,
61 RockboxTimer_instance);
63 /* now find its tick start method and call it */
64 jmethodID java_tick_start = (*env_ptr)->GetMethodID(env_ptr,
65 RockboxTimer_class,
66 "java_tick_start",
67 "(J)V");
68 (*env_ptr)->CallVoidMethod(env_ptr,
69 RockboxTimer_instance,
70 java_tick_start,
71 (jlong)interval_in_ms);
74 bool timer_register(int reg_prio, void (*unregister_callback)(void),
75 long cycles, void (*timer_callback)(void))
77 (void)reg_prio;
78 (void)unregister_callback;
79 (void)cycles;
80 (void)timer_callback;
81 return false;
84 bool timer_set_period(long cycles)
86 (void)cycles;
87 return false;
90 void timer_unregister(void)