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,13 @@
* THE SOFTWARE.
*/
#include "py/runtime.h"
// This file is never compiled standalone, it's included directly from
// extmod/machine_pwm.c via MICROPY_PY_MACHINE_PWM_INCLUDEFILE.
#include "py/mphal.h"
#include "py/mperrno.h"
#include "extmod/machine_pwm.h"
#include "pin.h"
#include "ra/ra_gpt.h"
#include "modmachine.h"
#if MICROPY_HW_ENABLE_HW_PWM
typedef struct _machine_pwm_obj_t {
mp_obj_base_t base;
@@ -353,5 +351,3 @@ STATIC void mp_machine_pwm_duty_set_ns(machine_pwm_obj_t *self, mp_int_t duty_ns
}
}
}
#endif // MICROPY_HW_ENABLE_HW_PWM

View File

@@ -40,7 +40,7 @@
#include "extmod/machine_pulse.h"
#include "extmod/machine_i2c.h"
#include "extmod/machine_spi.h"
#include "extmod/machine_pwm.h"
#include "extmod/modmachine.h"
#include "shared/runtime/pyexec.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"