mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
remove unused etvr_eye_tracker_usb
This commit is contained in:
parent
53a3d4bcd6
commit
47b52417d0
@ -3,20 +3,18 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <data/CommandManager/CommandManager.hpp>
|
||||
#include <data/config/project_config.hpp>
|
||||
#include <io/LEDManager/LEDManager.hpp>
|
||||
#include <io/Serial/SerialManager.hpp>
|
||||
#include <io/camera/cameraHandler.hpp>
|
||||
#include <logo/logo.hpp>
|
||||
#include <io/Serial/SerialManager.hpp>
|
||||
#include <data/CommandManager/CommandManager.hpp>
|
||||
|
||||
#ifndef ETVR_EYE_TRACKER_USB_API
|
||||
#include <network/api/webserverHandler.hpp>
|
||||
#include <network/mDNS/MDNSManager.hpp>
|
||||
#include <network/stream/streamServer.hpp>
|
||||
#include <network/wifihandler/wifihandler.hpp>
|
||||
#else
|
||||
#include <usb/etvr_eye_tracker_usb.hpp>
|
||||
#endif // ETVR_EYE_TRACKER_WEB_API
|
||||
|
||||
#endif // OPENIRIS_HPP
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
#include "etvr_eye_tracker_usb.hpp"
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <USBCDC.h>
|
||||
#include <esp_camera.h>
|
||||
|
||||
const char* const ETVR_HEADER = "\xff\xa0";
|
||||
const char* const ETVR_HEADER_FRAME = "\xff\xa1";
|
||||
|
||||
void etvr_eye_tracker_usb_init() {
|
||||
Serial.begin(3000000);
|
||||
Serial.flush();
|
||||
}
|
||||
|
||||
void etvr_eye_tracker_usb_loop() {
|
||||
int64_t last_frame = 0;
|
||||
if (!last_frame)
|
||||
last_frame = esp_timer_get_time();
|
||||
|
||||
long last_request_time = 0;
|
||||
camera_fb_t* fb = NULL;
|
||||
esp_err_t err = ESP_OK;
|
||||
|
||||
size_t len = 0;
|
||||
uint8_t* buf = NULL;
|
||||
|
||||
uint8_t len_bytes[2];
|
||||
|
||||
while (true) {
|
||||
fb = esp_camera_fb_get();
|
||||
if (fb) {
|
||||
len = fb->len;
|
||||
buf = fb->buf;
|
||||
} else {
|
||||
log_e("Camera capture failed with response: %s", esp_err_to_name(err));
|
||||
err = ESP_FAIL;
|
||||
}
|
||||
if (err == ESP_OK)
|
||||
Serial.write(ETVR_HEADER, 2);
|
||||
Serial.write(ETVR_HEADER_FRAME, 2);
|
||||
len_bytes[0] = len & 0xFF;
|
||||
len_bytes[1] = (len >> CHAR_BIT) & 0xFF;
|
||||
Serial.write(len_bytes, 2);
|
||||
Serial.write((const char*)buf, len);
|
||||
if (fb) {
|
||||
esp_camera_fb_return(fb);
|
||||
fb = NULL;
|
||||
buf = NULL;
|
||||
} else if (buf) {
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
if (err != ESP_OK)
|
||||
break;
|
||||
long request_end = millis();
|
||||
long latency = request_end - last_request_time;
|
||||
last_request_time = request_end;
|
||||
log_d("Size: %uKB, Time: %ums (%ifps)\n", len / 1024, latency,
|
||||
1000 / latency);
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
#ifndef INCLUDED_ETVR_EYE_TRACKER_USB_HPP
|
||||
#define INCLUDED_ETVR_EYE_TRACKER_USB_HPP
|
||||
|
||||
void etvr_eye_tracker_usb_init();
|
||||
void etvr_eye_tracker_usb_loop();
|
||||
|
||||
#endif // INCLUDED_ETVR_EYE_TRACKER_USB_HPP
|
||||
Loading…
Reference in New Issue
Block a user