From 4cd437ed352eebf9635f310b03d434323687f07d Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sat, 7 Mar 2026 17:12:40 +0100 Subject: [PATCH] Fix strict non-prototype declaration warn. Fixes #22. Signed-off-by: Pol Henarejos --- src/fs/file.c | 2 +- src/fs/flash.c | 2 +- src/fs/low_flash.c | 4 ++-- src/fs/otp.c | 4 ++-- src/fs/otp.h | 4 ++-- src/main.c | 10 +++++----- src/pico_keys.h | 12 ++++++------ 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/fs/file.c b/src/fs/file.c index 51291b0..6d95d72 100644 --- a/src/fs/file.c +++ b/src/fs/file.c @@ -33,7 +33,7 @@ extern uint16_t flash_read_uint16(uintptr_t addr); extern uint8_t flash_read_uint8(uintptr_t addr); extern uint8_t *flash_read(uintptr_t addr); extern int flash_clear_file(file_t *ef); -extern void low_flash_available(); +extern void low_flash_available(void); #ifndef ENABLE_EMULATION file_t sef_phy = {.fid = EF_PHY, .parent = 5, .name = NULL, .type = FILE_TYPE_INTERNAL_EF | FILE_DATA_FLASH | FILE_PERSISTENT, .data = NULL, .ef_structure = FILE_EF_TRANSPARENT, .acl = {0xff}}; diff --git a/src/fs/flash.c b/src/fs/flash.c index e71a985..da744d6 100644 --- a/src/fs/flash.c +++ b/src/fs/flash.c @@ -61,7 +61,7 @@ extern uintptr_t flash_read_uintptr(uintptr_t addr); extern uint16_t flash_read_uint16(uintptr_t addr); extern uint8_t *flash_read(uintptr_t addr); -extern void low_flash_available(); +extern void low_flash_available(void); uintptr_t last_base; uint32_t num_files = 0; diff --git a/src/fs/low_flash.c b/src/fs/low_flash.c index e2f7c6a..146524f 100644 --- a/src/fs/low_flash.c +++ b/src/fs/low_flash.c @@ -230,7 +230,7 @@ void low_flash_init() { flash_set_bounds(data_start_addr, data_end_addr); } -void low_flash_init_core1() { +void low_flash_init_core1(void) { mutex_enter_blocking(&mtx_flash); multicore_lockout_victim_init(); locked_out = true; @@ -243,7 +243,7 @@ void wait_flash_finish() { sem_acquire_blocking(&sem_flash); //decrease permits } -void low_flash_available() { +void low_flash_available(void) { mutex_enter_blocking(&mtx_flash); flash_available = true; mutex_exit(&mtx_flash); diff --git a/src/fs/otp.c b/src/fs/otp.c index 4825b5b..80aec7d 100644 --- a/src/fs/otp.c +++ b/src/fs/otp.c @@ -315,7 +315,7 @@ bool otp_is_secure_boot_enabled(uint8_t *bootkey) { return false; } -bool otp_is_secure_boot_locked() { +bool otp_is_secure_boot_locked(void) { uint8_t bootkey_idx = 0xFF; if (otp_is_secure_boot_enabled(&bootkey_idx) == false) { return false; @@ -518,7 +518,7 @@ void otp_migrate_chaff() { } #endif -void init_otp_files() { +void init_otp_files(void) { #ifdef PICO_RP2350 otp_migrate_chaff(); diff --git a/src/fs/otp.h b/src/fs/otp.h index 3ff7603..28b52ed 100644 --- a/src/fs/otp.h +++ b/src/fs/otp.h @@ -46,12 +46,12 @@ extern int otp_write_data_raw(uint16_t row, const uint8_t *data, uint16_t len); #endif extern int otp_enable_secure_boot(uint8_t bootkey, bool secure_lock); -extern void init_otp_files(); +extern void init_otp_files(void); extern const uint8_t *otp_key_1; extern const uint8_t *otp_key_2; extern bool otp_is_secure_boot_enabled(uint8_t *bootkey); -extern bool otp_is_secure_boot_locked(); +extern bool otp_is_secure_boot_locked(void); #endif // _OTP_H_ diff --git a/src/main.c b/src/main.c index 064e622..59686eb 100644 --- a/src/main.c +++ b/src/main.c @@ -47,7 +47,7 @@ extern void do_flash(); extern void low_flash_init(); -extern void init_otp_files(); +extern void init_otp_files(void); app_t apps[16]; uint8_t num_apps = 0; @@ -109,7 +109,7 @@ void execute_tasks(); static bool req_button_pending = false; -bool is_req_button_pending() { +bool is_req_button_pending(void) { return req_button_pending; } @@ -196,7 +196,7 @@ bool picok_board_button_read(void) { bool button_pressed_state = false; uint32_t button_pressed_time = 0; uint8_t button_press = 0; -bool wait_button() { +bool wait_button(void) { /* Disabled by default. As LED may not be properly configured, it will not be possible to indicate button press unless it is commissioned. */ @@ -244,7 +244,7 @@ __attribute__((weak)) int picokey_init() { bool set_rtc = false; -bool has_set_rtc() { +bool has_set_rtc(void) { return set_rtc; } @@ -259,7 +259,7 @@ void set_rtc_time(time_t t) { set_rtc = true; } -time_t get_rtc_time() { +time_t get_rtc_time(void) { #ifdef PICO_PLATFORM struct timespec tv; aon_timer_get_time(&tv); diff --git a/src/pico_keys.h b/src/pico_keys.h index d9e6bfa..e6df169 100644 --- a/src/pico_keys.h +++ b/src/pico_keys.h @@ -70,9 +70,9 @@ #include #endif -extern bool wait_button(); +extern bool wait_button(void); -extern void low_flash_init_core1(); +extern void low_flash_init_core1(void); static inline uint16_t make_uint16_t_be(uint8_t b1, uint8_t b2) { return (b1 << 8) | b2; @@ -159,12 +159,12 @@ static inline uint32_t put_uint64_t_le(uint64_t n, uint8_t *b) { return 8; } -extern void low_flash_available(); +extern void low_flash_available(void); extern int flash_clear_file(file_t *file); extern int (*button_pressed_cb)(uint8_t); -extern bool is_req_button_pending(); +extern bool is_req_button_pending(void); #define SW_BYTES_REMAINING_00() set_res_sw(0x61, 0x00) #define SW_WARNING_STATE_UNCHANGED() set_res_sw(0x62, 0x00) @@ -251,8 +251,8 @@ extern uint8_t pico_serial_hash[32]; #define multicore_launch_func_core1(a) multicore_launch_core1((void (*) (void))a) #endif -extern bool has_set_rtc(); -extern time_t get_rtc_time(); +extern bool has_set_rtc(void); +extern time_t get_rtc_time(void); extern void set_rtc_time(time_t tv_sec); #endif