Skip to content

Commit

Permalink
Fix crash bug when opening settings without a radio connected.
Browse files Browse the repository at this point in the history
  • Loading branch information
VanceVagell committed Jan 26, 2025
1 parent c5fc742 commit 0a2dfd9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android-src/KV4PHT/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.vagell.kv4pht"
minSdk 26
targetSdk 34
versionCode 31
versionName "1.6.7"
versionCode 32
versionName "1.7.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public class FirmwareUtils {
private static int progressPercent = 0;

// Whenever there is new firmware, put the files in res/raw, and update these constants.
public static final int PACKAGED_FIRMWARE_VER = 9;
private static final int FIRMWARE_FILE_1_ID = R.raw.v9_kv4p_ht_esp32_wroom_32_ino_bootloader;
private static final int FIRMWARE_FILE_2_ID = R.raw.v9_kv4p_ht_esp32_wroom_32_ino_partitions;
public static final int PACKAGED_FIRMWARE_VER = 10;
private static final int FIRMWARE_FILE_1_ID = R.raw.v10_kv4p_ht_esp32_wroom_32_ino_bootloader;
private static final int FIRMWARE_FILE_2_ID = R.raw.v10_kv4p_ht_esp32_wroom_32_ino_partitions;
private static final int FIRMWARE_FILE_3_ID = R.raw.boot_app0; // This one never changes, it's the Arduino ESP32 bootloader
private static final int FIRMWARE_FILE_4_ID = R.raw.v9_kv4p_ht_esp32_wroom_32_ino;
private static final int FIRMWARE_FILE_4_ID = R.raw.v10_kv4p_ht_esp32_wroom_32_ino;

public FirmwareUtils() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,12 @@ public synchronized void sendBytesToESP32(byte[] newBytes) {
Log.d("DEBUG", "Warning: Attempted to send bytes to ESP32 while in the process of flashing a new firmware.");
return;
}

if (null == usbIoManager) {
Log.d("DEBUG", "Warning: usbIoManager was null when trying to send bytes to ESP32.");
return;
}

usbIoManager.writeAsync(newBytes);
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <driver/dac.h>
#include <esp_task_wdt.h>

const byte FIRMWARE_VER[8] = {'0', '0', '0', '0', '0', '0', '0', '9'}; // Should be 8 characters representing a zero-padded version, like 00000001.
const byte FIRMWARE_VER[8] = {'0', '0', '0', '0', '0', '0', '1', '0'}; // Should be 8 characters representing a zero-padded version, like 00000001.
const byte VERSION_PREFIX[7] = {'V', 'E', 'R', 'S', 'I', 'O', 'N'}; // Must match RadioAudioService.VERSION_PREFIX in Android app.

// Commands defined here must match the Android app
Expand Down
Binary file added website-src/firmware/kv4p-ht-firmware-v10.bin
Binary file not shown.

0 comments on commit 0a2dfd9

Please sign in to comment.