Find channel by pin number
| 139 | |
| 140 | // Find channel by pin number |
| 141 | PwmPinState* findByPin(int pin) { |
| 142 | PwmStateData& st = state(); |
| 143 | for (u8 i = 0; i < MAX_PWM_CHANNELS; i++) { |
| 144 | if (st.channels[i].pin == pin) { |
| 145 | return &st.channels[i]; |
| 146 | } |
| 147 | } |
| 148 | return nullptr; |
| 149 | } |
| 150 | |
| 151 | // Allocate a free channel |
| 152 | PwmPinState* allocate() { |
no outgoing calls
no test coverage detected