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

@@ -4,6 +4,7 @@
#include "py/obj.h"
#include "py/mphal.h"
#include "extmod/modmachine.h"
#include "pin.h"
#define PIN_AD(p_name, p_pin, ad_bit, ad_channel) \

View File

@@ -32,7 +32,7 @@
#include "py/mphal.h"
#include "py/mperrno.h"
#include "extmod/machine_i2c.h"
#include "modmachine.h"
#include "extmod/modmachine.h"
#include "ra_i2c.h"

View File

@@ -31,9 +31,10 @@
#include "py/runtime.h"
#include "py/mphal.h"
#include "extmod/modmachine.h"
#include "extmod/virtpin.h"
#include "shared/runtime/mpirq.h"
#include "modmachine.h"
#include "extmod/virtpin.h"
#include "pin.h"
#include "extint.h"

View File

@@ -28,6 +28,7 @@
#include <stdio.h>
#include "py/runtime.h"
#include "extmod/modmachine.h"
#include "shared/timeutils/timeutils.h"
#include "extint.h"
#include "rtc.h"

View File

@@ -32,10 +32,10 @@
#include "py/mphal.h"
#include "py/mperrno.h"
#include "extmod/machine_spi.h"
#include "extmod/modmachine.h"
#include "pin.h"
#include "spi.h"
#include "ra/ra_spi.h"
#include "modmachine.h"
typedef struct _machine_hard_spi_obj_t {
mp_obj_base_t base;

View File

@@ -41,6 +41,7 @@
#include "lib/littlefs/lfs1_util.h"
#include "lib/littlefs/lfs2.h"
#include "lib/littlefs/lfs2_util.h"
#include "extmod/modmachine.h"
#include "extmod/vfs.h"
#include "extmod/vfs_fat.h"
#include "extmod/vfs_lfs.h"

View File

@@ -29,15 +29,9 @@
#include "py/obj.h"
extern const mp_obj_type_t machine_timer_type;
extern const mp_obj_type_t machine_pin_type;
extern const mp_obj_type_t machine_touchpad_type;
extern const mp_obj_type_t machine_adcblock_type;
extern const mp_obj_type_t machine_dac_type;
extern const mp_obj_type_t machine_i2c_type;
extern const mp_obj_type_t machine_spi_type;
extern const mp_obj_type_t machine_i2s_type;
extern const mp_obj_type_t machine_rtc_type;
extern const mp_obj_type_t machine_sdcard_type;

View File

@@ -26,6 +26,7 @@
*/
#include "py/runtime.h"
#include "extmod/modmachine.h"
#include "uart.h"
#include "rng.h"

View File

@@ -29,9 +29,9 @@
#include "py/stream.h"
#include "py/mphal.h"
#include "extmod/modbluetooth.h"
#include "extmod/modmachine.h"
#include "extmod/mpbthci.h"
#include "shared/runtime/softtimer.h"
#include "modmachine.h"
#include "mpbthciport.h"
#include "uart.h"

View File

@@ -58,7 +58,6 @@ typedef struct {
const pin_ad_obj_t *ad;
} machine_pin_obj_t;
extern const mp_obj_type_t machine_pin_type;
extern const mp_obj_type_t pin_af_type;
// Include all of the individual pin objects

View File

@@ -28,7 +28,6 @@
#define MICROPY_INCLUDED_RA_RTC_H
#include "py/obj.h"
extern const mp_obj_type_t machine_rtc_type;
typedef struct
{

View File

@@ -89,7 +89,6 @@ typedef struct _machine_uart_obj_t {
mp_irq_obj_t *mp_irq_obj; // user IRQ object
} machine_uart_obj_t;
extern const mp_obj_type_t machine_uart_type;
extern const mp_irq_methods_t uart_irq_methods;
void uart_init0(void);