mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
refactor(usb): move into distinct dirs, cleanup
This commit is contained in:
9 files changed
+32
-24
No files matched your search
@@ -2,3 +2,6 @@ build/
|
||||
.DS_Store
|
||||
src/gen/
|
||||
payloads/Pongo.bin
|
||||
payloads/checkra1n-kpf-pongo
|
||||
payloads/ramdisk.dmg
|
||||
payloads/binpack.dmg
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
|
||||
#include "../utils.h"
|
||||
#include "../../utils.h"
|
||||
|
||||
static void cf_dictionary_set_int16(CFMutableDictionaryRef dict, const void *key, uint16_t val) {
|
||||
CFNumberRef cf_val = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &val);
|
||||
File renamed without changes.
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
#include "../utils.h"
|
||||
#include "../../utils.h"
|
||||
|
||||
void close_usb_handle(usb_handle_t *handle) {
|
||||
libusb_close(handle->device);
|
||||
File renamed without changes.
+2
-2
@@ -4,9 +4,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include "usb_iokit.h"
|
||||
# include "iokit/usb_iokit.h"
|
||||
#else
|
||||
# include "usb_libusb.h"
|
||||
# include "libusb/usb_libusb.h"
|
||||
#endif
|
||||
|
||||
bool send_usb_control_request_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len, transfer_ret_t *transfer_ret) {
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
#define BACKEND_SHIM_H
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include "usb_iokit.h"
|
||||
# include "iokit/usb_iokit.h"
|
||||
#else
|
||||
# include "usb_libusb.h"
|
||||
# include "libusb/usb_libusb.h"
|
||||
#endif
|
||||
|
||||
bool send_usb_control_request_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len, transfer_ret_t *transfer_ret);
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#include "utils.h"
|
||||
|
||||
#ifdef __WIN32
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
uint64_t palerain_flags = 0;
|
||||
|
||||
void sleep_ms(unsigned ms) {
|
||||
#ifdef __WIN32
|
||||
Sleep(ms);
|
||||
#else
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = ms / 1000;
|
||||
ts.tv_nsec = (ms % 1000) * 1000000L;
|
||||
nanosleep(&ts, NULL);
|
||||
#endif
|
||||
}
|
||||
+2
-18
@@ -6,27 +6,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __WIN32
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
#define LOG(fmt, ...) \
|
||||
printf("(%s:%d) => " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
static void sleep_ms(unsigned ms) {
|
||||
#ifdef __WIN32
|
||||
Sleep(ms);
|
||||
#else
|
||||
struct timespec ts;
|
||||
void sleep_ms(unsigned ms);
|
||||
|
||||
ts.tv_sec = ms / 1000;
|
||||
ts.tv_nsec = (ms % 1000) * 1000000L;
|
||||
nanosleep(&ts, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint64_t palerain_flags = 0;
|
||||
extern uint64_t palerain_flags;
|
||||
|
||||
#endif // CONSTANTS_H
|
||||
Reference in new issue
Block a user