extmod/modmachine: Clean up decls of machine types to use common ones.

The machine_i2c_type, machine_spi_type and machine_timer_type symbols are
already declared in extmod/modmachine.h and should not be declared anywhere
else.

Also move declarations of machine_pin_type and machine_rtc_type to the
common header in extmod.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-10-26 11:39:40 +11:00
parent 5b4a2baff6
commit 90023b4dcf
59 changed files with 44 additions and 87 deletions

View File

@@ -35,6 +35,7 @@
#if MICROPY_PY_MACHINE_I2C
#include "extmod/machine_i2c.h"
#include "extmod/modmachine.h"
#include "i2c.h"
#if NRFX_TWI_ENABLED
#include "nrfx_twi.h"

View File

@@ -29,8 +29,6 @@
#include "extmod/machine_i2c.h"
extern const mp_obj_type_t machine_i2c_type;
void i2c_init0(void);
#endif // I2C_H__

View File

@@ -28,8 +28,6 @@
#ifndef __MICROPY_INCLUDED_NRF5_MODMACHINE_H__
#define __MICROPY_INCLUDED_NRF5_MODMACHINE_H__
#include "py/mpstate.h"
#include "py/nlr.h"
#include "py/obj.h"
void machine_init(void);

View File

@@ -36,6 +36,7 @@
#include "py/nlr.h"
#include "py/mphal.h"
#include "extmod/machine_spi.h"
#include "extmod/modmachine.h"
#include "pin.h"
#include "genhdr/pins.h"
#include "spi.h"

View File

@@ -27,7 +27,6 @@
#include "py/obj.h"
typedef struct _machine_hard_spi_obj_t machine_hard_spi_obj_t;
extern const mp_obj_type_t machine_spi_type;
void spi_init0(void);
void spi_transfer(const machine_hard_spi_obj_t * self,

View File

@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
#include "py/nlr.h"
#include "py/runtime.h"
#include "extmod/modmachine.h"
#include "timer.h"
#include "nrfx_timer.h"

View File

@@ -27,8 +27,6 @@
#ifndef TIMER_H__
#define TIMER_H__
extern const mp_obj_type_t machine_timer_type;
void timer_init0(void);
#endif // TIMER_H__