+ self._set_enabled(True)
+
+ def deinit(self):
+ """Deinit the sysfs PWM."""
+ if self._channel is not None:
+ self.duty_cycle = 0
+ try:
+ channel_path = os.path.join(
+ self._sysfs_path, self._channel_path.format(self._channel)
+ )
+ with open(
+ os.path.join(channel_path, self._unexport_path), "w"
+ ) as f_unexport:
+ f_unexport.write("%d\n" % self._pwmpin)
+ except IOError as e:
+ raise PWMError(e.errno, "Unexporting PWM pin: " + e.strerror)
+