Remove part number check from CP2102 driver

This should get CP2104 and potentially other similar devices working.

Closes #305.
This commit is contained in:
Dale Whinham committed 2022-12-01 14:26:38 +00:00
1 parent 02918adac1
commit 772fb15d1b
3 files changed
+26

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Ability to reverse global left and right audio channels (new configuration file option) to work around broken hardware (issue #307).
- Support for CP2104 (and possibly other members of CP210x family) USB serial devices (issue #305). Thanks to @gritd and @ajhuitsing for reporting/finding a solution!
* This is currently achieved by applying a temporary patch to Circle to remove a part number check in the CP2102 driver.
### Changed
+2
View File
@@ -36,6 +36,7 @@ $(CIRCLE_STDLIB_CONFIG) $(CIRCLE_CONFIG)&:
# Apply patches
@${APPLY_PATCH} $(CIRCLEHOME) patches/circle-44.4-minimal-usb-drivers.patch
@${APPLY_PATCH} $(CIRCLEHOME) patches/circle-44.5-usb-midi-interrupt-ep.patch
@${APPLY_PATCH} $(CIRCLEHOME) patches/circle-44.5-cp210x-remove-partnum-check.patch
ifeq ($(strip $(GC_SECTIONS)),1)
# Enable function/data sections for circle-stdlib
@@ -140,6 +141,7 @@ clean:
#
veryclean: clean
# Reverse patches
@${REVERSE_PATCH} $(CIRCLEHOME) patches/circle-44.5-cp210x-remove-partnum-check.patch
@${REVERSE_PATCH} $(CIRCLEHOME) patches/circle-44.5-usb-midi-interrupt-ep.patch
@${REVERSE_PATCH} $(CIRCLEHOME) patches/circle-44.4-minimal-usb-drivers.patch
@${REVERSE_PATCH} $(FLUIDSYNTHHOME) patches/fluidsynth-2.3.0-circle.patch
@@ -0,0 +1,22 @@
diff --git a/lib/usb/usbserialcp2102.cpp b/lib/usb/usbserialcp2102.cpp
index 41b6177..513502f 100644
--- a/lib/usb/usbserialcp2102.cpp
+++ b/lib/usb/usbserialcp2102.cpp
@@ -90,12 +90,12 @@ boolean CUSBSerialCP2102Device::Configure (void)
return FALSE;
}
- if (rxData[0] != CP210X_PARTNUM_CP2102)
- {
- CLogger::Get ()->Write (FromCp2102, LogError, "Unsupported part number");
+ // if (rxData[0] != CP210X_PARTNUM_CP2102)
+ // {
+ // CLogger::Get ()->Write (FromCp2102, LogError, "Unsupported part number");
- return FALSE;
- }
+ // return FALSE;
+ // }
CLogger::Get ()->Write (FromCp2102, LogNotice, "Part number: CP210%d", rxData[0]);
if (pHost->ControlMessage (GetEndpoint0 (),