From 9e799a7c7482b06e82683fba1be43f6c0812790c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 10 Nov 2021 11:26:54 -0600 Subject: [PATCH] -Werror=missing-prototypes for nRF --- ports/nrf/Makefile | 15 +++++++++++---- ports/nrf/background.c | 3 ++- .../nrf/common-hal/_bleio/CharacteristicBuffer.c | 1 + ports/nrf/common-hal/_bleio/UUID.c | 1 + ports/nrf/common-hal/_bleio/bonding.h | 5 +++++ ports/nrf/common-hal/alarm/SleepMemory.c | 1 + ports/nrf/common-hal/alarm/__init__.c | 2 +- ports/nrf/common-hal/analogio/AnalogIn.c | 1 + ports/nrf/common-hal/audiobusio/I2SOut.c | 2 +- ports/nrf/common-hal/audiobusio/PDMIn.c | 1 + ports/nrf/common-hal/countio/Counter.c | 1 + ports/nrf/common-hal/microcontroller/Processor.c | 1 + ports/nrf/common-hal/neopixel_write/__init__.c | 1 + ports/nrf/common-hal/nvm/ByteArray.c | 7 ++++--- ports/nrf/common-hal/os/__init__.c | 4 +++- ports/nrf/common-hal/pwmio/PWMOut.c | 4 ++-- .../nrf/common-hal/rotaryio/IncrementalEncoder.c | 1 + ports/nrf/common-hal/rtc/RTC.c | 2 ++ ports/nrf/device/nrf52/startup_nrf52840.c | 2 ++ ports/nrf/fatfs_port.c | 1 + ports/nrf/peripherals/nrf/cache.c | 1 + ports/nrf/peripherals/nrf/nrf52840/power.c | 1 + ports/nrf/sd_mutex.c | 1 + ports/nrf/supervisor/port.c | 8 +++++--- ports/nrf/supervisor/qspi_flash.c | 3 ++- ports/nrf/supervisor/qspi_flash.h | 1 + ports/nrf/supervisor/usb.c | 1 + supervisor/shared/bluetooth/file_transfer.c | 3 ++- supervisor/shared/bluetooth/serial.c | 1 + 29 files changed, 58 insertions(+), 18 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index acd1509297..04a648a4e2 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -101,7 +101,7 @@ endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk CFLAGS += $(OPTIMIZATION_FLAGS) -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes # Nordic Softdevice SDK header files contains inline assembler that has # broken constraints. As a result the IPA-modref pass, introduced in gcc-11, @@ -173,25 +173,32 @@ SRC_C += \ bluetooth/ble_drv.c \ common-hal/_bleio/bonding.c \ nrfx/mdk/system_$(MCU_SUB_VARIANT).c \ + sd_mutex.c \ + +SRC_PERIPHERALS := \ peripherals/nrf/cache.c \ peripherals/nrf/clocks.c \ peripherals/nrf/$(MCU_CHIP)/pins.c \ peripherals/nrf/$(MCU_CHIP)/power.c \ peripherals/nrf/nvm.c \ peripherals/nrf/timers.c \ - sd_mutex.c +$(patsubst %.c,$(BUILD)/%.o,$(SRC_PERIPHERALS)): CFLAGS += -Wno-missing-prototypes + +SRC_C += $(SRC_PERIPHERALS) ifneq ($(CIRCUITPY_USB),0) # USB source files for nrf52840 ifeq ($(MCU_SUB_VARIANT),nrf52840) -SRC_C += \ +SRC_DCD = \ lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c endif ifeq ($(MCU_SUB_VARIANT),nrf52833) -SRC_C += \ +SRC_DCD += \ lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c endif +SRC_C += $(SRC_DCD) +$(patsubst %.c,$(BUILD)/%.o,$(SRC_DCD)): CFLAGS += -Wno-missing-prototypes endif # CIRCUITPY_USB SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ diff --git a/ports/nrf/background.c b/ports/nrf/background.c index f4d6b0f79f..f0822de521 100644 --- a/ports/nrf/background.c +++ b/ports/nrf/background.c @@ -26,8 +26,9 @@ #include "py/runtime.h" #include "supervisor/filesystem.h" -#include "supervisor/usb.h" +#include "supervisor/port.h" #include "supervisor/shared/stack.h" +#include "supervisor/usb.h" #if CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" diff --git a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c index d45bd89f3d..df389df0f8 100644 --- a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c @@ -39,6 +39,7 @@ #include "shared-bindings/_bleio/Connection.h" #include "supervisor/shared/tick.h" #include "common-hal/_bleio/CharacteristicBuffer.h" +#include "shared-bindings/_bleio/CharacteristicBuffer.h" // Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped. STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { diff --git a/ports/nrf/common-hal/_bleio/UUID.c b/ports/nrf/common-hal/_bleio/UUID.c index a55d874f22..2d94b4c0ce 100644 --- a/ports/nrf/common-hal/_bleio/UUID.c +++ b/ports/nrf/common-hal/_bleio/UUID.c @@ -30,6 +30,7 @@ #include "py/runtime.h" #include "common-hal/_bleio/UUID.h" +#include "shared-bindings/_bleio/UUID.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Adapter.h" diff --git a/ports/nrf/common-hal/_bleio/bonding.h b/ports/nrf/common-hal/_bleio/bonding.h index 228082ec30..0884fe8c13 100644 --- a/ports/nrf/common-hal/_bleio/bonding.h +++ b/ports/nrf/common-hal/_bleio/bonding.h @@ -85,4 +85,9 @@ const ble_gap_enc_key_t *bonding_load_peer_encryption_key(bool is_central, const size_t bonding_load_identities(bool is_central, const ble_gap_id_key_t **keys, size_t max_length); size_t bonding_peripheral_bond_count(void); +#if BONDING_DEBUG +void bonding_print_block(bonding_block_t *); +void bonding_print_keys(bonding_keys_t *); +#endif + #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_BONDING_H diff --git a/ports/nrf/common-hal/alarm/SleepMemory.c b/ports/nrf/common-hal/alarm/SleepMemory.c index 40ce1f1a75..c63cbb7af5 100644 --- a/ports/nrf/common-hal/alarm/SleepMemory.c +++ b/ports/nrf/common-hal/alarm/SleepMemory.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "common-hal/alarm/__init__.h" #include "common-hal/alarm/SleepMemory.h" +#include "shared-bindings/alarm/SleepMemory.h" #include "nrf_power.h" __attribute__((section(".uninitialized"))) static uint8_t _sleepmem[SLEEP_MEMORY_LENGTH]; diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 5006d726f0..92dac1c789 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -147,7 +147,7 @@ STATIC void _setup_sleep_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t // TODO: this handles all possible types of wakeup, which is redundant with main. // revise to extract all parts essential to enabling sleep wakeup, but leave the // alarm/non-alarm sorting to the existing main loop. -void system_on_idle_until_alarm(int64_t timediff_ms, bool wake_from_serial, uint32_t prescaler) { +STATIC void system_on_idle_until_alarm(int64_t timediff_ms, bool wake_from_serial, uint32_t prescaler) { bool have_timeout = false; uint64_t start_tick = 0, end_tick = 0; int64_t tickdiff; diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 2f7bede165..c64e51ec09 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -26,6 +26,7 @@ */ #include "common-hal/analogio/AnalogIn.h" +#include "shared-bindings/analogio/AnalogIn.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 8626ce714d..6e68583a03 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -91,7 +91,7 @@ static void calculate_ratio_info(uint32_t target_sample_rate, struct frequency_i / target_sample_rate; } -void choose_i2s_clocking(audiobusio_i2sout_obj_t *self, uint32_t sample_rate) { +STATIC void choose_i2s_clocking(audiobusio_i2sout_obj_t *self, uint32_t sample_rate) { struct frequency_info best = {0, 0, 0, 1.0}; for (size_t ri = 0; ri < sizeof(ratios) / sizeof(ratios[0]); ri++) { if (NRF_I2S->CONFIG.SWIDTH == I2S_CONFIG_SWIDTH_SWIDTH_16Bit diff --git a/ports/nrf/common-hal/audiobusio/PDMIn.c b/ports/nrf/common-hal/audiobusio/PDMIn.c index c34a4ebba9..9c9afbcb50 100644 --- a/ports/nrf/common-hal/audiobusio/PDMIn.c +++ b/ports/nrf/common-hal/audiobusio/PDMIn.c @@ -25,6 +25,7 @@ */ #include "common-hal/audiobusio/PDMIn.h" +#include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" diff --git a/ports/nrf/common-hal/countio/Counter.c b/ports/nrf/common-hal/countio/Counter.c index 452c9d9c83..b2296a7dcc 100644 --- a/ports/nrf/common-hal/countio/Counter.c +++ b/ports/nrf/common-hal/countio/Counter.c @@ -1,5 +1,6 @@ #include "common-hal/countio/Counter.h" +#include "shared-bindings/countio/Counter.h" #include "py/runtime.h" diff --git a/ports/nrf/common-hal/microcontroller/Processor.c b/ports/nrf/common-hal/microcontroller/Processor.c index f01b22fb47..fa2dfad6a4 100644 --- a/ports/nrf/common-hal/microcontroller/Processor.c +++ b/ports/nrf/common-hal/microcontroller/Processor.c @@ -27,6 +27,7 @@ #include "py/runtime.h" #include "common-hal/microcontroller/Processor.h" +#include "shared-bindings/microcontroller/Processor.h" #include "common-hal/alarm/__init__.h" #include "shared-bindings/microcontroller/ResetReason.h" diff --git a/ports/nrf/common-hal/neopixel_write/__init__.c b/ports/nrf/common-hal/neopixel_write/__init__.c index c8aa44cd12..6f012fa35b 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.c +++ b/ports/nrf/common-hal/neopixel_write/__init__.c @@ -27,6 +27,7 @@ #include "py/mphal.h" #include "py/mpstate.h" #include "shared-bindings/neopixel_write/__init__.h" +#include "common-hal/neopixel_write/__init__.h" #include "supervisor/port.h" #include "nrf_pwm.h" diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index 5af2cc5636..539f66a5b1 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -26,13 +26,14 @@ #include "py/runtime.h" #include "common-hal/nvm/ByteArray.h" +#include "shared-bindings/nvm/ByteArray.h" #include #include #include "peripherals/nrf/nvm.h" -uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { +uint32_t common_hal_nvm_bytearray_get_length(const nvm_bytearray_obj_t *self) { return self->len; } @@ -50,7 +51,7 @@ static bool write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ } } -bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, +bool common_hal_nvm_bytearray_set_bytes(const nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len) { uint32_t address = (uint32_t)self->start_address + start_index; @@ -70,7 +71,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, return true; } -void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, +void common_hal_nvm_bytearray_get_bytes(const nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t *values) { memcpy(values, self->start_address + start_index, len); } diff --git a/ports/nrf/common-hal/os/__init__.c b/ports/nrf/common-hal/os/__init__.c index 5a0f10596c..caddcdc2e2 100644 --- a/ports/nrf/common-hal/os/__init__.c +++ b/ports/nrf/common-hal/os/__init__.c @@ -29,6 +29,8 @@ #include "py/objstr.h" #include "py/objtuple.h" +#include "shared-bindings/os/__init__.h" + #ifdef BLUETOOTH_SD #include "nrf_sdm.h" #endif @@ -61,7 +63,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) { #ifdef BLUETOOTH_SD uint8_t sd_en = 0; (void)sd_softdevice_is_enabled(&sd_en); diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index 6dd4a153b8..76c8c4e6d4 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -86,7 +86,7 @@ void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { } } -void reset_single_pwmout(uint8_t i) { +STATIC void reset_single_pwmout(uint8_t i) { NRF_PWM_Type *pwm = pwms[i]; pwm->ENABLE = 0; @@ -122,7 +122,7 @@ void pwmout_reset(void) { // Find the smallest prescaler value that will allow the divisor to be in range. // This allows the most accuracy. -bool convert_frequency(uint32_t frequency, uint16_t *countertop, nrf_pwm_clk_t *base_clock) { +STATIC bool convert_frequency(uint32_t frequency, uint16_t *countertop, nrf_pwm_clk_t *base_clock) { uint32_t divisor = 1; // Use a 32-bit number so we don't overflow the uint16_t; uint32_t tentative_countertop; diff --git a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c index 425da9e6de..51e83b56af 100644 --- a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c @@ -26,6 +26,7 @@ #include "common-hal/rotaryio/IncrementalEncoder.h" #include "shared-module/rotaryio/IncrementalEncoder.h" +#include "shared-bindings/rotaryio/IncrementalEncoder.h" #include "nrfx_gpiote.h" #include "py/runtime.h" diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 074079cd6b..0b7115a14f 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -30,6 +30,8 @@ #include "py/runtime.h" #include "shared/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" +#include "common-hal/rtc/RTC.h" +#include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" #include "supervisor/shared/translate.h" diff --git a/ports/nrf/device/nrf52/startup_nrf52840.c b/ports/nrf/device/nrf52/startup_nrf52840.c index 67380303d6..b6ef3c54ab 100644 --- a/ports/nrf/device/nrf52/startup_nrf52840.c +++ b/ports/nrf/device/nrf52/startup_nrf52840.c @@ -40,12 +40,14 @@ typedef void (*func)(void); extern void _start(void) __attribute__((noreturn)); extern void SystemInit(void); +extern void Default_Handler(void); void Default_Handler(void) { while (1) { ; } } +extern void Reset_Handler(void); void Reset_Handler(void) { uint32_t *p_src = &_sidata; uint32_t *p_dest = &_sdata; diff --git a/ports/nrf/fatfs_port.c b/ports/nrf/fatfs_port.c index 5882864bbe..38c2d923b8 100644 --- a/ports/nrf/fatfs_port.c +++ b/ports/nrf/fatfs_port.c @@ -29,6 +29,7 @@ #include "shared/timeutils/timeutils.h" #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" +#include "supervisor/fatfs_port.h" DWORD _time_override = 0; DWORD get_fattime(void) { diff --git a/ports/nrf/peripherals/nrf/cache.c b/ports/nrf/peripherals/nrf/cache.c index 02e11c4613..6eb590d770 100644 --- a/ports/nrf/peripherals/nrf/cache.c +++ b/ports/nrf/peripherals/nrf/cache.c @@ -25,6 +25,7 @@ */ #include "nrfx.h" +#include "peripherals/nrf/cache.h" // Turn off cache and invalidate all data in it. void nrf_peripherals_disable_and_clear_cache(void) { diff --git a/ports/nrf/peripherals/nrf/nrf52840/power.c b/ports/nrf/peripherals/nrf/nrf52840/power.c index 192a49acca..e1573bd602 100644 --- a/ports/nrf/peripherals/nrf/nrf52840/power.c +++ b/ports/nrf/peripherals/nrf/nrf52840/power.c @@ -26,6 +26,7 @@ #include "nrfx.h" #include "hal/nrf_nvmc.h" +#include "peripherals/nrf/power.h" void nrf_peripherals_power_init(void) { // Set GPIO reference voltage to 3.3V if it isn't already. REGOUT0 will get reset to 0xfffffff diff --git a/ports/nrf/sd_mutex.c b/ports/nrf/sd_mutex.c index 2ae490288d..f94feb951b 100644 --- a/ports/nrf/sd_mutex.c +++ b/ports/nrf/sd_mutex.c @@ -27,6 +27,7 @@ #include "py/mpconfig.h" #include "py/runtime.h" #include "nrf_soc.h" +#include "sd_mutex.h" void sd_mutex_acquire_check(nrf_mutex_t *p_mutex) { uint32_t err_code = sd_mutex_acquire(p_mutex); diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 17e9817b5c..a1eb973b83 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -46,6 +46,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/_bleio/__init__.h" +#include "common-hal/alarm/time/TimeAlarm.h" #include "common-hal/analogio/AnalogIn.h" #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" @@ -97,7 +98,7 @@ static volatile struct { uint32_t suffix; } overflow_tracker __attribute__((section(".uninitialized"))); -void rtc_handler(nrfx_rtc_int_type_t int_type) { +STATIC void rtc_handler(nrfx_rtc_int_type_t int_type) { if (int_type == NRFX_RTC_INT_OVERFLOW) { // Our RTC is 24 bits and we're clocking it at 32.768khz which is 32 (2 ** 5) subticks per // tick. @@ -116,7 +117,7 @@ void rtc_handler(nrfx_rtc_int_type_t int_type) { } } -void tick_init(void) { +STATIC void tick_init(void) { if (!nrf_clock_lf_is_running(NRF_CLOCK)) { nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); } @@ -137,7 +138,7 @@ void tick_init(void) { } } -void tick_uninit(void) { +STATIC void tick_uninit(void) { nrfx_rtc_counter_clear(&rtc_instance); nrfx_rtc_disable(&rtc_instance); nrfx_rtc_uninit(&rtc_instance); @@ -400,6 +401,7 @@ void port_idle_until_interrupt(void) { } +extern void HardFault_Handler(void); void HardFault_Handler(void) { reset_into_safe_mode(HARD_CRASH); while (true) { diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index 632fe4d212..df80671e64 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -26,6 +26,7 @@ */ #include "supervisor/spi_flash_api.h" +#include "supervisor/qspi_flash.h" #include #include @@ -69,7 +70,7 @@ void qspi_disable(void) { } } -void qspi_enable(void) { +STATIC void qspi_enable(void) { if (NRF_QSPI->ENABLE) { return; } diff --git a/ports/nrf/supervisor/qspi_flash.h b/ports/nrf/supervisor/qspi_flash.h index 527f3cec39..185a155be0 100644 --- a/ports/nrf/supervisor/qspi_flash.h +++ b/ports/nrf/supervisor/qspi_flash.h @@ -1,2 +1,3 @@ extern void qspi_flash_enter_sleep(void); extern void qspi_flash_exit_sleep(void); +extern void qspi_disable(void); diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index 6031cced50..8651b008f0 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -91,6 +91,7 @@ void init_usb_hardware(void) { } } +extern void USBD_IRQHandler(void); void USBD_IRQHandler(void) { usb_irq_handler(); } diff --git a/supervisor/shared/bluetooth/file_transfer.c b/supervisor/shared/bluetooth/file_transfer.c index d1841c87d0..bf42326275 100644 --- a/supervisor/shared/bluetooth/file_transfer.c +++ b/supervisor/shared/bluetooth/file_transfer.c @@ -44,6 +44,7 @@ #include "supervisor/fatfs_port.h" #include "supervisor/shared/autoreload.h" +#include "supervisor/shared/bluetooth/file_transfer.h" #include "supervisor/shared/bluetooth/file_transfer_protocol.h" #include "supervisor/shared/tick.h" #include "supervisor/usb.h" @@ -136,7 +137,7 @@ void supervisor_start_bluetooth_file_transfer(void) { // FATFS has a two second timestamp resolution but the BLE API allows for nanosecond resolution. // This function truncates the time the time to a resolution storable by FATFS and fills in the // FATFS encoded version into fattime. -uint64_t truncate_time(uint64_t input_time, DWORD *fattime) { +STATIC uint64_t truncate_time(uint64_t input_time, DWORD *fattime) { timeutils_struct_time_t tm; uint64_t seconds_since_epoch = timeutils_seconds_since_epoch_from_nanoseconds_since_1970(input_time); timeutils_seconds_since_epoch_to_struct_time(seconds_since_epoch, &tm); diff --git a/supervisor/shared/bluetooth/serial.c b/supervisor/shared/bluetooth/serial.c index 018acd5f4a..2edf3c784f 100644 --- a/supervisor/shared/bluetooth/serial.c +++ b/supervisor/shared/bluetooth/serial.c @@ -35,6 +35,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" #include "shared-module/storage/__init__.h" +#include "supervisor/shared/bluetooth/serial.h" #include "common-hal/_bleio/__init__.h"