Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "py/stream.h"

#include "shared-bindings/_bleio/__init__.h"
#include "shared-bindings/_bleio/CharacteristicBuffer.h"
#include "shared-bindings/_bleio/Connection.h"
#include "supervisor/shared/tick.h"
#include "common-hal/_bleio/CharacteristicBuffer.h"
Expand Down
1 change: 1 addition & 0 deletions devices/ble_hci/common-hal/_bleio/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ typedef struct {
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);
mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection);
bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle);
void bleio_connection_clear(bleio_connection_internal_t *self);

#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H
2 changes: 1 addition & 1 deletion devices/ble_hci/common-hal/_bleio/att.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ STATIC void process_find_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
}
}

void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) {
static void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) {
struct bt_att_read_group_req *req = (struct bt_att_read_group_req *)data;
uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8);

Expand Down
1 change: 1 addition & 0 deletions lib/utils/interrupt_char.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "py/obj.h"
#include "py/mpstate.h"
#include "lib/utils/interrupt_char.h"

#if MICROPY_KBD_EXCEPTION

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/sys_stdio_mphal.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct _sys_stdio_obj_t {
STATIC const sys_stdio_obj_t stdio_buffer_obj;
#endif

void stdio_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
static void stdio_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
sys_stdio_obj_t *self = MP_OBJ_TO_PTR(self_in);
mp_printf(print, "<io.FileIO %d>", self->fd);
}
Expand Down
1 change: 1 addition & 0 deletions ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include "common-hal/analogio/AnalogIn.h"
#include "shared-bindings/analogio/AnalogIn.h"
#include "shared-bindings/microcontroller/Pin.h"

#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions ports/mimxrt10xx/common-hal/busio/I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/busio/I2C.h"
#include "common-hal/busio/I2C.h"
#include "py/mperrno.h"
#include "py/runtime.h"
#include "periph.h"
Expand Down
2 changes: 2 additions & 0 deletions ports/mimxrt10xx/common-hal/busio/I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ typedef struct {
const mcu_periph_obj_t *sda;
} busio_i2c_obj_t;

void i2c_reset(void);

#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_I2C_H
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/common-hal/busio/UART.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void config_periph_pin(const mcu_periph_obj_t *periph) {
| IOMUXC_SW_PAD_CTL_PAD_SRE(0));
}

void LPUART_UserCallback(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *user_data) {
static void LPUART_UserCallback(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *user_data) {
busio_uart_obj_t *self = (busio_uart_obj_t *)user_data;

if (status == kStatus_LPUART_RxIdle) {
Expand Down
2 changes: 2 additions & 0 deletions ports/mimxrt10xx/common-hal/busio/UART.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ typedef struct {
const mcu_periph_obj_t *rts;
} busio_uart_obj_t;

void uart_reset(void);

#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_UART_H
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U

void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) {
static void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) {
IOMUXC_SetPinConfig(0, 0, 0, 0, pin->cfg_reg,
IOMUXC_SW_PAD_CTL_PAD_HYS(1)
| IOMUXC_SW_PAD_CTL_PAD_PUS((pull == PULL_UP) ? 2 : 0)
Expand Down
1 change: 1 addition & 0 deletions ports/mimxrt10xx/common-hal/microcontroller/Processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <math.h>

#include "common-hal/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h"

#include "fsl_tempmon.h"
Expand Down
4 changes: 3 additions & 1 deletion ports/mimxrt10xx/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include "py/objtuple.h"
#include "py/qstr.h"

#include "shared-bindings/os/__init__.h"

#include "fsl_trng.h"

STATIC const qstr os_uname_info_fields[] = {
Expand Down Expand Up @@ -58,7 +60,7 @@ mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
trng_config_t trngConfig;

TRNG_GetDefaultConfig(&trngConfig);
Expand Down
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/common-hal/pulseio/PulseOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ typedef struct {
} pulseio_pulseout_obj_t;

void pulseout_reset(void);
// void pulseout_interrupt_handler(uint8_t index);
void pulseout_interrupt_handler(uint8_t index);

#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEOUT_H
2 changes: 2 additions & 0 deletions ports/mimxrt10xx/common-hal/rtc/RTC.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include "py/runtime.h"
#include "lib/timeutils/timeutils.h"
#include "shared-bindings/rtc/__init__.h"
#include "shared-bindings/rtc/RTC.h"
#include "common-hal/rtc/RTC.h"
#include "supervisor/shared/translate.h"

#include "fsl_snvs_hp.h"
Expand Down
1 change: 1 addition & 0 deletions ports/mimxrt10xx/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* THE SOFTWARE.
*/

#include "py/mphal.h"
#include "py/mpstate.h"
#include "py/smallint.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include "fsl_clock.h"
#include "fsl_iomuxc.h"
#include "clocks.h"

#define BOARD_XTAL0_CLK_HZ 24000000U /*!< Board xtal0 frequency in Hz */
#define BOARD_XTAL32K_CLK_HZ 32768U /*!< Board xtal32k frequency in Hz */
Expand Down
4 changes: 2 additions & 2 deletions ports/mimxrt10xx/supervisor/flexspi_nor_flash_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "boards/flash_config.h"
#include "supervisor/linker.h"

status_t PLACE_IN_ITCM(flexspi_nor_write_enable)(FLEXSPI_Type * base, uint32_t baseAddr)
status_t PLACE_IN_ITCM(static flexspi_nor_write_enable)(FLEXSPI_Type * base, uint32_t baseAddr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think static needs to be first here. Like below. The macro uses the name in the section name too.

{
flexspi_transfer_t flashXfer;
status_t status;
Expand All @@ -29,7 +29,7 @@ status_t PLACE_IN_ITCM(flexspi_nor_write_enable)(FLEXSPI_Type * base, uint32_t b
return status;
}

status_t PLACE_IN_ITCM(flexspi_nor_wait_bus_busy)(FLEXSPI_Type * base)
static status_t PLACE_IN_ITCM(flexspi_nor_wait_bus_busy)(FLEXSPI_Type * base)
{
/* Wait status ready. */
bool isBusy;
Expand Down
6 changes: 6 additions & 0 deletions ports/mimxrt10xx/supervisor/internal_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include "py/mpconfig.h"

#include "fsl_common.h"

#define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms
#define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2)

Expand All @@ -41,4 +43,8 @@
#define ROM_INDEX_PAGEPROGRAM 9
#define ROM_INDEX_READSTATUSREG 1

extern status_t flexspi_nor_flash_erase_sector(FLEXSPI_Type *base, uint32_t address);
extern status_t flexspi_nor_flash_page_program(FLEXSPI_Type *base, uint32_t dstAddr, const uint32_t *src);
extern status_t flexspi_nor_enable_quad_mode(FLEXSPI_Type *base);

#endif // MICROPY_INCLUDED_MIMXRT10XX_INTERNAL_FLASH_H
2 changes: 2 additions & 0 deletions ports/mimxrt10xx/supervisor/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include "fsl_clock.h"
#include "fsl_device_registers.h"
#include "tusb.h"
#include "supervisor/usb.h"

Expand All @@ -52,6 +53,7 @@ void init_usb_hardware(void) {
usb_phy->TX = phytx;
}

extern void USB_OTG1_IRQHandler(void);
void USB_OTG1_IRQHandler(void) {
usb_irq_handler();
}
2 changes: 1 addition & 1 deletion shared-bindings/_bleio/CharacteristicBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer
uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self);
void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self);
bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self);
int common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self);
void common_hal_bleio_characteristic_buffer_deinit(bleio_characteristic_buffer_obj_t *self);
bool common_hal_bleio_characteristic_buffer_connected(bleio_characteristic_buffer_obj_t *self);

#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTICBUFFER_H
2 changes: 1 addition & 1 deletion shared-bindings/_bleio/ScanEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ mp_obj_t common_hal_bleio_scanentry_get_advertisement_bytes(bleio_scanentry_obj_
mp_int_t common_hal_bleio_scanentry_get_rssi(bleio_scanentry_obj_t *self);
bool common_hal_bleio_scanentry_get_connectable(bleio_scanentry_obj_t *self);
bool common_hal_bleio_scanentry_get_scan_response(bleio_scanentry_obj_t *self);
bool common_hal_bleio_scanentry_matches(bleio_scanentry_obj_t *self, uint8_t *prefixes, size_t prefixes_len, bool all);
bool common_hal_bleio_scanentry_matches(bleio_scanentry_obj_t *self, const uint8_t *prefixes, size_t prefixes_len, bool all);

#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SCANENTRY_H
12 changes: 6 additions & 6 deletions shared-bindings/board/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
//|

#if BOARD_I2C
mp_obj_t board_i2c(void) {
static mp_obj_t board_i2c(void) {
mp_obj_t singleton = common_hal_board_get_i2c();
if (singleton != NULL && !common_hal_busio_i2c_deinited(singleton)) {
return singleton;
Expand All @@ -59,7 +59,7 @@ mp_obj_t board_i2c(void) {
return common_hal_board_create_i2c();
}
#else
mp_obj_t board_i2c(void) {
static mp_obj_t board_i2c(void) {
mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_I2C);
return NULL;
}
Expand All @@ -73,7 +73,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c);
//| ...
//|
#if BOARD_SPI
mp_obj_t board_spi(void) {
static mp_obj_t board_spi(void) {
mp_obj_t singleton = common_hal_board_get_spi();
if (singleton != NULL && !common_hal_busio_spi_deinited(singleton)) {
return singleton;
Expand All @@ -84,7 +84,7 @@ mp_obj_t board_spi(void) {
return common_hal_board_create_spi();
}
#else
mp_obj_t board_spi(void) {
static mp_obj_t board_spi(void) {
mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI);
return NULL;
}
Expand All @@ -101,7 +101,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi);
//| ...
//|
#if BOARD_UART
mp_obj_t board_uart(void) {
static mp_obj_t board_uart(void) {
mp_obj_t singleton = common_hal_board_get_uart();
if (singleton != NULL) {
return singleton;
Expand All @@ -113,7 +113,7 @@ mp_obj_t board_uart(void) {
return common_hal_board_create_uart();
}
#else
mp_obj_t board_uart(void) {
static mp_obj_t board_uart(void) {
mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_UART);
return NULL;
}
Expand Down
18 changes: 9 additions & 9 deletions shared-bindings/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname);
//| """Change current directory."""
//| ...
//|
mp_obj_t os_chdir(mp_obj_t path_in) {
STATIC mp_obj_t os_chdir(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
common_hal_os_chdir(path);
return mp_const_none;
Expand All @@ -79,7 +79,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir);
//| """Get the current directory."""
//| ...
//|
mp_obj_t os_getcwd(void) {
STATIC mp_obj_t os_getcwd(void) {
return common_hal_os_getcwd();
}
MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd);
Expand All @@ -88,7 +88,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd);
//| """With no argument, list the current directory. Otherwise list the given directory."""
//| ...
//|
mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) {
STATIC mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) {
const char *path;
if (n_args == 1) {
path = mp_obj_str_get_str(args[0]);
Expand All @@ -103,7 +103,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(os_listdir_obj, 0, 1, os_listdir);
//| """Create a new directory."""
//| ...
//|
mp_obj_t os_mkdir(mp_obj_t path_in) {
STATIC mp_obj_t os_mkdir(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
common_hal_os_mkdir(path);
return mp_const_none;
Expand All @@ -114,7 +114,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir);
//| """Remove a file."""
//| ...
//|
mp_obj_t os_remove(mp_obj_t path_in) {
STATIC mp_obj_t os_remove(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
common_hal_os_remove(path);
return mp_const_none;
Expand All @@ -125,7 +125,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove);
//| """Remove a directory."""
//| ...
//|
mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) {
STATIC mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) {
const char *old_path = mp_obj_str_get_str(old_path_in);
const char *new_path = mp_obj_str_get_str(new_path_in);
common_hal_os_rename(old_path, new_path);
Expand All @@ -137,7 +137,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename);
//| """Rename a file."""
//| ...
//|
mp_obj_t os_rmdir(mp_obj_t path_in) {
STATIC mp_obj_t os_rmdir(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
common_hal_os_rmdir(path);
return mp_const_none;
Expand All @@ -153,7 +153,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir);
//| which is the number of seconds corresponding to 1999-12-31."""
//| ...
//|
mp_obj_t os_stat(mp_obj_t path_in) {
STATIC mp_obj_t os_stat(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
return common_hal_os_stat(path);
}
Expand All @@ -180,7 +180,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat);
//| in a port-specific implementation."""
//| ...
//|
mp_obj_t os_statvfs(mp_obj_t path_in) {
STATIC mp_obj_t os_statvfs(mp_obj_t path_in) {
const char *path = mp_obj_str_get_str(path_in);
return common_hal_os_statvfs(path);
}
Expand Down
8 changes: 4 additions & 4 deletions shared-bindings/sdcardio/SDCard.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_arg
//|
//| :return: The number of 512-byte blocks, as a number"""
//|
mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) {
STATIC mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) {
sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in;
return mp_obj_new_int_from_ull(common_hal_sdcardio_sdcard_get_blockcount(self));
}
Expand All @@ -118,7 +118,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count);
//|
//| :return: None"""
//|
mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) {
STATIC mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) {
sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t *)self_in;
common_hal_sdcardio_sdcard_deinit(self);
return mp_const_none;
Expand All @@ -136,7 +136,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit);
//| :return: None"""
//|

mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) {
STATIC mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) {
uint32_t start_block = mp_obj_get_int(start_block_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE);
Expand All @@ -160,7 +160,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readbl
//| :return: None"""
//|

mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) {
STATIC mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) {
uint32_t start_block = mp_obj_get_int(start_block_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
Expand Down
Loading