Skip to content

Commit 259883b

Browse files
committed
Fixed a BIG BAD bug with setting the timeout on the Chameleon board.
1 parent 25bc1a5 commit 259883b

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ android {
2626
applicationId "com.maxieds.chameleonminilivedebugger"
2727
minSdkVersion 21
2828
targetSdkVersion 27
29-
versionCode 44
30-
versionName "0.4.4"
29+
versionCode 46
30+
versionName "0.4.6"
3131
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3232
multiDexEnabled true
3333
}

app/src/main/java/com/maxieds/chameleonminilivedebugger/ChameleonIO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ public static SerialRespCode executeChameleonMiniCommand(UsbSerialDevice cmPort,
358358
timeout *= -1;
359359
SystemClock.sleep(timeout);
360360
}
361-
if (timeout != Utils.parseInt(deviceStatus.TIMEOUT))
362-
setTimeout(cmPort, timeout);
361+
//if (timeout != Utils.parseInt(deviceStatus.TIMEOUT))
362+
// setTimeout(cmPort, timeout);
363363
String deviceConfigCmd = rawCmd + "\n\r";
364364
byte[] sendBuf = deviceConfigCmd.getBytes(StandardCharsets.UTF_8);
365365
cmPort.write(sendBuf);

app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,13 @@ protected void onCreate(Bundle savedInstanceState) {
203203

204204
// fix bug where the tabs are blank when the application is relaunched:
205205
super.onCreate(savedInstanceState); // should fix most of the crashes in the ANR report on Play Store
206-
if(!BuildConfig.DEBUG)
207-
Fabric.with(this, new Crashlytics());
208206
if(runningActivity == null || !isTaskRoot()) {
209-
Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler);
207+
if(!BuildConfig.DEBUG) {
208+
Log.w(TAG, "Loading crashlytics");
209+
Fabric.with(this, new Crashlytics());
210+
}
211+
Log.w(TAG, "Created new activity");
212+
//Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler);
210213
}
211214
if(!isTaskRoot()) {
212215
Log.w(TAG, "ReLaunch Intent Action: " + getIntent().getAction());
@@ -711,7 +714,10 @@ else if(ChameleonIO.WAITING_FOR_RESPONSE && ChameleonIO.isCommandResponse(liveLo
711714
String[] strLogData = (new String(liveLogData)).split("[\n\r]+");
712715
//Log.i(TAG, strLogData);
713716
ChameleonIO.DEVICE_RESPONSE_CODE = strLogData[0];
714-
ChameleonIO.DEVICE_RESPONSE = Arrays.copyOfRange(strLogData, 1, strLogData.length);
717+
if(strLogData.length >= 2)
718+
ChameleonIO.DEVICE_RESPONSE = Arrays.copyOfRange(strLogData, 1, strLogData.length);
719+
else
720+
ChameleonIO.DEVICE_RESPONSE[0] = strLogData[0];
715721
if(ChameleonIO.EXPECTING_BINARY_DATA) {
716722
int binaryBufSize = liveLogData.length - ChameleonIO.DEVICE_RESPONSE_CODE.length() - 2;
717723
ChameleonIO.DEVICE_RESPONSE_BINARY = new byte[binaryBufSize];

0 commit comments

Comments
 (0)