Fix CMS task rate; correct cmsDeviceCount logic; coding style cleanup
commit9fa0c3bb1e752b513890d333ac6d21b65cfbf06a
authorBruce Luckcuck <github@etracer.net>
Fri, 10 Apr 2020 13:51:38 +0000 (10 09:51 -0400)
committerBruce Luckcuck <github@etracer.net>
Fri, 10 Apr 2020 14:01:51 +0000 (10 10:01 -0400)
treef85879a0e5a08e21b478377fed7814d34e1e15ea
parent04bbaa85902c5b2f3593ffd6fcf5ad13a8145018
Fix CMS task rate; correct cmsDeviceCount logic; coding style cleanup
The CMS task was configured to run at 60hz but there was limiting logic in place to restrict it to every 50ms (20hz). Remove the extra logic and simply run the task at 20hz.

There was incorrect logic that checked if `(cmsDeviceCount < 0)` to not run the task. Firstly `cmsDeviceCount` can never be < 0, and secondly the task should not run when it is 0 as that means there are no registered `displayPort` devices. Generally fix the logic to used `unsigned` for `cmsDeviceCount`. It can only ever be increaded (new device registered) and there is no mechanism to "unregister" a device.

Lots of coding style cleanup.
src/main/cms/cms.c
src/main/fc/tasks.c