NeonGeckoCom / sj201-interface

Interfaces for the Mycroft SJ201 Board
Other
0 stars 1 forks source link

HardwarePWM-aware led driver #19

Closed NeonDaniel closed 1 year ago

NeonDaniel commented 1 year ago

Description

Adds compatibility for operation with a dtoverlay controlling the PWM fan

Issues

Other Notes

valorekhov commented 1 year ago

Thank you for initiating the PR. Below is some additional information for future reference:

This PR currently is intended for Rev 10 boards and supports co-existence of the NeoPixel LED array connected to Pin 12 with the PWM Fan connected to Pin 13 of the board. The PWM Fan shall be controlled via a the pwm_fan kernel driver using hardware-generated PWM signal. The specific issue being resolved is:

This creates the following problems:

The HwPwmAwareLed class attempts to fix these issues by:

So far, this code has only been tested in the sj201 reset-led CLI scenario. Using it as a part of PHAL with no explicit process exit may require future adjustments.

NeonDaniel commented 1 year ago

Thanks for the detailed explanation. I will plan on implementing your kernel driver when I find time to revisit the Neon images; it looks like the "correct" solution to fan control for the Mark2 since that really should happen at a kernel level.