mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
fix some recovery/dfu detection problems
This commit is contained in:
1 parent
6edcf92e7d
commit
bfbdc82d22
3 files changed
+6
-3
No files matched your search
@@ -20,3 +20,4 @@ docs/*.html
|
|||||||
build
|
build
|
||||||
src/*.dmg.c
|
src/*.dmg.c
|
||||||
.idea
|
.idea
|
||||||
|
src/stage2/
|
||||||
+4
-2
@@ -37,6 +37,7 @@
|
|||||||
#include <palerain.h>
|
#include <palerain.h>
|
||||||
|
|
||||||
irecv_device_event_context_t irecvctx = NULL;
|
irecv_device_event_context_t irecvctx = NULL;
|
||||||
|
usbmuxd_subscription_context_t usbmuxdctx = NULL;
|
||||||
|
|
||||||
void devinfo_free(devinfo_t *dev) {
|
void devinfo_free(devinfo_t *dev) {
|
||||||
free(dev->buildVersion);
|
free(dev->buildVersion);
|
||||||
@@ -87,16 +88,17 @@ bool cpid_is_arm64(unsigned int cpid) {
|
|||||||
|
|
||||||
int subscribe_cmd(usbmuxd_event_cb_t device_event_cb, irecv_device_event_cb_t irecv_event_cb)
|
int subscribe_cmd(usbmuxd_event_cb_t device_event_cb, irecv_device_event_cb_t irecv_event_cb)
|
||||||
{
|
{
|
||||||
usbmuxd_subscribe(device_event_cb, NULL);
|
usbmuxd_events_subscribe(&usbmuxdctx, device_event_cb, NULL);
|
||||||
irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL);
|
irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unsubscribe_cmd()
|
int unsubscribe_cmd()
|
||||||
{
|
{
|
||||||
usbmuxd_unsubscribe();
|
usbmuxd_events_unsubscribe(usbmuxdctx);
|
||||||
irecv_device_event_unsubscribe(irecvctx);
|
irecv_device_event_unsubscribe(irecvctx);
|
||||||
irecvctx = NULL;
|
irecvctx = NULL;
|
||||||
|
usbmuxdctx = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -217,8 +217,8 @@ void irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) {
|
|||||||
|
|
||||||
void *dfuhelper(void* ptr) {
|
void *dfuhelper(void* ptr) {
|
||||||
dfuhelper_thr_running = true;
|
dfuhelper_thr_running = true;
|
||||||
subscribe_cmd(device_event_cb, irecv_device_event_cb);
|
|
||||||
set_spin(1);
|
set_spin(1);
|
||||||
|
subscribe_cmd(device_event_cb, irecv_device_event_cb);
|
||||||
while (get_spin()) {
|
while (get_spin()) {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user