Remove USB/serial support: network-only protocol, drop tinyusb and PICOBOOT

This commit is contained in:
Ian Gulliver
2026-04-17 11:20:57 -07:00
parent 23587c41e2
commit cdc113285a
16 changed files with 4 additions and 343 deletions

View File

@@ -8,7 +8,6 @@ extern std::string_view firmware_name;
void handlers_init();
void handlers_start();
std::optional<ResponsePICOBOOT> handle_picoboot(const responder& resp, const RequestPICOBOOT&);
std::optional<ResponseInfo> handle_info(const responder& resp, const RequestInfo&);
std::optional<ResponseLog> handle_log(const responder& resp, const RequestLog&);
std::optional<ResponseFlashErase> handle_flash_erase(const responder& resp, const RequestFlashErase&);

View File

@@ -1,7 +0,0 @@
#pragma once
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
#define CFG_TUD_CDC 1
#define CFG_TUD_CDC_RX_BUFSIZE 256
#define CFG_TUD_CDC_TX_BUFSIZE 256
#define CFG_TUD_CDC_EP_BUFSIZE 64

View File

@@ -1,32 +0,0 @@
#pragma once
#include <cstdint>
#include <span>
#include <vector>
#include "tusb.h"
#include "ring_buffer.h"
struct usb_cdc {
ring_buffer<uint8_t, 8192> tx;
bool send(std::span<const uint8_t> data) {
if (!tx.push(data)) return false;
drain();
return true;
}
void send(const std::vector<uint8_t>& data) {
send(std::span<const uint8_t>{data});
}
void drain() {
while (!tx.empty()) {
uint32_t avail = tud_cdc_write_available();
if (avail == 0) break;
auto chunk = tx.read_contiguous();
if (chunk.size() > avail) chunk = chunk.first(avail);
tud_cdc_write(chunk.data(), chunk.size());
tx.consume(chunk.size());
}
tud_cdc_write_flush();
}
};

View File

@@ -27,18 +27,6 @@ struct DeviceError {
auto as_tuple() { return std::tie(code, message); }
};
struct RequestPICOBOOT {
static constexpr int8_t ext_id = 2;
auto as_tuple() const { return std::tie(); }
auto as_tuple() { return std::tie(); }
};
struct ResponsePICOBOOT {
static constexpr int8_t ext_id = 3;
auto as_tuple() const { return std::tie(); }
auto as_tuple() { return std::tie(); }
};
struct RequestInfo {
static constexpr int8_t ext_id = 4;
auto as_tuple() const { return std::tie(); }