Move some functions to emulation header.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-09-03 18:07:50 +02:00
parent ea6303de81
commit 4711ae768a
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3
2 changed files with 10 additions and 1 deletions

View file

@ -22,7 +22,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
extern uint32_t board_millis();
#include "emulation.h"
#elif (ESP_PLATFORM)
#include "bootloader_random.h"
#include "esp_random.h"

View file

@ -22,8 +22,11 @@
#include <string.h>
#ifdef _MSC_VER
#include <windows.h>
#else
#include <sys/time.h>
#endif
#include <stdbool.h>
#define USB_BUFFER_SIZE 2048
extern int emul_init(char *host, uint16_t port);
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 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
typedef uint8_t hid_report_type_t;
#endif