Driver: DXX: Fix ION, FIRE, ValueCAN3, & VividCAN

This commit is contained in:
Kyle Schwarz
2025-09-10 10:11:08 -04:00
parent fbdab1e998
commit 8b7e2556a0
12 changed files with 42 additions and 36 deletions
+4 -13
View File
@@ -35,15 +35,6 @@ static void makeIfSerialMatches(const FoundDevice& dev, std::vector<std::shared_
into.push_back(std::make_shared<T>(dev));
}
template<typename T>
static void makeIfPIDMatches(const FoundDevice& dev, std::vector<std::shared_ptr<Device>>& into) {
// Relies on the subclass to have a `static constexpr uint16_t PRODUCT_ID = 0x1111`
// and also a public constructor `T(const FoundDevice& dev)`
// Use macro ICSNEO_FINDABLE_DEVICE_BY_PID() to create these
if(dev.productId == T::PRODUCT_ID)
into.push_back(std::make_shared<T>(dev));
}
template<typename T>
static void makeIfSerialRangeMatches(const FoundDevice& dev, std::vector<std::shared_ptr<Device>>& into) {
// Relies on the subclass to have
@@ -139,7 +130,7 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
#endif
#ifdef __NEOVIFIRE_H_
makeIfPIDMatches<NeoVIFIRE>(dev, newFoundDevices);
makeIfSerialRangeMatches<NeoVIFIRE>(dev, newFoundDevices);
#endif
#ifdef __NEOVIFIRE2_H_
@@ -159,11 +150,11 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
#endif
#ifdef __NEOVIION_H_
makeIfPIDMatches<NeoVIION>(dev, newFoundDevices);
makeIfSerialMatches<NeoVIION>(dev, newFoundDevices);
#endif
#ifdef __NEOVIPLASMA_H_
makeIfPIDMatches<NeoVIPLASMA>(dev, newFoundDevices);
makeIfSerialMatches<NeoVIPLASMA>(dev, newFoundDevices);
#endif
#ifdef __RADA2B_H_
@@ -247,7 +238,7 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
#endif
#ifdef __VALUECAN3_H_
makeIfPIDMatches<ValueCAN3>(dev, newFoundDevices);
makeIfSerialRangeMatches<ValueCAN3>(dev, newFoundDevices);
#endif
#ifdef __VALUECAN4_1_H_