Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
HeHoPMaJIeH committed Oct 24, 2012
1 parent 94ca87f commit ef7eecf
Show file tree
Hide file tree
Showing 56 changed files with 462 additions and 194 deletions.
4 changes: 2 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
45 changes: 22 additions & 23 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
Expand All @@ -20,22 +17,11 @@
<folderInfo id="com.android.toolchain.gcc.1109300845.209709506" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.1596738653" name="Android GCC" superClass="com.android.toolchain.gcc">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1732439929" name="Android Platform" osList="all" superClass="com.android.targetPlatform"/>
<builder buildPath="${workspace_loc:/TestJNI/Default}" command="ndk-build.cmd" id="com.android.builder.1479916741" keepEnvironmentInBuildfile="false" superClass="com.android.builder"/>
<builder buildPath="${workspace_loc:/TestJNI/Default}" command="/home/hehopmajieh/Downloads/android-ndk-r8b/ndk-build" id="com.android.builder.1479916741" keepEnvironmentInBuildfile="false" name="Android Builder" superClass="com.android.builder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1844274265" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="com.android.tool.compiler.g++.2034196193" name="Android G++" superClass="com.android.tool.compiler.g++">
<option id="gnu.cpp.compiler.option.include.paths.1635094437" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;C:\Tools\Android\ndk\platforms\android-9\arch-arm\usr\include&quot;"/>
</option>
<inputType id="com.android.tool.compiler.g++.input.1400296441" superClass="com.android.tool.compiler.g++.input"/>
</tool>
<tool id="com.android.tool.compiler.c.160440554" name="Android GCC" superClass="com.android.tool.compiler.c">
<option id="gnu.c.compiler.option.include.paths.201723304" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;C:\Tools\Android\ndk\platforms\android-9\arch-arm\usr\include&quot;"/>
</option>
<inputType id="com.android.tool.compiler.c.input.438467369" superClass="com.android.tool.compiler.c.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1225654004" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1089727002" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<option id="gnu.cpp.link.option.flags.78256829" superClass="gnu.cpp.link.option.flags" value="-lc" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1007486063" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
Expand All @@ -44,6 +30,9 @@
<tool id="cdt.managedbuild.tool.gnu.assembler.base.1637453946" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1833355246" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="com.android.gcc.compiler.258126681" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
<inputType id="com.android.gcc.inputType.2031420140" superClass="com.android.gcc.inputType"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
Expand All @@ -57,23 +46,33 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="TestJNI.null.981251742" name="TestJNI"/>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/TestJNI"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/TestJNI"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
<doc-comment-owner id="org.eclipse.cdt.internal.ui.text.doctools.NullDocCommentOwner">
<path value=""/>
</doc-comment-owner>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.895495568;com.android.tool.compiler.g++.441347960;com.android.tool.compiler.g++.input.2086486613">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.209709506;com.android.tool.compiler.g++.1547044928;com.android.tool.compiler.g++.input.2090222776">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.895495568;com.android.tool.compiler.c.663460993;com.android.tool.compiler.c.input.335789649">
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.895495568;com.android.tool.compiler.g++.441347960;com.android.tool.compiler.g++.input.2086486613">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.209709506;com.android.gcc.compiler.258126681;com.android.gcc.inputType.2031420140">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.209709506;com.android.tool.compiler.c.518078848;com.android.tool.compiler.c.input.1868065238">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1109300845;com.android.toolchain.gcc.1109300845.895495568;com.android.tool.compiler.c.663460993;com.android.tool.compiler.c.input.335789649">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject>
8 changes: 7 additions & 1 deletion .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#Fri Apr 06 18:35:20 ICT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
3 changes: 3 additions & 0 deletions .settings/org.eclipse.mylyn.tasks.ui.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
project.repository.kind=githubGists
project.repository.url=https\://gist.github.com
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<uses-sdk android:minSdkVersion="9" />

<application
android:icon="@drawable/ic_launcher"
android:icon="@drawable/ic_launcher2"
android:label="@string/app_name" >
<activity
android:name=".TestJNIActivity"
android:label="@string/app_name" >
android:label="Olimex's MOD-IO Test by HeHoPMaJIeH" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
5 changes: 2 additions & 3 deletions Default/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

-include ../makefile.init

RM := del
RM := rm

# All of the sources participating in the build are defined here
-include sources.mk
-include obj/local/armeabi/objs/axonI2C/subdir.mk
-include obj/local/armeabi/objs/TestJNI/subdir.mk
-include subdir.mk
-include objects.mk

Expand All @@ -24,7 +23,7 @@ all: TestJNI
TestJNI: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -o "TestJNI" $(OBJS) $(USER_OBJS) $(LIBS)
g++ -lc -o "TestJNI" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '

Expand Down
11 changes: 0 additions & 11 deletions Default/obj/local/armeabi/objs/TestJNI/subdir.mk

This file was deleted.

3 changes: 2 additions & 1 deletion Default/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
################################################################################

O_SRCS :=
CPP_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
Expand All @@ -12,5 +14,4 @@ EXECUTABLES :=
# Every subdirectory with source files must be described here
SUBDIRS := \
obj/local/armeabi/objs/axonI2C \
obj/local/armeabi/objs/TestJNI \

23 changes: 23 additions & 0 deletions bin/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="axon.test.testJNI"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="9" />

<application
android:icon="@drawable/ic_launcher2"
android:label="@string/app_name" >
<activity
android:name=".TestJNIActivity"
android:label="Olimex's MOD-IO Test by HeHoPMaJIeH" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file removed bin/TestJNI.apk
Binary file not shown.
Binary file added bin/axon.test.testJNI.TestJNIActivity.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/R$drawable.class
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/R$id.class
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/R$layout.class
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/R$string.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/TestJNIActivity$1$1.class
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/TestJNIActivity$1.class
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/TestJNIActivity.class
Binary file not shown.
Binary file modified bin/classes/axon/test/testJNI/axonI2C.class
Binary file not shown.
Binary file added bin/res/drawable-hdpi/ic_launcher1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-hdpi/ic_launcher2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/res/drawable-ldpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-ldpi/ic_launcher1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-ldpi/ic_launcher2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-mdpi/ic_launcher1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-mdpi/ic_launcher2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-xhdpi/ic_launcher1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-xhdpi/ic_launcher2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/resources.ap_
Binary file not shown.
18 changes: 17 additions & 1 deletion gen/axon/test/testJNI/R.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@ public static final class attr {
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int ic_launcher1=0x7f020001;
public static final int ic_launcher2=0x7f020002;
}
public static final class id {
public static final int myTextField=0x7f050000;
public static final int button1=0x7f050000;
public static final int button2=0x7f050001;
public static final int button3=0x7f050002;
public static final int button4=0x7f050003;
public static final int button5=0x7f050004;
public static final int textView1=0x7f050005;
public static final int textView10=0x7f05000e;
public static final int textView2=0x7f050006;
public static final int textView3=0x7f050007;
public static final int textView4=0x7f050008;
public static final int textView5=0x7f050009;
public static final int textView6=0x7f05000a;
public static final int textView7=0x7f05000b;
public static final int textView8=0x7f05000c;
public static final int textView9=0x7f05000d;
}
public static final class layout {
public static final int main=0x7f030000;
Expand Down
Binary file added ic_launcher1-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ic_launcher2-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions jni/axonI2C.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#undef __cplusplus
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include "axonI2C.h"

#include <jni.h>
#define LOG_TAG "axoni2c"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
Expand All @@ -20,6 +25,7 @@ JNIEXPORT jint JNICALL Java_axon_test_testJNI_axonI2C_open(JNIEnv *env, jobject
}
sprintf(fileName, "%s", str);
LOGI("will open i2c device node %s", fileName);

(*env)->ReleaseStringUTFChars(env, file, str);
return open(fileName, O_RDWR);
}
Expand Down Expand Up @@ -53,8 +59,10 @@ JNIEXPORT jint JNICALL Java_axon_test_testJNI_axonI2C_read(JNIEnv * env, jobject
(*env)->GetIntArrayRegion(env, bufArr, 0, len, bufInt);

res = ioctl(fileHander, I2C_SLAVE, slaveAddr);

if (res != 0) {
LOGE("I2C: Can't set slave address");
LOGE("will open i2c device hack1%d", res);
LOGE("I2C: Can't set slave address");
goto err2;
}

Expand Down
Binary file modified libs/armeabi/libaxonI2C.so
100644 → 100755
Binary file not shown.
Binary file modified obj/local/armeabi/libaxonI2C.so
100644 → 100755
Binary file not shown.
1 change: 0 additions & 1 deletion obj/local/armeabi/libstdc++.a

This file was deleted.

Binary file removed obj/local/armeabi/objs/TestJNI/TestJNI.o
Binary file not shown.
19 changes: 0 additions & 19 deletions obj/local/armeabi/objs/TestJNI/TestJNI.o.d

This file was deleted.

Binary file modified obj/local/armeabi/objs/axonI2C/axonI2C.o
Binary file not shown.
Loading

0 comments on commit ef7eecf

Please sign in to comment.