Skip to content

Safe i2c write using global mutex on Windows

Felipe Urzúa requested to merge cheerpipe/OpenRGB:safe_i2c into master

There is a commonly used global mutex on Windows to avoid i2c read/write errors when multiple applications use the bus at the same time.

This pull request adds the following to OpenRGB:

  • A static instance of the global mutex "Global\Access_SMBUS.HTP.Method" to interlock SMBUS read/write operations.
  • A WaitAndLock and Unlock methods to the smbus controller using the static mutex.
  • A example implementation of the mutex using the HyperX RGB controller. Tested and working fine on a Intel z490 motherboard that previously has SPD corruption problems if using OpenRGB with cpu-z, hwinfo64 or any other smbus dependent software.

I am not a c++ developer so any feedback to enhance the code is very appreciated

Merge request reports