reworked usb serial communication (#1766)

This commit is contained in:
Bernd Herzog 2024-01-13 18:05:29 +01:00 committed by GitHub
parent 58307aee9c
commit 7a4c3184a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 188 additions and 53 deletions

View file

@ -1,11 +1,12 @@
extern "C" {
#include "usb_serial_io.h"
#include "usb_serial_device_to_host.h"
#include "usb_serial_cdc.h"
}
#include "usb_serial_shell.hpp"
#include "usb_serial.hpp"
#include "portapack.hpp"
#include "usb_serial_host_to_device.hpp"
#include <libopencm3/cm3/common.h>
#include <libopencm3/lpc43xx/usb.h>
@ -24,6 +25,7 @@ void USBSerial::initialize() {
init_serial_usb_driver(&SUSBD1);
shellInit();
init_host_to_device();
}
void USBSerial::dispatch() {
@ -35,7 +37,11 @@ void USBSerial::dispatch() {
create_shell(_eventDispatcher);
}
bulk_out_receive();
schedule_host_to_device_transfer();
}
void USBSerial::dispatch_transfer() {
complete_host_to_device_transfer();
}
void USBSerial::on_channel_opened() {