extmod/machine_pwm: Remove header file and move decls to .c file.

With public declarations moved to extmod/modmachine.h.  It's now mandatory
for a port to define MICROPY_PY_MACHINE_PWM_INCLUDEFILE if it enables
MICROPY_PY_MACHINE_PWM.  This follows how extmod/machine_wdt.c works.

All ports have been updated to work with this modified scheme.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-10-20 16:00:36 +11:00
parent 60929ec7e2
commit 7e7af71527
19 changed files with 57 additions and 131 deletions

View File

@@ -25,15 +25,12 @@
* THE SOFTWARE.
*/
#include "py/runtime.h"
#if MICROPY_PY_MACHINE_PWM
// This file is never compiled standalone, it's included directly from
// extmod/machine_pwm.c via MICROPY_PY_MACHINE_PWM_INCLUDEFILE.
#include <string.h>
#include "py/mphal.h"
#include "modmachine.h"
#include "clock_config.h"
#include "sam.h"
#include "pin_af.h"
@@ -396,5 +393,3 @@ 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

View File

@@ -39,9 +39,6 @@ extern const mp_obj_type_t machine_dac_type;
extern const mp_obj_type_t machine_i2c_type;
#endif
extern const mp_obj_type_t machine_pin_type;
#if MICROPY_PY_MACHINE_PWM
extern const mp_obj_type_t machine_pwm_type;
#endif
#if MICROPY_PY_MACHINE_SPI
extern const mp_obj_type_t machine_spi_type;
#endif