Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Fixed a BIG BAD bug with setting the timeout on the Chameleon board.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxieds committed May 19, 2018
1 parent 25bc1a5 commit 259883b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
applicationId "com.maxieds.chameleonminilivedebugger"
minSdkVersion 21
targetSdkVersion 27
versionCode 44
versionName "0.4.4"
versionCode 46
versionName "0.4.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ public static SerialRespCode executeChameleonMiniCommand(UsbSerialDevice cmPort,
timeout *= -1;
SystemClock.sleep(timeout);
}
if (timeout != Utils.parseInt(deviceStatus.TIMEOUT))
setTimeout(cmPort, timeout);
//if (timeout != Utils.parseInt(deviceStatus.TIMEOUT))
// setTimeout(cmPort, timeout);
String deviceConfigCmd = rawCmd + "\n\r";
byte[] sendBuf = deviceConfigCmd.getBytes(StandardCharsets.UTF_8);
cmPort.write(sendBuf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,13 @@ protected void onCreate(Bundle savedInstanceState) {

// fix bug where the tabs are blank when the application is relaunched:
super.onCreate(savedInstanceState); // should fix most of the crashes in the ANR report on Play Store
if(!BuildConfig.DEBUG)
Fabric.with(this, new Crashlytics());
if(runningActivity == null || !isTaskRoot()) {
Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler);
if(!BuildConfig.DEBUG) {
Log.w(TAG, "Loading crashlytics");
Fabric.with(this, new Crashlytics());
}
Log.w(TAG, "Created new activity");
//Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler);
}
if(!isTaskRoot()) {
Log.w(TAG, "ReLaunch Intent Action: " + getIntent().getAction());
Expand Down Expand Up @@ -711,7 +714,10 @@ else if(ChameleonIO.WAITING_FOR_RESPONSE && ChameleonIO.isCommandResponse(liveLo
String[] strLogData = (new String(liveLogData)).split("[\n\r]+");
//Log.i(TAG, strLogData);
ChameleonIO.DEVICE_RESPONSE_CODE = strLogData[0];
ChameleonIO.DEVICE_RESPONSE = Arrays.copyOfRange(strLogData, 1, strLogData.length);
if(strLogData.length >= 2)
ChameleonIO.DEVICE_RESPONSE = Arrays.copyOfRange(strLogData, 1, strLogData.length);
else
ChameleonIO.DEVICE_RESPONSE[0] = strLogData[0];
if(ChameleonIO.EXPECTING_BINARY_DATA) {
int binaryBufSize = liveLogData.length - ChameleonIO.DEVICE_RESPONSE_CODE.length() - 2;
ChameleonIO.DEVICE_RESPONSE_BINARY = new byte[binaryBufSize];
Expand Down

0 comments on commit 259883b

Please sign in to comment.