Closed dnaq closed 2 years ago
I found this after having used your compiler to generate hid descriptors for a project of mine. I'm not that familiar with your codebase, but it seems like this fix is working.
It seems to make sense, indeed. Nice catch.
The global merge optimization pass initialized LogicalMin/LogicaMax to zero, and thus if the actual value was zero it would be removed from the output hid descriptor. Here we instead initialize it to None causing it to be emitted on first use and then no longer emitted.
This is in accordance with the HID specification that specifies that a LogicalMin/LogicalMax value is mandatory in the descriptor.