Modularise fluxsink and usb.

This commit is contained in:
David Given
2024-10-16 00:41:57 +02:00
parent ec271a67ad
commit c42e73f17a
12 changed files with 45 additions and 31 deletions

View File

11
lib/external/build.py vendored
View File

@@ -7,22 +7,25 @@ protocc(name="fl2_proto_lib", srcs=[".+fl2_proto"])
cxxlibrary(
name="external",
srcs=[
"./ldbs.cc",
"./fl2.cc",
"./kryoflux.cc",
"./catweasel.cc",
"./csvreader.cc",
"./fl2.cc",
"./flx.cc",
"./greaseweazle.cc",
"./kryoflux.cc",
"./ldbs.cc",
],
hdrs={
"lib/external/a2r.h": "./a2r.h",
"lib/external/applesauce.h": "./applesauce.h",
"lib/external/catweasel.h": "./catweasel.h",
"lib/external/csvreader.h": "./csvreader.h",
"lib/external/fl2.h": "./fl2.h",
"lib/external/flx.h": "./flx.h",
"lib/external/greaseweazle.h": "./greaseweazle.h",
"lib/external/kryoflux.h": "./kryoflux.h",
"lib/external/ldbs.h": "./ldbs.h",
"lib/external/scp.h": "./scp.h",
"lib/external/flx.h": "./flx.h",
},
deps=["lib/core", ".+fl2_proto_lib", "lib/data"],
)

View File

View File

View File

@@ -1,5 +1,20 @@
from build.protobuf import proto, protocc
from build.c import cxxlibrary
proto(name="proto", srcs=["./fluxsink.proto"], deps=["lib+common_proto"])
protocc(name="proto_lib", srcs=[".+proto"], deps=["lib+common_proto_lib"])
cxxlibrary(
name="fluxsink",
srcs=[
"./a2rfluxsink.cc",
"./aufluxsink.cc",
"./fl2fluxsink.cc",
"./fluxsink.cc",
"./hardwarefluxsink.cc",
"./scpfluxsink.cc",
"./vcdfluxsink.cc",
],
hdrs={"lib/fluxsink/fluxsink.h": "./fluxsink.h"},
deps=["lib/core", "lib/config", "lib/data", "lib/external","lib/usb"],
)

View File

@@ -7,7 +7,6 @@
#include "lib/usb/usb.h"
#include "lib/fluxsink/fluxsink.h"
#include "lib/fluxsink/fluxsink.pb.h"
#include "lib/readerwriter.h"
class HardwareFluxSink : public FluxSink
{

View File

@@ -1,4 +1,19 @@
from build.protobuf import proto, protocc
from build.c import cxxlibrary
proto(name="proto", srcs=["./usb.proto"], deps=["lib+common_proto"])
protocc(name="proto_lib", srcs=[".+proto"], deps=["lib+common_proto_lib"])
cxxlibrary(
name="usb",
srcs=[
"./applesauceusb.cc",
"./fluxengineusb.cc",
"./greaseweazleusb.cc",
"./serial.cc",
"./usb.cc",
"./usbfinder.cc",
],
hdrs={"lib/usb/usb.h": "./usb.h", "lib/usb/usbfinder.h": "./usbfinder.h"},
deps=["lib/core", "lib/config", "lib/external", "dep/libusbp", "+protocol"],
)

View File

@@ -3,7 +3,7 @@
#include "lib/data/fluxmap.h"
#include "lib/core/bytes.h"
#include "lib/usb/usb.pb.h"
#include "greaseweazle.h"
#include "lib/external/greaseweazle.h"
#include "serial.h"
#include "usb.h"
#include <unistd.h>

View File

@@ -10,8 +10,8 @@
#include "lib/config/proto.h"
#include "usbfinder.h"
#include "lib/core/logger.h"
#include "applesauce.h"
#include "greaseweazle.h"
#include "lib/external/applesauce.h"
#include "lib/external/greaseweazle.h"
static USB* usb = NULL;

View File

@@ -3,8 +3,8 @@
#include "usb.h"
#include "lib/core/bytes.h"
#include "usbfinder.h"
#include "applesauce.h"
#include "greaseweazle.h"
#include "lib/external/applesauce.h"
#include "lib/external/greaseweazle.h"
#include "protocol.h"
#include "libusbp.hpp"