diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6dbe699..e5f0a48 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -48,6 +48,8 @@ android { // only the app's libraries (the modem's, the local shell's ptys): not dmodemd or D-Modem-RE's other programs targets += listOf("dmodem_jni", "dmodem_pty") arguments += listOf("-DANDROID_STL=c++_static") + // (a special build's name for the native code too: "led-probe" probes the Agere's LEDs) + providers.gradleProperty("dmodem.special").orNull?.let { arguments += "-DDMODEM_SPECIAL=$it" } } } } diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 318b123..d95ab80 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -54,9 +54,14 @@ if(ANDROID) set_source_files_properties(${DMODEM_RE_DIR}/dmodemd/usb_line.cpp PROPERTIES COMPILE_DEFINITIONS "libusb_init=dmodem_libusb_init;libusb_get_device_list=dmodem_libusb_get_device_list;libusb_open=dmodem_libusb_open;libusb_submit_transfer=dmodem_libusb_submit_transfer") + # (a special build, -Pdmodem.special=led-probe: the Agere's GPIOs + # flipped one by one at start, docs/agere-usb.md in D-Modem-RE) + set(agere_defs "libusb_submit_transfer=dmodem_libusb_submit_transfer") + if(DMODEM_SPECIAL STREQUAL "led-probe") + list(APPEND agere_defs DMODEM_AGERE_LED_PROBE) + endif() set_source_files_properties(${DMODEM_RE_DIR}/dmodemd/usb_agere.cpp - PROPERTIES COMPILE_DEFINITIONS - "libusb_submit_transfer=dmodem_libusb_submit_transfer") + PROPERTIES COMPILE_DEFINITIONS "${agere_defs}") target_compile_definitions(dmodem_engine PUBLIC DMODEM_ENGINE_USB) target_link_libraries(dmodem_engine PUBLIC dmodem_android_libusb) diff --git a/external/d-modem-re b/external/d-modem-re index 27ae904..a588f5d 160000 --- a/external/d-modem-re +++ b/external/d-modem-re @@ -1 +1 @@ -Subproject commit 27ae904cbbf89096d8f827fd0da3859673fb19a0 +Subproject commit a588f5d3cf713869bcce81817290717ddb8c652f