diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/bus/softqspi.c | 18 | ||||
| -rw-r--r-- | drivers/cyw43/cywbt.c | 16 | ||||
| -rw-r--r-- | drivers/dht/dht.c | 2 | ||||
| -rw-r--r-- | drivers/esp-hosted/esp_hosted_hal.c | 4 | ||||
| -rw-r--r-- | drivers/memory/spiflash.c | 28 |
5 files changed, 34 insertions, 34 deletions
diff --git a/drivers/bus/softqspi.c b/drivers/bus/softqspi.c index dc205da3a..65a504a73 100644 --- a/drivers/bus/softqspi.c +++ b/drivers/bus/softqspi.c @@ -49,14 +49,14 @@ #endif -STATIC void nibble_write(mp_soft_qspi_obj_t *self, uint8_t v) { +static void nibble_write(mp_soft_qspi_obj_t *self, uint8_t v) { mp_hal_pin_write(self->io0, v & 1); mp_hal_pin_write(self->io1, (v >> 1) & 1); mp_hal_pin_write(self->io2, (v >> 2) & 1); mp_hal_pin_write(self->io3, (v >> 3) & 1); } -STATIC int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) { +static int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) { mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in; switch (cmd) { @@ -80,7 +80,7 @@ STATIC int mp_soft_qspi_ioctl(void *self_in, uint32_t cmd) { return 0; // success } -STATIC void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *src, uint8_t *dest) { +static void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *src, uint8_t *dest) { // Will run as fast as possible, limited only by CPU speed and GPIO time mp_hal_pin_input(self->io1); mp_hal_pin_output(self->io0); @@ -119,7 +119,7 @@ STATIC void mp_soft_qspi_transfer(mp_soft_qspi_obj_t *self, size_t len, const ui } } -STATIC void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *buf) { +static void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *buf) { // Make all IO lines input mp_hal_pin_input(self->io2); mp_hal_pin_input(self->io3); @@ -137,7 +137,7 @@ STATIC void mp_soft_qspi_qread(mp_soft_qspi_obj_t *self, size_t len, uint8_t *bu } } -STATIC void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *buf) { +static void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint8_t *buf) { // Make all IO lines output mp_hal_pin_output(self->io2); mp_hal_pin_output(self->io3); @@ -158,7 +158,7 @@ STATIC void mp_soft_qspi_qwrite(mp_soft_qspi_obj_t *self, size_t len, const uint //mp_hal_pin_input(self->io1); } -STATIC int mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, uint32_t data) { +static int mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, uint32_t data) { mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in; uint32_t cmd_buf = cmd | data << 8; CS_LOW(self); @@ -167,7 +167,7 @@ STATIC int mp_soft_qspi_write_cmd_data(void *self_in, uint8_t cmd, size_t len, u return 0; } -STATIC int mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src) { +static int mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src) { mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in; uint8_t cmd_buf[5] = {cmd}; uint8_t addr_len = mp_spi_set_addr_buff(&cmd_buf[1], addr); @@ -178,7 +178,7 @@ STATIC int mp_soft_qspi_write_cmd_addr_data(void *self_in, uint8_t cmd, uint32_t return 0; } -STATIC int mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len, uint32_t *dest) { +static int mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len, uint32_t *dest) { mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in; uint32_t cmd_buf = cmd; CS_LOW(self); @@ -188,7 +188,7 @@ STATIC int mp_soft_qspi_read_cmd(void *self_in, uint8_t cmd, size_t len, uint32_ return 0; } -STATIC int mp_soft_qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr, size_t len, uint8_t *dest) { +static int mp_soft_qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr, size_t len, uint8_t *dest) { mp_soft_qspi_obj_t *self = (mp_soft_qspi_obj_t*)self_in; uint8_t cmd_buf[7] = {cmd}; uint8_t addr_len = mp_spi_set_addr_buff(&cmd_buf[1], addr); diff --git a/drivers/cyw43/cywbt.c b/drivers/cyw43/cywbt.c index 3f454485a..0ee69a07e 100644 --- a/drivers/cyw43/cywbt.c +++ b/drivers/cyw43/cywbt.c @@ -51,7 +51,7 @@ extern uint8_t mp_bluetooth_hci_cmd_buf[4 + 256]; // Provided by the port. extern machine_uart_obj_t mp_bluetooth_hci_uart_obj; -STATIC void cywbt_wait_cts_low(void) { +static void cywbt_wait_cts_low(void) { mp_hal_pin_config(CYW43_PIN_BT_CTS, MP_HAL_PIN_MODE_INPUT, MP_HAL_PIN_PULL_UP, 0); for (int i = 0; i < 200; ++i) { if (mp_hal_pin_read(CYW43_PIN_BT_CTS) == 0) { @@ -64,7 +64,7 @@ STATIC void cywbt_wait_cts_low(void) { } #endif -STATIC int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) { +static int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) { mp_bluetooth_hci_uart_write((void *)buf, len); for (int c, i = 0; i < 6; ++i) { while ((c = mp_bluetooth_hci_uart_readchar()) == -1) { @@ -96,7 +96,7 @@ STATIC int cywbt_hci_cmd_raw(size_t len, uint8_t *buf) { return 0; } -STATIC int cywbt_hci_cmd(int ogf, int ocf, size_t param_len, const uint8_t *param_buf) { +static int cywbt_hci_cmd(int ogf, int ocf, size_t param_len, const uint8_t *param_buf) { uint8_t *buf = mp_bluetooth_hci_cmd_buf; buf[0] = 0x01; buf[1] = ocf; @@ -108,19 +108,19 @@ STATIC int cywbt_hci_cmd(int ogf, int ocf, size_t param_len, const uint8_t *para return cywbt_hci_cmd_raw(4 + param_len, buf); } -STATIC void put_le16(uint8_t *buf, uint16_t val) { +static void put_le16(uint8_t *buf, uint16_t val) { buf[0] = val; buf[1] = val >> 8; } -STATIC void put_le32(uint8_t *buf, uint32_t val) { +static void put_le32(uint8_t *buf, uint32_t val) { buf[0] = val; buf[1] = val >> 8; buf[2] = val >> 16; buf[3] = val >> 24; } -STATIC int cywbt_set_baudrate(uint32_t baudrate) { +static int cywbt_set_baudrate(uint32_t baudrate) { uint8_t buf[6]; put_le16(buf, 0); put_le32(buf + 2, baudrate); @@ -128,7 +128,7 @@ STATIC int cywbt_set_baudrate(uint32_t baudrate) { } // download firmware -STATIC int cywbt_download_firmware(const uint8_t *firmware) { +static int cywbt_download_firmware(const uint8_t *firmware) { cywbt_hci_cmd(0x3f, 0x2e, 0, NULL); bool last_packet = false; @@ -255,7 +255,7 @@ int mp_bluetooth_hci_controller_deinit(void) { } #ifdef CYW43_PIN_BT_DEV_WAKE -STATIC uint32_t bt_sleep_ticks; +static uint32_t bt_sleep_ticks; #endif int mp_bluetooth_hci_controller_sleep_maybe(void) { diff --git a/drivers/dht/dht.c b/drivers/dht/dht.c index 7e9b89782..e6b71542d 100644 --- a/drivers/dht/dht.c +++ b/drivers/dht/dht.c @@ -40,7 +40,7 @@ #define mp_hal_pin_od_high_dht mp_hal_pin_od_high #endif -STATIC mp_obj_t dht_readinto(mp_obj_t pin_in, mp_obj_t buf_in) { +static mp_obj_t dht_readinto(mp_obj_t pin_in, mp_obj_t buf_in) { mp_hal_pin_obj_t pin = mp_hal_get_pin_obj(pin_in); mp_hal_pin_open_drain(pin); diff --git a/drivers/esp-hosted/esp_hosted_hal.c b/drivers/esp-hosted/esp_hosted_hal.c index bac8a89bd..c98eb5031 100644 --- a/drivers/esp-hosted/esp_hosted_hal.c +++ b/drivers/esp-hosted/esp_hosted_hal.c @@ -44,14 +44,14 @@ extern void mod_network_poll_events(void); -STATIC mp_obj_t esp_hosted_pin_irq_callback(mp_obj_t self_in) { +static mp_obj_t esp_hosted_pin_irq_callback(mp_obj_t self_in) { #ifdef MICROPY_HW_WIFI_LED led_toggle(MICROPY_HW_WIFI_LED); #endif mod_network_poll_events(); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_hosted_pin_irq_callback_obj, esp_hosted_pin_irq_callback); +static MP_DEFINE_CONST_FUN_OBJ_1(esp_hosted_pin_irq_callback_obj, esp_hosted_pin_irq_callback); MP_WEAK int esp_hosted_hal_init(uint32_t mode) { // Perform a hard reset and set pins to their defaults. diff --git a/drivers/memory/spiflash.c b/drivers/memory/spiflash.c index 52739b1d8..e66153636 100644 --- a/drivers/memory/spiflash.c +++ b/drivers/memory/spiflash.c @@ -56,21 +56,21 @@ #define PAGE_SIZE (256) // maximum bytes we can write in one SPI transfer #define SECTOR_SIZE MP_SPIFLASH_ERASE_BLOCK_SIZE -STATIC void mp_spiflash_acquire_bus(mp_spiflash_t *self) { +static void mp_spiflash_acquire_bus(mp_spiflash_t *self) { const mp_spiflash_config_t *c = self->config; if (c->bus_kind == MP_SPIFLASH_BUS_QSPI) { c->bus.u_qspi.proto->ioctl(c->bus.u_qspi.data, MP_QSPI_IOCTL_BUS_ACQUIRE); } } -STATIC void mp_spiflash_release_bus(mp_spiflash_t *self) { +static void mp_spiflash_release_bus(mp_spiflash_t *self) { const mp_spiflash_config_t *c = self->config; if (c->bus_kind == MP_SPIFLASH_BUS_QSPI) { c->bus.u_qspi.proto->ioctl(c->bus.u_qspi.data, MP_QSPI_IOCTL_BUS_RELEASE); } } -STATIC int mp_spiflash_write_cmd_data(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t data) { +static int mp_spiflash_write_cmd_data(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t data) { int ret = 0; const mp_spiflash_config_t *c = self->config; if (c->bus_kind == MP_SPIFLASH_BUS_SPI) { @@ -84,7 +84,7 @@ STATIC int mp_spiflash_write_cmd_data(mp_spiflash_t *self, uint8_t cmd, size_t l return ret; } -STATIC int mp_spiflash_transfer_cmd_addr_data(mp_spiflash_t *self, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src, uint8_t *dest) { +static int mp_spiflash_transfer_cmd_addr_data(mp_spiflash_t *self, uint8_t cmd, uint32_t addr, size_t len, const uint8_t *src, uint8_t *dest) { int ret = 0; const mp_spiflash_config_t *c = self->config; if (c->bus_kind == MP_SPIFLASH_BUS_SPI) { @@ -109,7 +109,7 @@ STATIC int mp_spiflash_transfer_cmd_addr_data(mp_spiflash_t *self, uint8_t cmd, return ret; } -STATIC int mp_spiflash_read_cmd(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t *dest) { +static int mp_spiflash_read_cmd(mp_spiflash_t *self, uint8_t cmd, size_t len, uint32_t *dest) { const mp_spiflash_config_t *c = self->config; if (c->bus_kind == MP_SPIFLASH_BUS_SPI) { mp_hal_pin_write(c->bus.u_spi.cs, 0); @@ -122,7 +122,7 @@ STATIC int mp_spiflash_read_cmd(mp_spiflash_t *self, uint8_t cmd, size_t len, ui } } -STATIC int mp_spiflash_read_data(mp_spiflash_t *self, uint32_t addr, size_t len, uint8_t *dest) { +static int mp_spiflash_read_data(mp_spiflash_t *self, uint32_t addr, size_t len, uint8_t *dest) { const mp_spiflash_config_t *c = self->config; uint8_t cmd; if (c->bus_kind == MP_SPIFLASH_BUS_SPI) { @@ -133,11 +133,11 @@ STATIC int mp_spiflash_read_data(mp_spiflash_t *self, uint32_t addr, size_t len, return mp_spiflash_transfer_cmd_addr_data(self, cmd, addr, len, NULL, dest); } -STATIC int mp_spiflash_write_cmd(mp_spiflash_t *self, uint8_t cmd) { +static int mp_spiflash_write_cmd(mp_spiflash_t *self, uint8_t cmd) { return mp_spiflash_write_cmd_data(self, cmd, 0, 0); } -STATIC int mp_spiflash_wait_sr(mp_spiflash_t *self, uint8_t mask, uint8_t val, uint32_t timeout) { +static int mp_spiflash_wait_sr(mp_spiflash_t *self, uint8_t mask, uint8_t val, uint32_t timeout) { do { uint32_t sr; int ret = mp_spiflash_read_cmd(self, CMD_RDSR, 1, &sr); @@ -152,11 +152,11 @@ STATIC int mp_spiflash_wait_sr(mp_spiflash_t *self, uint8_t mask, uint8_t val, u return -MP_ETIMEDOUT; } -STATIC int mp_spiflash_wait_wel1(mp_spiflash_t *self) { +static int mp_spiflash_wait_wel1(mp_spiflash_t *self) { return mp_spiflash_wait_sr(self, 2, 2, WAIT_SR_TIMEOUT); } -STATIC int mp_spiflash_wait_wip0(mp_spiflash_t *self) { +static int mp_spiflash_wait_wip0(mp_spiflash_t *self) { return mp_spiflash_wait_sr(self, 1, 0, WAIT_SR_TIMEOUT); } @@ -219,7 +219,7 @@ void mp_spiflash_deepsleep(mp_spiflash_t *self, int value) { } } -STATIC int mp_spiflash_erase_block_internal(mp_spiflash_t *self, uint32_t addr) { +static int mp_spiflash_erase_block_internal(mp_spiflash_t *self, uint32_t addr) { int ret = 0; // enable writes ret = mp_spiflash_write_cmd(self, CMD_WREN); @@ -244,7 +244,7 @@ STATIC int mp_spiflash_erase_block_internal(mp_spiflash_t *self, uint32_t addr) return mp_spiflash_wait_wip0(self); } -STATIC int mp_spiflash_write_page(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) { +static int mp_spiflash_write_page(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) { int ret = 0; // enable writes ret = mp_spiflash_write_cmd(self, CMD_WREN); @@ -361,7 +361,7 @@ int mp_spiflash_cached_read(mp_spiflash_t *self, uint32_t addr, size_t len, uint return ret; } -STATIC int mp_spiflash_cache_flush_internal(mp_spiflash_t *self) { +static int mp_spiflash_cache_flush_internal(mp_spiflash_t *self) { #if USE_WR_DELAY if (!(self->flags & 1)) { return 0; @@ -396,7 +396,7 @@ int mp_spiflash_cache_flush(mp_spiflash_t *self) { return ret; } -STATIC int mp_spiflash_cached_write_part(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) { +static int mp_spiflash_cached_write_part(mp_spiflash_t *self, uint32_t addr, size_t len, const uint8_t *src) { // Align to 4096 sector uint32_t offset = addr & 0xfff; uint32_t sec = addr >> 12; |
