add for first commmit
authora0220410 <peter-li@ti.com>
Mon, 13 Jun 2016 23:53:24 +0000 (07:53 +0800)
committera0220410 <peter-li@ti.com>
Mon, 13 Jun 2016 23:53:24 +0000 (07:53 +0800)
47 files changed:
TAS2555-FTC/.gitignore [new file with mode: 0755]
TAS2555-FTC/.idea/.name [new file with mode: 0755]
TAS2555-FTC/.idea/compiler.xml [new file with mode: 0755]
TAS2555-FTC/.idea/copyright/profiles_settings.xml [new file with mode: 0755]
TAS2555-FTC/.idea/encodings.xml [new file with mode: 0755]
TAS2555-FTC/.idea/gradle.xml [new file with mode: 0755]
TAS2555-FTC/.idea/misc.xml [new file with mode: 0755]
TAS2555-FTC/.idea/modules.xml [new file with mode: 0755]
TAS2555-FTC/.idea/runConfigurations.xml [new file with mode: 0755]
TAS2555-FTC/app/.gitignore [new file with mode: 0755]
TAS2555-FTC/app/build.gradle [new file with mode: 0755]
TAS2555-FTC/app/proguard-rules.pro [new file with mode: 0755]
TAS2555-FTC/app/src/androidTest/java/com/ti/tas2555/tas2555_ftc/ApplicationTest.java [new file with mode: 0755]
TAS2555-FTC/app/src/main/AndroidManifest.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/java/com/ti/tas2555/tas2555_ftc/MainActivity.java [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/layout/activity_main.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/layout/content_main.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/menu/menu_main.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/mipmap-hdpi/ic_launcher.png [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/mipmap-mdpi/ic_launcher.png [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/mipmap-xhdpi/ic_launcher.png [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/mipmap-xxhdpi/ic_launcher.png [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/values-v21/styles.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/values-w820dp/dimens.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/values/colors.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/values/dimens.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/values/strings.xml [new file with mode: 0755]
TAS2555-FTC/app/src/main/res/values/styles.xml [new file with mode: 0755]
TAS2555-FTC/app/src/test/java/com/ti/tas2555/tas2555_ftc/ExampleUnitTest.java [new file with mode: 0755]
TAS2555-FTC/build.gradle [new file with mode: 0755]
TAS2555-FTC/ftcc/.gitignore [new file with mode: 0755]
TAS2555-FTC/ftcc/build.gradle [new file with mode: 0755]
TAS2555-FTC/ftcc/libs/armeabi/libTAS2555ftc.so [new file with mode: 0755]
TAS2555-FTC/ftcc/proguard-rules.pro [new file with mode: 0755]
TAS2555-FTC/ftcc/src/androidTest/java/com/ti/tas2555/ftcc/ApplicationTest.java [new file with mode: 0755]
TAS2555-FTC/ftcc/src/main/AndroidManifest.xml [new file with mode: 0755]
TAS2555-FTC/ftcc/src/main/java/com/ti/tas2555/ftcc/TAS2555Node.java [new file with mode: 0755]
TAS2555-FTC/ftcc/src/main/java/com/ti/tas2555/ftcc/TFTCConfiguration.java [new file with mode: 0755]
TAS2555-FTC/ftcc/src/main/res/values/strings.xml [new file with mode: 0755]
TAS2555-FTC/ftcc/src/test/java/com/ti/tas2555/ftcc/ExampleUnitTest.java [new file with mode: 0755]
TAS2555-FTC/gradle.properties [new file with mode: 0755]
TAS2555-FTC/gradle/wrapper/gradle-wrapper.jar [new file with mode: 0755]
TAS2555-FTC/gradle/wrapper/gradle-wrapper.properties [new file with mode: 0755]
TAS2555-FTC/gradlew [new file with mode: 0755]
TAS2555-FTC/gradlew.bat [new file with mode: 0755]
TAS2555-FTC/settings.gradle [new file with mode: 0755]

diff --git a/TAS2555-FTC/.gitignore b/TAS2555-FTC/.gitignore
new file mode 100755 (executable)
index 0000000..4c9e2c6
--- /dev/null
@@ -0,0 +1,8 @@
+*.iml\r
+.gradle\r
+/local.properties\r
+/.idea/workspace.xml\r
+/.idea/libraries\r
+.DS_Store\r
+/build\r
+/captures\r
diff --git a/TAS2555-FTC/.idea/.name b/TAS2555-FTC/.idea/.name
new file mode 100755 (executable)
index 0000000..fdbeab7
--- /dev/null
@@ -0,0 +1 @@
+TAS2555-FTC
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/compiler.xml b/TAS2555-FTC/.idea/compiler.xml
new file mode 100755 (executable)
index 0000000..96cc43e
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <resourceExtensions />
+    <wildcardResourcePatterns>
+      <entry name="!?*.java" />
+      <entry name="!?*.form" />
+      <entry name="!?*.class" />
+      <entry name="!?*.groovy" />
+      <entry name="!?*.scala" />
+      <entry name="!?*.flex" />
+      <entry name="!?*.kt" />
+      <entry name="!?*.clj" />
+      <entry name="!?*.aj" />
+    </wildcardResourcePatterns>
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="false">
+        <processorPath useClasspath="true" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/copyright/profiles_settings.xml b/TAS2555-FTC/.idea/copyright/profiles_settings.xml
new file mode 100755 (executable)
index 0000000..c7d1c5a
--- /dev/null
@@ -0,0 +1,3 @@
+<component name="CopyrightManager">\r
+  <settings default="" />\r
+</component>
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/encodings.xml b/TAS2555-FTC/.idea/encodings.xml
new file mode 100755 (executable)
index 0000000..97626ba
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/gradle.xml b/TAS2555-FTC/.idea/gradle.xml
new file mode 100755 (executable)
index 0000000..38aac6e
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="distributionType" value="LOCAL" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleHome" value="C:\ti\Android\Audroid Studio\gradle\gradle-2.10" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+            <option value="$PROJECT_DIR$/ftcc" />
+          </set>
+        </option>
+        <option name="myModules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+            <option value="$PROJECT_DIR$/ftcc" />
+          </set>
+        </option>
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/misc.xml b/TAS2555-FTC/.idea/misc.xml
new file mode 100755 (executable)
index 0000000..1a3eaff
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
+  <component name="NullableNotNullManager">
+    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
+    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
+    <option name="myNullables">
+      <value>
+        <list size="4">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
+          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+        </list>
+      </value>
+    </option>
+    <option name="myNotNulls">
+      <value>
+        <list size="4">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
+          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
+          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+        </list>
+      </value>
+    </option>
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/modules.xml b/TAS2555-FTC/.idea/modules.xml
new file mode 100755 (executable)
index 0000000..cbdb133
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/TAS2555-FTC.iml" filepath="$PROJECT_DIR$/TAS2555-FTC.iml" />
+      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
+      <module fileurl="file://$PROJECT_DIR$/ftcc/ftcc.iml" filepath="$PROJECT_DIR$/ftcc/ftcc.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/TAS2555-FTC/.idea/runConfigurations.xml b/TAS2555-FTC/.idea/runConfigurations.xml
new file mode 100755 (executable)
index 0000000..7f68460
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/TAS2555-FTC/app/.gitignore b/TAS2555-FTC/app/.gitignore
new file mode 100755 (executable)
index 0000000..3543521
--- /dev/null
@@ -0,0 +1 @@
+/build\r
diff --git a/TAS2555-FTC/app/build.gradle b/TAS2555-FTC/app/build.gradle
new file mode 100755 (executable)
index 0000000..aa2841b
--- /dev/null
@@ -0,0 +1,32 @@
+apply plugin: 'com.android.application'\r
+\r
+android {\r
+    compileSdkVersion 23\r
+    buildToolsVersion "23.0.3"\r
+\r
+    repositories {\r
+        maven { url 'http://repo1.maven.org/maven2' }      //this is newly added\r
+    }\r
+\r
+    defaultConfig {\r
+        applicationId "com.ti.tas2555.tas2555_ftc"\r
+        minSdkVersion 19\r
+        targetSdkVersion 23\r
+        versionCode 1\r
+        versionName "1.0"\r
+    }\r
+    buildTypes {\r
+        release {\r
+            minifyEnabled false\r
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r
+        }\r
+    }\r
+}\r
+\r
+dependencies {\r
+    compile fileTree(dir: 'libs', include: ['*.jar'])\r
+    testCompile 'junit:junit:4.12'\r
+    compile 'com.android.support:appcompat-v7:23.4.0'\r
+    compile 'com.android.support:design:23.4.0'\r
+    compile project(':ftcc')\r
+}\r
diff --git a/TAS2555-FTC/app/proguard-rules.pro b/TAS2555-FTC/app/proguard-rules.pro
new file mode 100755 (executable)
index 0000000..34dc54d
--- /dev/null
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.\r
+# By default, the flags in this file are appended to flags specified\r
+# in C:\ti\Android\sdk/tools/proguard/proguard-android.txt\r
+# You can edit the include path and order by changing the proguardFiles\r
+# directive in build.gradle.\r
+#\r
+# For more details, see\r
+#   http://developer.android.com/guide/developing/tools/proguard.html\r
+\r
+# Add any project specific keep options here:\r
+\r
+# If your project uses WebView with JS, uncomment the following\r
+# and specify the fully qualified class name to the JavaScript interface\r
+# class:\r
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\r
+#   public *;\r
+#}\r
diff --git a/TAS2555-FTC/app/src/androidTest/java/com/ti/tas2555/tas2555_ftc/ApplicationTest.java b/TAS2555-FTC/app/src/androidTest/java/com/ti/tas2555/tas2555_ftc/ApplicationTest.java
new file mode 100755 (executable)
index 0000000..c38744f
--- /dev/null
@@ -0,0 +1,13 @@
+package com.ti.tas2555.tas2555_ftc;\r
+\r
+import android.app.Application;\r
+import android.test.ApplicationTestCase;\r
+\r
+/**\r
+ * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>\r
+ */\r
+public class ApplicationTest extends ApplicationTestCase<Application> {\r
+    public ApplicationTest() {\r
+        super(Application.class);\r
+    }\r
+}
\ No newline at end of file
diff --git a/TAS2555-FTC/app/src/main/AndroidManifest.xml b/TAS2555-FTC/app/src/main/AndroidManifest.xml
new file mode 100755 (executable)
index 0000000..935fe84
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"\r
+    package="com.ti.tas2555.tas2555_ftc">\r
+\r
+    <application\r
+        android:allowBackup="true"\r
+        android:icon="@mipmap/ic_launcher"\r
+        android:label="@string/app_name"\r
+        android:supportsRtl="true"\r
+        android:theme="@style/AppTheme">\r
+        <activity\r
+            android:name=".MainActivity"\r
+            android:label="@string/app_name"\r
+            android:theme="@style/AppTheme.NoActionBar">\r
+            <intent-filter>\r
+                <action android:name="android.intent.action.MAIN" />\r
+\r
+                <category android:name="android.intent.category.LAUNCHER" />\r
+            </intent-filter>\r
+        </activity>\r
+    </application>\r
+    <uses-permission android:name="android.permission.INTERNET" />\r
+    <uses-permission android:name="android.permission.WAKE_LOCK" />\r
+</manifest>
\ No newline at end of file
diff --git a/TAS2555-FTC/app/src/main/java/com/ti/tas2555/tas2555_ftc/MainActivity.java b/TAS2555-FTC/app/src/main/java/com/ti/tas2555/tas2555_ftc/MainActivity.java
new file mode 100755 (executable)
index 0000000..927ce60
--- /dev/null
@@ -0,0 +1,260 @@
+package com.ti.tas2555.tas2555_ftc;\r
+\r
+import android.content.ContentResolver;\r
+import android.content.pm.ProviderInfo;\r
+import android.database.Cursor;\r
+import android.media.AudioManager;\r
+import android.media.MediaPlayer;\r
+import android.net.Uri;\r
+import android.os.Bundle;\r
+import android.support.design.widget.FloatingActionButton;\r
+import android.support.design.widget.Snackbar;\r
+import android.support.v7.app.AppCompatActivity;\r
+import android.support.v7.widget.Toolbar;\r
+import android.util.Log;\r
+import android.view.View;\r
+import android.view.Menu;\r
+import android.view.MenuItem;\r
+import android.widget.Button;\r
+\r
+import com.ti.tas2555.ftcc.TAS2555Node;\r
+import com.ti.tas2555.ftcc.TFTCConfiguration;\r
+\r
+import java.io.File;\r
+import java.util.Timer;\r
+import java.util.TimerTask;\r
+\r
+public class MainActivity extends AppCompatActivity implements MediaPlayer.OnPreparedListener {\r
+    private String TAG = "TAS2555-FTC";\r
+    private TAS2555Node mDevNode;\r
+    private TFTCConfiguration mFTCConfiguration;\r
+    private Button mStartButton;\r
+    private MediaPlayer mMediaPlayer;\r
+    private Timer mTimer;\r
+    private Cal_State mCalState = Cal_State.IDLE;\r
+\r
+    private  enum Cal_State{\r
+        IDLE,\r
+        CALIBRATE,\r
+        VARIFY\r
+    }\r
+\r
+    @Override\r
+    protected void onCreate(Bundle savedInstanceState) {\r
+        super.onCreate(savedInstanceState);\r
+        setContentView(R.layout.activity_main);\r
+        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\r
+        setSupportActionBar(toolbar);\r
+\r
+        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);\r
+        fab.setOnClickListener(new View.OnClickListener() {\r
+            @Override\r
+            public void onClick(View view) {\r
+                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)\r
+                        .setAction("Action", null).show();\r
+            }\r
+        });\r
+\r
+        mTimer = new Timer("PlaybackTimer");\r
+        mMediaPlayer = new MediaPlayer();\r
+        mDevNode = new TAS2555Node();\r
+        mFTCConfiguration = new TFTCConfiguration();\r
+        mStartButton = (Button) findViewById(R.id.bnStart);\r
+        mStartButton.setOnClickListener(new View.OnClickListener() {\r
+            @Override\r
+            public void onClick(View v) {\r
+                FTCStart();\r
+            }\r
+        });\r
+    }\r
+\r
+    @Override\r
+    public boolean onCreateOptionsMenu(Menu menu) {\r
+        // Inflate the menu; this adds items to the action bar if it is present.\r
+        getMenuInflater().inflate(R.menu.menu_main, menu);\r
+        return true;\r
+    }\r
+\r
+    @Override\r
+    public boolean onOptionsItemSelected(MenuItem item) {\r
+        // Handle action bar item clicks here. The action bar will\r
+        // automatically handle clicks on the Home/Up button, so long\r
+        // as you specify a parent activity in AndroidManifest.xml.\r
+        int id = item.getItemId();\r
+\r
+        //noinspection SimplifiableIfStatement\r
+        if (id == R.id.action_settings) {\r
+            return true;\r
+        }\r
+\r
+        return super.onOptionsItemSelected(item);\r
+    }\r
+\r
+    private void FTCStart(){\r
+        try {\r
+            mFTCConfiguration.LoadFTCC("/data/speaker.ftcfg");\r
+            mDevNode.OpenNode("/dev/tiload_node");\r
+            mFTCConfiguration.nTCal = 25;\r
+            mFTCConfiguration.bLoadCalibration = true;\r
+            // STEP 1: Load TAS2555 calibration configuration\r
+            mDevNode.set_Configuration(mFTCConfiguration.nConfigurationCalibration);\r
+            File file=new File("/data/TAS2555_cal_m28dB.wav");\r
+            if(file.exists()){\r
+                mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\r
+                mMediaPlayer.setDataSource(file.getAbsolutePath());\r
+                mCalState = Cal_State.CALIBRATE;\r
+                mMediaPlayer.setOnPreparedListener(this);\r
+                mMediaPlayer.prepareAsync();\r
+            }\r
+        }catch (Exception ex){\r
+            Log.e(TAG, ex.toString());\r
+        }\r
+    }\r
+\r
+    public void onPrepared(MediaPlayer mp) {\r
+        if(mCalState == Cal_State.CALIBRATE) {\r
+            // STEP 2: Play calibration signal\r
+            mMediaPlayer.start();\r
+            try {\r
+                Thread.sleep(500);\r
+            }catch (Exception ex){\r
+                Log.e(TAG, ex.toString());\r
+            }\r
+\r
+            // STEP 3: Re-program Re for worst case\r
+            double re = mFTCConfiguration.nPPC3_Re0;\r
+            re = mFTCConfiguration.nPPC3_Re0 * (1 - 2 * mFTCConfiguration.nSpkReTolPer / 100.0);\r
+            mDevNode.set_Re(mFTCConfiguration.nPPC3_Re0, re, mFTCConfiguration.nSpkReAlpha);\r
+            mDevNode.set_NFS(mFTCConfiguration.nNFS);\r
+            mDevNode.set_SCTH(mFTCConfiguration.nSCTH);\r
+\r
+            // STEP 4: Wait for algorithm to converge\r
+            mTimer.schedule(new TimerTask() {\r
+                @Override\r
+                public void run() {\r
+                    CalTimeReached();\r
+                }\r
+            }, mFTCConfiguration.nCalibrationTime);\r
+        }else if(mCalState == Cal_State.VARIFY){\r
+            mMediaPlayer.start();\r
+            try {\r
+                Thread.sleep(500);\r
+            }catch (Exception ex){\r
+                Log.e(TAG, ex.toString());\r
+            }\r
+\r
+            mTimer.schedule(new TimerTask() {\r
+                @Override\r
+                public void run() {\r
+                    VerifyTimeReached();\r
+                }\r
+            }, mFTCConfiguration.nVerificationTime);\r
+        }\r
+    }\r
+\r
+    private void CalTimeReached(){\r
+        mFTCConfiguration.nRe = mDevNode.get_Re(mFTCConfiguration.nPPC3_Re0);\r
+        mFTCConfiguration.nF0 = mDevNode.get_f0(mFTCConfiguration.nFSRate);\r
+        mFTCConfiguration.nQ = mDevNode.get_Q(mFTCConfiguration.nFSRate);\r
+        //   t_cal = sys_get_ambient_temp(); // Set t_cal to ambient temperature //use command line parameter instead\r
+\r
+        // STEP 6: Verify Speaker at gpFTCC->nTestDeltaT\r
+        int prm_pow = mDevNode.Calc_Prm_Pow(mFTCConfiguration.nRe,\r
+                mFTCConfiguration.nTestDeltaT,\r
+                mFTCConfiguration.nPPC3_RTV,\r
+                mFTCConfiguration.nPPC3_RTM,\r
+                mFTCConfiguration.nPPC3_RTVA,\r
+                mFTCConfiguration.nPPC3_SysGain);\r
+        int prm_tlimit = mDevNode.calc_Prm_Tlimit(mFTCConfiguration.nTestDeltaT,\r
+                mFTCConfiguration.nSpkReAlpha,\r
+                mFTCConfiguration.nPPC3_DevNonlinPer,\r
+                mFTCConfiguration.nPPC3_RTV,\r
+                mFTCConfiguration.nPPC3_RTM,\r
+                mFTCConfiguration.nPPC3_RTVA);\r
+\r
+        mDevNode.set_Re(mFTCConfiguration.nPPC3_Re0,\r
+                mFTCConfiguration.nRe,\r
+                mFTCConfiguration.nSpkReAlpha);\r
+        mDevNode.set_TempCal(prm_pow, prm_tlimit);\r
+\r
+        mMediaPlayer.stop();\r
+\r
+        StartVerify();\r
+    }\r
+\r
+    private void StartVerify(){\r
+        try {\r
+            File file=new File("/data/TAS2555_verify_m06.wav");\r
+            if(file.exists()){\r
+                mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\r
+                mMediaPlayer.setDataSource(file.getAbsolutePath());\r
+                mCalState = Cal_State.VARIFY;\r
+                mMediaPlayer.prepareAsync();\r
+            }\r
+        }catch (Exception ex){\r
+            Log.e(TAG, ex.toString());\r
+        }\r
+    }\r
+\r
+    private void VerifyTimeReached(){\r
+        double re = mDevNode.get_Re(mFTCConfiguration.nPPC3_Re0);\r
+        mFTCConfiguration.ntest_delta_tv = (re/mFTCConfiguration.nRe - 1) / mFTCConfiguration.nSpkReAlpha;\r
+\r
+        mFTCConfiguration.nResult = mFTCConfiguration.check_spk_bounds(\r
+                mFTCConfiguration.nRe,\r
+                mFTCConfiguration.nF0,\r
+                mFTCConfiguration.nQ,\r
+                mFTCConfiguration.ntest_delta_tv);\r
+\r
+        // STEP 7: Set temperature limit to target TMAX\r
+        mFTCConfiguration.nprm_pow = mDevNode.Calc_Prm_Pow(\r
+                mFTCConfiguration.nRe,\r
+                mFTCConfiguration.nSpkTMax - mFTCConfiguration.nTCal,\r
+                mFTCConfiguration.nPPC3_RTV,\r
+                mFTCConfiguration.nPPC3_RTM,\r
+                mFTCConfiguration.nPPC3_RTVA,\r
+                mFTCConfiguration.nPPC3_SysGain);\r
+\r
+        mFTCConfiguration.nprm_tlimit = mDevNode.calc_Prm_Tlimit(\r
+                mFTCConfiguration.nSpkTMax - mFTCConfiguration.nTCal,\r
+                mFTCConfiguration.nSpkReAlpha,\r
+                mFTCConfiguration.nPPC3_DevNonlinPer,\r
+                mFTCConfiguration.nPPC3_RTV,\r
+                mFTCConfiguration.nPPC3_RTM,\r
+                mFTCConfiguration.nPPC3_RTVA);\r
+\r
+        mDevNode.set_Re(\r
+                mFTCConfiguration.nPPC3_Re0,\r
+                mFTCConfiguration.nRe,\r
+                mFTCConfiguration.nSpkReAlpha);\r
+\r
+        mDevNode.set_TempCal(\r
+                mFTCConfiguration.nprm_pow,\r
+                mFTCConfiguration.nprm_tlimit);\r
+\r
+        mMediaPlayer.stop();\r
+\r
+        PostCalibration();\r
+    }\r
+\r
+    private void PostCalibration(){\r
+        try {\r
+            // STEP 8: Save Re, f0, Q and Cal Temp into a file\r
+            mFTCConfiguration.saveCalResult("/data/tas2555_cal.txt");\r
+\r
+            // STEP 9: Save .bin file for TAS2555 driver\r
+            if (mFTCConfiguration.nResult == mFTCConfiguration.RESULT_PASS)\r
+            {\r
+                byte[] fwContent = mDevNode.getFwContent();\r
+                mFTCConfiguration.saveCalFirmware("/data/tas2555_cal.bin", fwContent);\r
+\r
+                if(mFTCConfiguration.bLoadCalibration)\r
+                    mDevNode.set_Calibration(0xff);\r
+            }\r
+        }catch (Exception ex){\r
+            Log.e(TAG, ex.toString());\r
+        }\r
+\r
+        mMediaPlayer.release();\r
+    }\r
+}\r
diff --git a/TAS2555-FTC/app/src/main/res/layout/activity_main.xml b/TAS2555-FTC/app/src/main/res/layout/activity_main.xml
new file mode 100755 (executable)
index 0000000..b46a087
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+    xmlns:app="http://schemas.android.com/apk/res-auto"\r
+    xmlns:tools="http://schemas.android.com/tools"\r
+    android:layout_width="match_parent"\r
+    android:layout_height="match_parent"\r
+    android:fitsSystemWindows="true"\r
+    tools:context="com.ti.tas2555.tas2555_ftc.MainActivity">\r
+\r
+    <android.support.design.widget.AppBarLayout\r
+        android:layout_width="match_parent"\r
+        android:layout_height="wrap_content"\r
+        android:theme="@style/AppTheme.AppBarOverlay">\r
+\r
+        <android.support.v7.widget.Toolbar\r
+            android:id="@+id/toolbar"\r
+            android:layout_width="match_parent"\r
+            android:layout_height="?attr/actionBarSize"\r
+            android:background="?attr/colorPrimary"\r
+            app:popupTheme="@style/AppTheme.PopupOverlay" />\r
+\r
+    </android.support.design.widget.AppBarLayout>\r
+\r
+    <include layout="@layout/content_main" />\r
+\r
+    <android.support.design.widget.FloatingActionButton\r
+        android:id="@+id/fab"\r
+        android:layout_width="wrap_content"\r
+        android:layout_height="wrap_content"\r
+        android:layout_gravity="bottom|end"\r
+        android:layout_margin="@dimen/fab_margin"\r
+        android:src="@android:drawable/ic_dialog_email" />\r
+\r
+</android.support.design.widget.CoordinatorLayout>\r
diff --git a/TAS2555-FTC/app/src/main/res/layout/content_main.xml b/TAS2555-FTC/app/src/main/res/layout/content_main.xml
new file mode 100755 (executable)
index 0000000..7c90c59
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+    xmlns:app="http://schemas.android.com/apk/res-auto"\r
+    xmlns:tools="http://schemas.android.com/tools"\r
+    android:layout_width="match_parent"\r
+    android:layout_height="match_parent"\r
+    android:paddingBottom="@dimen/activity_vertical_margin"\r
+    android:paddingLeft="@dimen/activity_horizontal_margin"\r
+    android:paddingRight="@dimen/activity_horizontal_margin"\r
+    android:paddingTop="@dimen/activity_vertical_margin"\r
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"\r
+    tools:context="com.ti.tas2555.tas2555_ftc.MainActivity"\r
+    tools:showIn="@layout/activity_main">\r
+\r
+    <Button\r
+        android:layout_width="wrap_content"\r
+        android:layout_height="wrap_content"\r
+        android:text="New Button"\r
+        android:id="@+id/bnStart"\r
+        android:layout_centerHorizontal="true"\r
+        android:layout_marginTop="114dp" />\r
+</RelativeLayout>\r
diff --git a/TAS2555-FTC/app/src/main/res/menu/menu_main.xml b/TAS2555-FTC/app/src/main/res/menu/menu_main.xml
new file mode 100755 (executable)
index 0000000..e99d281
--- /dev/null
@@ -0,0 +1,10 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"\r
+    xmlns:app="http://schemas.android.com/apk/res-auto"\r
+    xmlns:tools="http://schemas.android.com/tools"\r
+    tools:context="com.ti.tas2555.tas2555_ftc.MainActivity">\r
+    <item\r
+        android:id="@+id/action_settings"\r
+        android:orderInCategory="100"\r
+        android:title="@string/action_settings"\r
+        app:showAsAction="never" />\r
+</menu>\r
diff --git a/TAS2555-FTC/app/src/main/res/mipmap-hdpi/ic_launcher.png b/TAS2555-FTC/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100755 (executable)
index 0000000..cde69bc
Binary files /dev/null and b/TAS2555-FTC/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/TAS2555-FTC/app/src/main/res/mipmap-mdpi/ic_launcher.png b/TAS2555-FTC/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100755 (executable)
index 0000000..c133a0c
Binary files /dev/null and b/TAS2555-FTC/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/TAS2555-FTC/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/TAS2555-FTC/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100755 (executable)
index 0000000..bfa42f0
Binary files /dev/null and b/TAS2555-FTC/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/TAS2555-FTC/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/TAS2555-FTC/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100755 (executable)
index 0000000..324e72c
Binary files /dev/null and b/TAS2555-FTC/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/TAS2555-FTC/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/TAS2555-FTC/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100755 (executable)
index 0000000..aee44e1
Binary files /dev/null and b/TAS2555-FTC/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/TAS2555-FTC/app/src/main/res/values-v21/styles.xml b/TAS2555-FTC/app/src/main/res/values-v21/styles.xml
new file mode 100755 (executable)
index 0000000..cc28b75
--- /dev/null
@@ -0,0 +1,9 @@
+<resources>\r
+\r
+    <style name="AppTheme.NoActionBar">\r
+        <item name="windowActionBar">false</item>\r
+        <item name="windowNoTitle">true</item>\r
+        <item name="android:windowDrawsSystemBarBackgrounds">true</item>\r
+        <item name="android:statusBarColor">@android:color/transparent</item>\r
+    </style>\r
+</resources>\r
diff --git a/TAS2555-FTC/app/src/main/res/values-w820dp/dimens.xml b/TAS2555-FTC/app/src/main/res/values-w820dp/dimens.xml
new file mode 100755 (executable)
index 0000000..62df187
--- /dev/null
@@ -0,0 +1,6 @@
+<resources>\r
+    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\r
+         (such as screen margins) for screens with more than 820dp of available width. This\r
+         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->\r
+    <dimen name="activity_horizontal_margin">64dp</dimen>\r
+</resources>\r
diff --git a/TAS2555-FTC/app/src/main/res/values/colors.xml b/TAS2555-FTC/app/src/main/res/values/colors.xml
new file mode 100755 (executable)
index 0000000..2a12c47
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<resources>\r
+    <color name="colorPrimary">#3F51B5</color>\r
+    <color name="colorPrimaryDark">#303F9F</color>\r
+    <color name="colorAccent">#FF4081</color>\r
+</resources>\r
diff --git a/TAS2555-FTC/app/src/main/res/values/dimens.xml b/TAS2555-FTC/app/src/main/res/values/dimens.xml
new file mode 100755 (executable)
index 0000000..f31eb24
--- /dev/null
@@ -0,0 +1,6 @@
+<resources>\r
+    <!-- Default screen margins, per the Android Design guidelines. -->\r
+    <dimen name="activity_horizontal_margin">16dp</dimen>\r
+    <dimen name="activity_vertical_margin">16dp</dimen>\r
+    <dimen name="fab_margin">16dp</dimen>\r
+</resources>\r
diff --git a/TAS2555-FTC/app/src/main/res/values/strings.xml b/TAS2555-FTC/app/src/main/res/values/strings.xml
new file mode 100755 (executable)
index 0000000..b103227
--- /dev/null
@@ -0,0 +1,4 @@
+<resources>\r
+    <string name="app_name">TAS2555-FTC</string>\r
+    <string name="action_settings">Settings</string>\r
+</resources>\r
diff --git a/TAS2555-FTC/app/src/main/res/values/styles.xml b/TAS2555-FTC/app/src/main/res/values/styles.xml
new file mode 100755 (executable)
index 0000000..80f09db
--- /dev/null
@@ -0,0 +1,20 @@
+<resources>\r
+\r
+    <!-- Base application theme. -->\r
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">\r
+        <!-- Customize your theme here. -->\r
+        <item name="colorPrimary">@color/colorPrimary</item>\r
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>\r
+        <item name="colorAccent">@color/colorAccent</item>\r
+    </style>\r
+\r
+    <style name="AppTheme.NoActionBar">\r
+        <item name="windowActionBar">false</item>\r
+        <item name="windowNoTitle">true</item>\r
+    </style>\r
+\r
+    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />\r
+\r
+    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />\r
+\r
+</resources>\r
diff --git a/TAS2555-FTC/app/src/test/java/com/ti/tas2555/tas2555_ftc/ExampleUnitTest.java b/TAS2555-FTC/app/src/test/java/com/ti/tas2555/tas2555_ftc/ExampleUnitTest.java
new file mode 100755 (executable)
index 0000000..635830e
--- /dev/null
@@ -0,0 +1,15 @@
+package com.ti.tas2555.tas2555_ftc;\r
+\r
+import org.junit.Test;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+/**\r
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.\r
+ */\r
+public class ExampleUnitTest {\r
+    @Test\r
+    public void addition_isCorrect() throws Exception {\r
+        assertEquals(4, 2 + 2);\r
+    }\r
+}
\ No newline at end of file
diff --git a/TAS2555-FTC/build.gradle b/TAS2555-FTC/build.gradle
new file mode 100755 (executable)
index 0000000..574d577
--- /dev/null
@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.\r
+\r
+buildscript {\r
+    repositories {\r
+        jcenter()\r
+    }\r
+    dependencies {\r
+        classpath 'com.android.tools.build:gradle:2.1.2'\r
+\r
+        // NOTE: Do not place your application dependencies here; they belong\r
+        // in the individual module build.gradle files\r
+    }\r
+}\r
+\r
+allprojects {\r
+    repositories {\r
+        jcenter()\r
+    }\r
+}\r
+\r
+task clean(type: Delete) {\r
+    delete rootProject.buildDir\r
+}\r
diff --git a/TAS2555-FTC/ftcc/.gitignore b/TAS2555-FTC/ftcc/.gitignore
new file mode 100755 (executable)
index 0000000..3543521
--- /dev/null
@@ -0,0 +1 @@
+/build\r
diff --git a/TAS2555-FTC/ftcc/build.gradle b/TAS2555-FTC/ftcc/build.gradle
new file mode 100755 (executable)
index 0000000..8e97687
--- /dev/null
@@ -0,0 +1,35 @@
+apply plugin: 'com.android.library'\r
+\r
+android {\r
+    compileSdkVersion 23\r
+    buildToolsVersion "23.0.3"\r
+\r
+    repositories {\r
+        maven { url 'http://repo1.maven.org/maven2' }      //this is newly added\r
+    }\r
+\r
+    defaultConfig {\r
+        minSdkVersion 19\r
+        targetSdkVersion 23\r
+        versionCode 1\r
+        versionName "1.0"\r
+    }\r
+    buildTypes {\r
+        release {\r
+            minifyEnabled false\r
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r
+        }\r
+    }\r
+       \r
+        sourceSets {\r
+         main {\r
+            jniLibs.srcDirs = ['libs']\r
+        }\r
+    }\r
+}\r
+\r
+dependencies {\r
+    compile fileTree(dir: 'libs', include: ['*.jar'])\r
+    testCompile 'junit:junit:4.12'\r
+    compile 'com.android.support:appcompat-v7:23.4.0'\r
+}\r
diff --git a/TAS2555-FTC/ftcc/libs/armeabi/libTAS2555ftc.so b/TAS2555-FTC/ftcc/libs/armeabi/libTAS2555ftc.so
new file mode 100755 (executable)
index 0000000..a10ced5
Binary files /dev/null and b/TAS2555-FTC/ftcc/libs/armeabi/libTAS2555ftc.so differ
diff --git a/TAS2555-FTC/ftcc/proguard-rules.pro b/TAS2555-FTC/ftcc/proguard-rules.pro
new file mode 100755 (executable)
index 0000000..34dc54d
--- /dev/null
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.\r
+# By default, the flags in this file are appended to flags specified\r
+# in C:\ti\Android\sdk/tools/proguard/proguard-android.txt\r
+# You can edit the include path and order by changing the proguardFiles\r
+# directive in build.gradle.\r
+#\r
+# For more details, see\r
+#   http://developer.android.com/guide/developing/tools/proguard.html\r
+\r
+# Add any project specific keep options here:\r
+\r
+# If your project uses WebView with JS, uncomment the following\r
+# and specify the fully qualified class name to the JavaScript interface\r
+# class:\r
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\r
+#   public *;\r
+#}\r
diff --git a/TAS2555-FTC/ftcc/src/androidTest/java/com/ti/tas2555/ftcc/ApplicationTest.java b/TAS2555-FTC/ftcc/src/androidTest/java/com/ti/tas2555/ftcc/ApplicationTest.java
new file mode 100755 (executable)
index 0000000..5184951
--- /dev/null
@@ -0,0 +1,13 @@
+package com.ti.tas2555.ftcc;\r
+\r
+import android.app.Application;\r
+import android.test.ApplicationTestCase;\r
+\r
+/**\r
+ * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>\r
+ */\r
+public class ApplicationTest extends ApplicationTestCase<Application> {\r
+    public ApplicationTest() {\r
+        super(Application.class);\r
+    }\r
+}
\ No newline at end of file
diff --git a/TAS2555-FTC/ftcc/src/main/AndroidManifest.xml b/TAS2555-FTC/ftcc/src/main/AndroidManifest.xml
new file mode 100755 (executable)
index 0000000..332bc47
--- /dev/null
@@ -0,0 +1,11 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"\r
+    package="com.ti.tas2555.ftcc">\r
+\r
+    <application\r
+        android:allowBackup="true"\r
+        android:label="@string/app_name"\r
+        android:supportsRtl="true">\r
+\r
+    </application>\r
+\r
+</manifest>\r
diff --git a/TAS2555-FTC/ftcc/src/main/java/com/ti/tas2555/ftcc/TAS2555Node.java b/TAS2555-FTC/ftcc/src/main/java/com/ti/tas2555/ftcc/TAS2555Node.java
new file mode 100755 (executable)
index 0000000..a354d1a
--- /dev/null
@@ -0,0 +1,94 @@
+package com.ti.tas2555.ftcc;\r
+\r
+import android.util.Log;\r
+\r
+import java.io.BufferedOutputStream;\r
+import java.io.FileNotFoundException;\r
+import java.io.FileOutputStream;\r
+import java.security.PublicKey;\r
+\r
+/**\r
+ * Created by a0220410 on 6/10/2016.\r
+ */\r
+public class TAS2555Node {\r
+    static{\r
+        System.loadLibrary("TAS2555ftc");\r
+    }\r
+\r
+    private native void Open(String devnode);\r
+    private native void Close();\r
+    private native void setSCTH(double nSCTH);\r
+    private native void setRe(double ppc3_re0, double re, double alpha);\r
+    private native void setNFS(double nNFS);\r
+    private native double getRe(double ppc3_re0);\r
+    private native double getF0(int fs);\r
+    private native double getQ(int fs);\r
+    private native double getPiGain(double nRTV, double nRTM, double nRTVA);\r
+    private native void setTempCal(int prm_pow, int prm_tlimit);\r
+    private native int CalcPrmPow(double re, double delta_t_max, double nRTV, double nRTM, double nRTVA, double nSysGain);\r
+    private native int calcPrmTlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA);\r
+    private native void setConfiguration(int configuration);\r
+    private native void setCalibration(int calibration);\r
+    private native byte[] GetFWContent();\r
+\r
+    public TAS2555Node(){\r
+    }\r
+\r
+    public void set_SCTH(double nSCTH){\r
+        setSCTH(nSCTH);\r
+    }\r
+\r
+    public void set_Re(double ppc3_re0, double re, double alpha){\r
+        setRe(ppc3_re0, re, alpha);\r
+    }\r
+\r
+    public void set_NFS(double nNFS){\r
+        setNFS(nNFS);\r
+    }\r
+\r
+    public double get_Re(double ppc3_re0){\r
+        return getRe(ppc3_re0);\r
+    }\r
+\r
+    public double get_f0(int fs){\r
+        return getF0(fs);\r
+    }\r
+\r
+    public double get_Q(int fs){\r
+        return getQ(fs);\r
+    }\r
+\r
+    public double get_pi_gain(double nRTV, double nRTM, double nRTVA){\r
+        return getPiGain(nRTV, nRTM, nRTVA);\r
+    }\r
+\r
+    public void set_TempCal(int prm_pow, int prm_tlimit){\r
+        setTempCal(prm_pow, prm_tlimit);\r
+    }\r
+\r
+    public int Calc_Prm_Pow(double re, double delta_t_max, double nRTV, double nRTM, double nRTVA, double nSysGain){\r
+        return CalcPrmPow(re, delta_t_max, nRTV, nRTM, nRTVA, nSysGain);\r
+    }\r
+\r
+    public int calc_Prm_Tlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA){\r
+        return calcPrmTlimit(delta_t_max, alpha, nDevNonlinPer, nRTV, nRTM, nRTVA);\r
+    }\r
+\r
+    public void set_Configuration(int configuration){\r
+        setConfiguration(configuration);\r
+    }\r
+\r
+    public void set_Calibration(int calibration){\r
+        setCalibration(calibration);\r
+    }\r
+\r
+    public void OpenNode(String devnode){\r
+        Open(devnode);\r
+    }\r
+\r
+    public void CloseNode(){\r
+        Close();\r
+    }\r
+\r
+    public byte[] getFwContent(){return  GetFWContent();}\r
+}\r
diff --git a/TAS2555-FTC/ftcc/src/main/java/com/ti/tas2555/ftcc/TFTCConfiguration.java b/TAS2555-FTC/ftcc/src/main/java/com/ti/tas2555/ftcc/TFTCConfiguration.java
new file mode 100755 (executable)
index 0000000..93e6712
--- /dev/null
@@ -0,0 +1,353 @@
+package com.ti.tas2555.ftcc;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.BufferedWriter;\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.FileReader;\r
+import java.io.FileWriter;\r
+import java.util.Arrays;\r
+import java.util.InvalidPropertiesFormatException;\r
+\r
+/**\r
+ * Created by a0220410 on 6/10/2016.\r
+ */\r
+public class TFTCConfiguration {\r
+    private String CALIBRATION_TIME = "CALIBRATION_TIME";\r
+    private String VERIFICATION_TIME = "VERIFICATION_TIME";\r
+    private String TEST_DELTA_T = "TEST_DELTA_T";\r
+    private String CONFIGURATION = "CONFIGURATION";\r
+    private String CONFIGURATION_CALIBRATION = "CONFIGURATION_CALIBRATION";\r
+    private String SPK_T_MAX = "SPK_T_MAX";\r
+    private String SPK_RE_TOL_PER = "SPK_RE_TOL_PER";\r
+    private String SPK_RE_ALPHA = "SPK_RE_ALPHA";\r
+    private String PPC3_RE0 = "PPC3_RE0";\r
+    private String PPC3_RTV = "PPC3_RTV";\r
+    private String PPC3_RTM = "PPC3_RTM";\r
+    private String PPC3_RTVA = "PPC3_RTVA";\r
+    private String PPC3_SYSGAIN = "PPC3_SYSGAIN";\r
+    private String PPC3_DEV_NONLIN_PER = "PPC3_DEV_NONLIN_PER";\r
+    private String PPC3_DELTA_T_LIMIT = "PPC3_DELTA_T_LIMIT";\r
+    private String FS_RATE = "FS_RATE";\r
+    private String RE_HI = "RE_HI";\r
+    private String RE_LO = "RE_LO";\r
+    private String F0_HI = "F0_HI";\r
+    private String F0_LO = "F0_LO";\r
+    private String Q_HI = "Q_HI";\r
+    private String Q_LO = "Q_LO";\r
+    private String T_HI = "T_HI";\r
+    private String T_LO = "T_LO";\r
+    private String NFS = "NFS";\r
+    private String SCTH = "SCTH";\r
+    public int RESULT_PASS = 0x00000000;\r
+    public int RE_FAIL_HI = 0x00000001;\r
+    public int RE_FAIL_LO = 0x00000010;\r
+    public int F0_FAIL_HI = 0x00000100;\r
+    public int F0_FAIL_LO = 0x00001000;\r
+    public int Q_FAIL_HI  = 0x00010000;\r
+    public int Q_FAIL_LO  = 0x00100000;\r
+    public int T_FAIL_HI  = 0x01000000;\r
+    public int T_FAIL_LO  = 0x10000000;\r
+\r
+    public boolean bVerbose;\r
+    public boolean bLoadCalibration;\r
+\r
+    public int nCalibrationTime;\r
+    public int nVerificationTime;\r
+\r
+    public double nNFS;\r
+    public double nSCTH;\r
+\r
+    public boolean bFTCBypass;\r
+    public double nTestDeltaT;\r
+    public int nConfiguration;\r
+    public int nConfigurationCalibration;\r
+\r
+    public double nSpkTMax;\r
+    public double nSpkReTolPer;\r
+    public double nSpkReAlpha;\r
+\r
+    public double nPPC3_Re0;\r
+    public double nPPC3_RTV;\r
+    public double nPPC3_RTM;\r
+    public double nPPC3_RTVA;\r
+    public double nPPC3_SysGain;\r
+    public double nPPC3_DevNonlinPer;\r
+    public double nPPC3_DeltaTLimit;\r
+    public int nFSRate;\r
+\r
+    public double nReHi;\r
+    public double nReLo;\r
+    public double nF0Hi;\r
+    public double nF0Lo;\r
+    public double nQHi;\r
+    public double nQLo;\r
+    public double nTHi;\r
+    public double nTLo;\r
+\r
+    public double nRe;\r
+    public double nF0;\r
+    public double nQ;\r
+    public double nT;\r
+    public double nTCal;\r
+    public double ntest_delta_tv;\r
+    public int nResult;\r
+    public int nprm_pow;\r
+    public int nprm_tlimit;\r
+\r
+    private int MAX_BIN_SIZE = 2048;\r
+    private char[] gpBin = new char[MAX_BIN_SIZE];\r
+    private int gnBinIndex = 0;\r
+    private int gnBinBlockIndex = 0;\r
+\r
+    public void LoadFTCC(String filename)throws java.io.IOException{\r
+        FileReader fileReader = new FileReader(filename);\r
+        BufferedReader bufferedReader = new BufferedReader(fileReader);\r
+\r
+        while (bufferedReader.ready()){\r
+            String line = bufferedReader.readLine();\r
+            if(line == null) break;\r
+            if(line.isEmpty() || line.startsWith(";")) continue;\r
+\r
+            int idx = line.indexOf(';');\r
+            if(idx != -1) line = line.substring(0, idx -1);\r
+            ftcc_parse(line);\r
+        }\r
+\r
+        bufferedReader.close();\r
+        fileReader.close();\r
+    }\r
+\r
+    private void ftcc_parse(String line) throws InvalidPropertiesFormatException{\r
+        if(line.contains(CALIBRATION_TIME))\r
+            nCalibrationTime = getInt(CALIBRATION_TIME, line);\r
+        else if(line.contains(VERIFICATION_TIME))\r
+            nVerificationTime = getInt(VERIFICATION_TIME, line);\r
+        else if(line.contains(TEST_DELTA_T))\r
+            nTestDeltaT = getFloat(TEST_DELTA_T, line);\r
+        else if(line.contains(CONFIGURATION_CALIBRATION))\r
+            nConfigurationCalibration = getInt(CONFIGURATION_CALIBRATION, line);\r
+        else if(line.contains(CONFIGURATION))\r
+            nConfiguration = getInt(CONFIGURATION, line);\r
+        else if(line.contains(SPK_T_MAX))\r
+            nSpkTMax = getFloat(SPK_T_MAX, line);\r
+        else if(line.contains(SPK_RE_TOL_PER))\r
+            nSpkReTolPer = getFloat(SPK_RE_TOL_PER, line);\r
+        else if(line.contains(SPK_RE_ALPHA))\r
+            nSpkReAlpha = getFloat(SPK_RE_ALPHA, line);\r
+        else if(line.contains(PPC3_RE0))\r
+            nPPC3_Re0 = getFloat(PPC3_RE0, line);\r
+        else if(line.contains(PPC3_RTV))\r
+            nPPC3_RTV = getFloat(PPC3_RTV, line);\r
+        else if(line.contains(PPC3_RTM))\r
+            nPPC3_RTM = getFloat(PPC3_RTM, line);\r
+        else if(line.contains(PPC3_RTVA))\r
+            nPPC3_RTVA = getFloat(PPC3_RTVA, line);\r
+        else if(line.contains(PPC3_SYSGAIN))\r
+            nPPC3_SysGain = getFloat(PPC3_SYSGAIN, line);\r
+        else if(line.contains(PPC3_DEV_NONLIN_PER))\r
+            nPPC3_DevNonlinPer = getFloat(PPC3_DEV_NONLIN_PER, line);\r
+        else if(line.contains(PPC3_DELTA_T_LIMIT))\r
+            nPPC3_DeltaTLimit = getFloat(PPC3_DELTA_T_LIMIT, line);\r
+        else if(line.contains(FS_RATE))\r
+            nFSRate = getInt(FS_RATE, line);\r
+        else if(line.contains(RE_HI))\r
+            nReHi = getFloat(RE_HI, line);\r
+        else if(line.contains(RE_LO))\r
+            nReLo = getFloat(RE_LO, line);\r
+        else if(line.contains(F0_HI))\r
+            nF0Hi = getFloat(F0_HI, line);\r
+        else if(line.contains(F0_LO))\r
+            nF0Lo = getFloat(F0_LO, line);\r
+        else if(line.contains(Q_HI))\r
+            nQHi = getFloat(Q_HI, line);\r
+        else if(line.contains(Q_LO))\r
+            nQLo = getFloat(Q_LO, line);\r
+        else if(line.contains(T_HI))\r
+            nTHi = getFloat(T_HI, line);\r
+        else if(line.contains(T_LO))\r
+            nTLo = getFloat(T_LO, line);\r
+        else if(line.contains(NFS))\r
+            nNFS = getFloat(NFS, line);\r
+        else if(line.contains(SCTH))\r
+            nSCTH = getFloat(SCTH, line);\r
+    }\r
+\r
+    private int getInt(String key, String line) throws InvalidPropertiesFormatException{\r
+        int val = 0;\r
+        int idx = line.lastIndexOf('=');\r
+        if(idx < key.length())\r
+            throw new InvalidPropertiesFormatException(line);\r
+\r
+        String convert = line.substring(idx + 1);\r
+        convert.replace('\r', ' ');\r
+        convert.replace('\n', ' ');\r
+        convert.replace('\t', ' ');\r
+        convert = convert.trim();\r
+\r
+        val = Integer.valueOf(convert);\r
+\r
+        return val;\r
+    }\r
+\r
+    private float getFloat(String key, String line)throws InvalidPropertiesFormatException{\r
+        float val = 0;\r
+        int idx = line.lastIndexOf('=');\r
+        if(idx < key.length())\r
+            throw new InvalidPropertiesFormatException(line);\r
+\r
+        String convert = line.substring(idx + 1);\r
+        convert.replace('\r', ' ');\r
+        convert.replace('\n', ' ');\r
+        convert.replace('\t', ' ');\r
+        convert = convert.trim();\r
+\r
+        val = Float.valueOf(convert);\r
+        return val;\r
+    }\r
+\r
+    public int check_spk_bounds(double re, double f0, double q, double test_delta_tv)\r
+    {\r
+        int result = RESULT_PASS;\r
+\r
+        if(re>nReHi)\r
+            result |= RE_FAIL_HI;\r
+        if(re<nReLo)\r
+            result |= RE_FAIL_LO;\r
+        if(f0>nF0Hi)\r
+            result |= F0_FAIL_HI;\r
+        if(f0<nF0Lo)\r
+            result |= F0_FAIL_LO;\r
+        if(q>nQHi)\r
+            result |= Q_FAIL_HI;\r
+        if(q<nQLo)\r
+            result |= Q_FAIL_LO;\r
+        if(test_delta_tv>nTHi)\r
+            result |= T_FAIL_HI;\r
+        if(test_delta_tv<nTLo)\r
+            result |= T_FAIL_LO;\r
+\r
+        return result;\r
+    }\r
+\r
+    public void saveCalResult(String file) throws java.io.IOException{\r
+        FileWriter fileWriter = new FileWriter(file);\r
+        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\r
+\r
+        bufferedWriter.write(String.format("Re = %1.2f\n\r", nRe));\r
+        bufferedWriter.write(String.format("F0 = %3.0f\n\r", nF0));\r
+        bufferedWriter.write(String.format("Q  = %1.3f\n\r", nQ));\r
+        bufferedWriter.write(String.format("t0 = %2.2f\n\r\n\r", nTCal));\r
+        bufferedWriter.write(String.format("rms_pow       = 0x%08X\n\r", nprm_pow));\r
+        bufferedWriter.write(String.format("t_limit       = 0x%08X\n\r", nprm_tlimit));\r
+        bufferedWriter.write(String.format("test_delta_tv = %2.2f C\n\r", ntest_delta_tv));\r
+        bufferedWriter.write(String.format("result        = 0x%08X\n\r", nResult));\r
+\r
+        bufferedWriter.flush();\r
+        bufferedWriter.close();\r
+        fileWriter.close();\r
+    }\r
+\r
+    public void saveCalFirmware(String file, byte[] fwData) throws java.io.IOException{\r
+        FileWriter fileWriter = new FileWriter(file);\r
+        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\r
+\r
+        PrepareCalFWHeader();\r
+\r
+        for(int i=0; i < fwData.length; i++){\r
+            gpBin[gnBinIndex++] = (char) fwData[i];\r
+        }\r
+\r
+        PrepareClosure();\r
+\r
+        bufferedWriter.write(gpBin, 0, gnBinIndex);\r
+\r
+        bufferedWriter.flush();\r
+        bufferedWriter.close();\r
+        fileWriter.close();\r
+    }\r
+\r
+    private void PrepareCalFWHeader(){\r
+        String datafile = "Calibration Data File";\r
+        String description = "Calibration Data File";\r
+        gpBin[3] = '2';\r
+        gpBin[2] = '5';\r
+        gpBin[1] = '5';\r
+        gpBin[0] = '5';\r
+\r
+        for(int i=0; i < datafile.length(); i++){\r
+            gpBin[24+i] = datafile.charAt(i);\r
+        }\r
+\r
+        for(int i=0; i < description.length(); i++){\r
+            gpBin[24 + 64 + i] = description.charAt(i);\r
+        }\r
+\r
+\r
+        gnBinIndex += 24 + 64 + description.length() + 1;\r
+\r
+        gnBinIndex +=\r
+                4 +    //device family index\r
+                        4 +    //device index\r
+                        2 +    //num PLL index\r
+                        0 +    //array PLL index\r
+                        2 +    //num programs index\r
+                        0 +    //array programs index\r
+                        2 +    //num configurations index\r
+                        0;     //array configurations index\r
+\r
+        gpBin[gnBinIndex++] = 0x00;\r
+        gpBin[gnBinIndex++] = 0x01; // one calibration data block\r
+\r
+        String CalibrationData = "Calibration Data";\r
+        for(int i=0; i < CalibrationData.length(); i++){\r
+            gpBin[gnBinIndex+ i] = CalibrationData.charAt(i);\r
+        }\r
+        gnBinIndex += 64;\r
+\r
+        String CalibrationData2555 = "Calibration Data for TAS2555";\r
+        for(int i=0; i < CalibrationData2555.length(); i++){\r
+            gpBin[gnBinIndex+ i] = CalibrationData2555.charAt(i);\r
+        }\r
+        gnBinIndex += CalibrationData2555.length() + 1;\r
+\r
+        gpBin[gnBinIndex++] = 0x00; // compatible program = smart amp (index 0)\r
+        gpBin[gnBinIndex++] = (char)nConfiguration; // compatible configuration\r
+\r
+        gpBin[gnBinIndex++] = 0x00;\r
+        gpBin[gnBinIndex++] = 0x00;\r
+        gpBin[gnBinIndex++] = 0x00;\r
+        gpBin[gnBinIndex++] = 0x0A; // block type = 0x0A (calibration)\r
+        gnBinBlockIndex = gnBinIndex;\r
+\r
+        gnBinIndex += 4; // number of commands index\r
+    }\r
+\r
+    private void PrepareClosure(){\r
+        int nCommands;\r
+        char pCommit[] = {\r
+            0x00, 0x04, 0x85, 0x00,\r
+            0x8C, 0x19, 0x7C, 0x00,\r
+            0x00, 0x00, 0x01, 0x00\r
+        };\r
+\r
+        // write the commit sequence\r
+        for(int i=0; i < pCommit.length; i++){\r
+            gpBin[gnBinIndex++] = pCommit[i];\r
+        }\r
+\r
+        nCommands = ((gnBinIndex - gnBinBlockIndex) / 4) - 1;\r
+\r
+        // write number of commands for calibration block\r
+        gpBin[gnBinBlockIndex++] = (char)((nCommands & 0xFF000000) >> 24);\r
+        gpBin[gnBinBlockIndex++] = (char)((nCommands & 0x00FF0000) >> 16);\r
+        gpBin[gnBinBlockIndex++] = (char)((nCommands & 0x0000FF00) >> 8);\r
+        gpBin[gnBinBlockIndex++] = (char)(nCommands & 0x000000FF);\r
+\r
+        // write bin file size\r
+        gpBin[4] = (char)((gnBinIndex & 0xFF000000) >> 24);\r
+        gpBin[5] = (char)((gnBinIndex & 0x00FF0000) >> 16);\r
+        gpBin[6] = (char)((gnBinIndex & 0x0000FF00) >> 8);\r
+        gpBin[7] = (char)((gnBinIndex & 0x000000FF));\r
+    }\r
+}\r
diff --git a/TAS2555-FTC/ftcc/src/main/res/values/strings.xml b/TAS2555-FTC/ftcc/src/main/res/values/strings.xml
new file mode 100755 (executable)
index 0000000..1308c66
--- /dev/null
@@ -0,0 +1,3 @@
+<resources>\r
+    <string name="app_name">FTCC</string>\r
+</resources>\r
diff --git a/TAS2555-FTC/ftcc/src/test/java/com/ti/tas2555/ftcc/ExampleUnitTest.java b/TAS2555-FTC/ftcc/src/test/java/com/ti/tas2555/ftcc/ExampleUnitTest.java
new file mode 100755 (executable)
index 0000000..ea5b519
--- /dev/null
@@ -0,0 +1,15 @@
+package com.ti.tas2555.ftcc;\r
+\r
+import org.junit.Test;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+/**\r
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.\r
+ */\r
+public class ExampleUnitTest {\r
+    @Test\r
+    public void addition_isCorrect() throws Exception {\r
+        assertEquals(4, 2 + 2);\r
+    }\r
+}
\ No newline at end of file
diff --git a/TAS2555-FTC/gradle.properties b/TAS2555-FTC/gradle.properties
new file mode 100755 (executable)
index 0000000..417641c
--- /dev/null
@@ -0,0 +1,18 @@
+## Project-wide Gradle settings.\r
+#\r
+# For more details on how to configure your build environment visit\r
+# http://www.gradle.org/docs/current/userguide/build_environment.html\r
+#\r
+# Specifies the JVM arguments used for the daemon process.\r
+# The setting is particularly useful for tweaking memory settings.\r
+# Default value: -Xmx10248m -XX:MaxPermSize=256m\r
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\r
+#\r
+# When configured, Gradle will run in incubating parallel mode.\r
+# This option should only be used with decoupled projects. More details, visit\r
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\r
+# org.gradle.parallel=true\r
+#Fri Jun 10 00:46:06 CST 2016\r
+systemProp.http.proxyHost=wwwgate.ti.com\r
+systemProp.http.nonProxyHosts=10.*\r
+systemProp.http.proxyPort=80\r
diff --git a/TAS2555-FTC/gradle/wrapper/gradle-wrapper.jar b/TAS2555-FTC/gradle/wrapper/gradle-wrapper.jar
new file mode 100755 (executable)
index 0000000..13372ae
Binary files /dev/null and b/TAS2555-FTC/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/TAS2555-FTC/gradle/wrapper/gradle-wrapper.properties b/TAS2555-FTC/gradle/wrapper/gradle-wrapper.properties
new file mode 100755 (executable)
index 0000000..122a0dc
--- /dev/null
@@ -0,0 +1,6 @@
+#Mon Dec 28 10:00:20 PST 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
diff --git a/TAS2555-FTC/gradlew b/TAS2555-FTC/gradlew
new file mode 100755 (executable)
index 0000000..9d82f78
--- /dev/null
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+    JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/TAS2555-FTC/gradlew.bat b/TAS2555-FTC/gradlew.bat
new file mode 100755 (executable)
index 0000000..aec9973
--- /dev/null
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off\r
+@rem ##########################################################################\r
+@rem\r
+@rem  Gradle startup script for Windows\r
+@rem\r
+@rem ##########################################################################\r
+\r
+@rem Set local scope for the variables with windows NT shell\r
+if "%OS%"=="Windows_NT" setlocal\r
+\r
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r
+set DEFAULT_JVM_OPTS=\r
+\r
+set DIRNAME=%~dp0\r
+if "%DIRNAME%" == "" set DIRNAME=.\r
+set APP_BASE_NAME=%~n0\r
+set APP_HOME=%DIRNAME%\r
+\r
+@rem Find java.exe\r
+if defined JAVA_HOME goto findJavaFromJavaHome\r
+\r
+set JAVA_EXE=java.exe\r
+%JAVA_EXE% -version >NUL 2>&1\r
+if "%ERRORLEVEL%" == "0" goto init\r
+\r
+echo.\r
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r
+echo.\r
+echo Please set the JAVA_HOME variable in your environment to match the\r
+echo location of your Java installation.\r
+\r
+goto fail\r
+\r
+:findJavaFromJavaHome\r
+set JAVA_HOME=%JAVA_HOME:"=%\r
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe\r
+\r
+if exist "%JAVA_EXE%" goto init\r
+\r
+echo.\r
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r
+echo.\r
+echo Please set the JAVA_HOME variable in your environment to match the\r
+echo location of your Java installation.\r
+\r
+goto fail\r
+\r
+:init\r
+@rem Get command-line arguments, handling Windowz variants\r
+\r
+if not "%OS%" == "Windows_NT" goto win9xME_args\r
+if "%@eval[2+2]" == "4" goto 4NT_args\r
+\r
+:win9xME_args\r
+@rem Slurp the command line arguments.\r
+set CMD_LINE_ARGS=\r
+set _SKIP=2\r
+\r
+:win9xME_args_slurp\r
+if "x%~1" == "x" goto execute\r
+\r
+set CMD_LINE_ARGS=%*\r
+goto execute\r
+\r
+:4NT_args\r
+@rem Get arguments from the 4NT Shell from JP Software\r
+set CMD_LINE_ARGS=%$\r
+\r
+:execute\r
+@rem Setup the command line\r
+\r
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar\r
+\r
+@rem Execute Gradle\r
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r
+\r
+:end\r
+@rem End local scope for the variables with windows NT shell\r
+if "%ERRORLEVEL%"=="0" goto mainEnd\r
+\r
+:fail\r
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r
+rem the _cmd.exe /c_ return code!\r
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1\r
+exit /b 1\r
+\r
+:mainEnd\r
+if "%OS%"=="Windows_NT" endlocal\r
+\r
+:omega\r
diff --git a/TAS2555-FTC/settings.gradle b/TAS2555-FTC/settings.gradle
new file mode 100755 (executable)
index 0000000..5f008f0
--- /dev/null
@@ -0,0 +1 @@
+include ':app', ':ftcc'\r