samd/modmachine: Make some machine classes configurable by #defines.
These include ADC, DAC, I2C, SoftI2C, SPI, SoftI2C, PWM, UART, pulse. This is useful for devices like the Adafruit Trinket series which have almost no accessible GPIO pins. Signed-off-by: robert-hh <robert@hammelrath.com>
This commit is contained in:
@@ -25,8 +25,11 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "py/runtime.h"
|
||||
|
||||
#if MICROPY_PY_MACHINE_PWM
|
||||
|
||||
#include <string.h>
|
||||
#include "py/mphal.h"
|
||||
#include "modmachine.h"
|
||||
#include "clock_config.h"
|
||||
@@ -393,3 +396,5 @@ STATIC void mp_machine_pwm_duty_set_ns(machine_pwm_obj_t *self, mp_int_t duty_ns
|
||||
duty_type_flags[self->device] &= ~(1 << self->channel);
|
||||
mp_machine_pwm_start(self);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user