Skip to content

Commit

Permalink
Do not try to detect size of wx/wy
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 committed Oct 6, 2024
1 parent 157dbf9 commit 47bdf88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
6 changes: 2 additions & 4 deletions VoodooRMI/Functions/F11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,8 @@ int F11::rmi_f11_initialize()
query_offset += rc;

if (sens_query.has_physical_props) {
sensorSize.mmSizeX = sens_query.x_sensor_size_mm;
sensorSize.mmSizeY = sens_query.y_sensor_size_mm;
sensorSize.umPerTraceX = sens_query.x_sensor_size_mm * 10 / sens_query.nr_x_electrodes;
sensorSize.umPerTraceY = sens_query.y_sensor_size_mm * 10 / sens_query.nr_y_electrodes;
sensorSize.sizeX = sens_query.x_sensor_size_mm;
sensorSize.sizeY = sens_query.y_sensor_size_mm;
} else {
IOLogError("No size data from Device.");
return -ENODEV;
Expand Down
6 changes: 2 additions & 4 deletions VoodooRMI/Functions/F12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,8 @@ int F12::rmi_f12_read_sensor_tuning()
if (rmi_register_desc_has_subpacket(item, 4))
offset += 1;

sensorSize.mmSizeX = (pitch_x * rx_receivers) >> 12;
sensorSize.mmSizeY = (pitch_y * tx_receivers) >> 12;
sensorSize.umPerTraceX = (pitch_x >> 12) * 10;
sensorSize.umPerTraceY = (pitch_y >> 12) * 10;
sensorSize.sizeX = (pitch_x * rx_receivers) >> 12;
sensorSize.sizeY = (pitch_y * tx_receivers) >> 12;
setData(sensorSize);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions VoodooRMI/Functions/Input/RMITrackpadFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ void RMITrackpadFunction::handleReport(RMI2DSensorReport *report)
/* fall through */
case RMI_FINGER_VALID:
if (obj.z > RMI_2D_MAX_Z ||
obj.wx * data.umPerTraceX > 500 ||
obj.wy * data.umPerTraceY > 500 ||
obj.wx > 4 ||
obj.wy > 4 ||
obj.type == RMI_2D_OBJECT_INACCURATE) {

fingerState[i] = RMI_FINGER_INVALID;
Expand Down
6 changes: 2 additions & 4 deletions VoodooRMI/Functions/Input/RMITrackpadFunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ enum finger_state {
};

struct Rmi2DSensorData {
UInt16 mmSizeX;
UInt16 mmSizeY;
UInt16 sizeX;
UInt16 sizeY;
UInt16 maxX;
UInt16 maxY;
UInt32 umPerTraceX;
UInt32 umPerTraceY;
};

struct rmi_2d_sensor_abs_object {
Expand Down
4 changes: 2 additions & 2 deletions VoodooRMI/RMIBus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ void RMIBus::publishVoodooInputProperties() {
setProperty(VOODOO_INPUT_LOGICAL_MAX_X_KEY, trackpadData.maxX, 16);
setProperty(VOODOO_INPUT_LOGICAL_MAX_Y_KEY, trackpadData.maxY, 16);
// Need to be in 0.01mm units
setProperty(VOODOO_INPUT_PHYSICAL_MAX_X_KEY, trackpadData.mmSizeX * 100, 16);
setProperty(VOODOO_INPUT_PHYSICAL_MAX_Y_KEY, trackpadData.mmSizeY * 100, 16);
setProperty(VOODOO_INPUT_PHYSICAL_MAX_X_KEY, trackpadData.sizeX * 100, 32);
setProperty(VOODOO_INPUT_PHYSICAL_MAX_Y_KEY, trackpadData.sizeY * 100, 32);
setProperty(VOODOO_INPUT_TRANSFORM_KEY, 0ull, 32);

if (trackpointFunction != nullptr) {
Expand Down

0 comments on commit 47bdf88

Please sign in to comment.