mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-11 04:48:15 +02:00
Move some functions to emulation header.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
extern uint32_t board_millis();
|
#include "emulation.h"
|
||||||
#elif (ESP_PLATFORM)
|
#elif (ESP_PLATFORM)
|
||||||
#include "bootloader_random.h"
|
#include "bootloader_random.h"
|
||||||
#include "esp_random.h"
|
#include "esp_random.h"
|
||||||
|
|||||||
@@ -22,8 +22,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#else
|
||||||
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define USB_BUFFER_SIZE 2048
|
#define USB_BUFFER_SIZE 2048
|
||||||
extern int emul_init(char *host, uint16_t port);
|
extern int emul_init(char *host, uint16_t port);
|
||||||
extern uint8_t emul_rx[USB_BUFFER_SIZE];
|
extern uint8_t emul_rx[USB_BUFFER_SIZE];
|
||||||
@@ -31,6 +34,12 @@ extern uint16_t emul_rx_size, emul_tx_size;
|
|||||||
extern uint16_t driver_write_emul(uint8_t itf, const uint8_t *buffer, uint16_t buffer_size);
|
extern uint16_t driver_write_emul(uint8_t itf, const uint8_t *buffer, uint16_t buffer_size);
|
||||||
extern uint16_t emul_read(uint8_t itf);
|
extern uint16_t emul_read(uint8_t itf);
|
||||||
|
|
||||||
|
static inline uint32_t board_millis() {
|
||||||
|
struct timeval start;
|
||||||
|
gettimeofday(&start, NULL);
|
||||||
|
return start.tv_sec * 1000 + start.tv_usec / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USB_ITF_HID
|
#ifdef USB_ITF_HID
|
||||||
typedef uint8_t hid_report_type_t;
|
typedef uint8_t hid_report_type_t;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user