Enable -Werror=missing-prototypes on espressif port

This commit is contained in:
Jeff Epler 2021-11-10 11:07:45 -06:00
parent 621953c960
commit c9475adb00
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
28 changed files with 38 additions and 25 deletions

View File

@ -150,7 +150,7 @@ endif
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
CFLAGS += $(OPTIMIZATION_FLAGS)
CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT)
CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes
ifeq ($(IDF_TARGET_ARCH),xtensa)
CFLAGS += -mlongcalls

View File

@ -26,6 +26,7 @@
#include "py/runtime.h"
#include "supervisor/filesystem.h"
#include "supervisor/port.h"
#include "supervisor/shared/stack.h"
#include "freertos/FreeRTOS.h"

View File

@ -82,15 +82,7 @@ STATIC mp_obj_t espidf_erase_nvs(void) {
MP_DEFINE_CONST_FUN_OBJ_0(espidf_erase_nvs_obj, espidf_erase_nvs);
//| class IDFError(OSError):
//| """Raised for certain generic ESP IDF errors."""
//| ...
//|
NORETURN void mp_raise_espidf_IDFError(void) {
nlr_raise(mp_obj_new_exception(&mp_type_espidf_IDFError));
}
void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
STATIC void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS;
bool is_subclass = kind & PRINT_EXC_SUBCLASS;
if (!is_subclass && (k == PRINT_EXC)) {

View File

@ -69,7 +69,7 @@ typedef struct {
static cam_obj_t *cam_obj = NULL;
void IRAM_ATTR cam_isr(void *arg) {
static void IRAM_ATTR cam_isr(void *arg) {
cam_event_t cam_event = {0};
BaseType_t HPTaskAwoken = pdFALSE;
typeof(I2S0.int_st) int_st = I2S0.int_st;
@ -85,7 +85,7 @@ void IRAM_ATTR cam_isr(void *arg) {
}
}
void IRAM_ATTR cam_vsync_isr(void *arg) {
static void IRAM_ATTR cam_vsync_isr(void *arg) {
cam_event_t cam_event = {0};
BaseType_t HPTaskAwoken = pdFALSE;
/*!< filter */
@ -392,7 +392,7 @@ void cam_give(uint8_t *buffer) {
}
}
void cam_dma_config(const cam_config_t *config) {
static void cam_dma_config(const cam_config_t *config) {
int cnt = 0;
if (config->mode.jpeg) {

View File

@ -29,6 +29,7 @@
#include "py/runtime.h"
#include "common-hal/alarm/SleepMemory.h"
#include "shared-bindings/alarm/SleepMemory.h"
#include "esp_log.h"
#include "esp_sleep.h"

View File

@ -72,7 +72,7 @@ gpio_isr_handle_t gpio_interrupt_handle;
// Low and high are relative to pin number. 32+ is high. <32 is low.
static volatile uint32_t pin_31_0_status = 0;
static volatile uint32_t pin_63_32_status = 0;
void gpio_interrupt(void *arg) {
STATIC void gpio_interrupt(void *arg) {
(void)arg;
gpio_ll_get_intr_status(&GPIO, xPortGetCoreID(), (uint32_t *)&pin_31_0_status);

View File

@ -63,7 +63,7 @@ esp_timer_handle_t pretend_sleep_timer;
STATIC bool woke_up = false;
// This is run in the timer task. We use it to wake the main CircuitPython task.
void timer_callback(void *arg) {
STATIC void timer_callback(void *arg) {
(void)arg;
woke_up = true;
xTaskNotifyGive(circuitpython_task);

View File

@ -75,7 +75,7 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) {
}
// This is used to wake the main CircuitPython task.
void touch_interrupt(void *arg) {
STATIC void touch_interrupt(void *arg) {
(void)arg;
woke_up = true;
BaseType_t task_wakeup;

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/analogio/AnalogIn.h"
#include "shared-bindings/analogio/AnalogIn.h"
#include "py/mperrno.h"
#include "py/runtime.h"
#include "supervisor/shared/translate.h"

View File

@ -38,7 +38,7 @@
STATIC bool reserved_can;
twai_timing_config_t get_t_config(int baudrate) {
STATIC twai_timing_config_t get_t_config(int baudrate) {
switch (baudrate) {
case 1000000: {
// TWAI_TIMING_CONFIG_abc expands to a C designated initializer list
@ -204,7 +204,7 @@ static void can_restart(void) {
} while (port_get_raw_ticks(NULL) < deadline && (info.state == TWAI_STATE_BUS_OFF || info.state == TWAI_STATE_RECOVERING));
}
void canio_maybe_auto_restart(canio_can_obj_t *self) {
STATIC void canio_maybe_auto_restart(canio_can_obj_t *self) {
if (self->auto_restart) {
can_restart();
}

View File

@ -78,7 +78,7 @@ STATIC void install_all_match_filter(canio_listener_obj_t *self) {
}
__attribute__((noinline,optimize("O0")))
void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) {
STATIC void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) {
twai_ll_enter_reset_mode(&TWAI);
if (!nmatch) {

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/countio/Counter.h"
#include "shared-bindings/countio/Counter.h"
#include "common-hal/microcontroller/Pin.h"
#include "py/runtime.h"

View File

@ -31,6 +31,7 @@
#include "py/runtime.h"
#include "common-hal/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h"
#include "supervisor/shared/translate.h"

View File

@ -27,13 +27,14 @@
#include <string.h>
#include "common-hal/nvm/ByteArray.h"
#include "shared-bindings/nvm/ByteArray.h"
#include "bindings/espidf/__init__.h"
#include "py/runtime.h"
#include "py/gc.h"
#include "nvs_flash.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;
}
@ -75,7 +76,7 @@ static esp_err_t get_bytes(nvs_handle_t handle, uint8_t **buf_out) {
return result;
}
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) {
// start nvs
@ -122,7 +123,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) {
// start nvs

View File

@ -30,6 +30,8 @@
#include "py/objtuple.h"
#include "py/qstr.h"
#include "shared-bindings/os/__init__.h"
#include "esp_system.h"
STATIC const qstr os_uname_info_fields[] = {

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/ps2io/Ps2.h"
#include "shared-bindings/ps2io/Ps2.h"
#include "supervisor/port.h"
#include "shared-bindings/microcontroller/__init__.h"

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/pulseio/PulseIn.h"
#include "shared-bindings/pulseio/PulseIn.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "py/runtime.h"

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/pulseio/PulseOut.h"
#include "shared-bindings/pulseio/PulseOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "py/runtime.h"

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/rotaryio/IncrementalEncoder.h"
#include "shared-bindings/rotaryio/IncrementalEncoder.h"
#include "common-hal/microcontroller/Pin.h"
#include "py/runtime.h"

View File

@ -24,6 +24,7 @@
* THE SOFTWARE.
*/
#include "shared-bindings/ssl/__init__.h"
#include "shared-bindings/ssl/SSLContext.h"
#include "components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h"

View File

@ -32,6 +32,7 @@
#include "esp_task_wdt.h"
extern void esp_task_wdt_isr_user_handler(void);
void esp_task_wdt_isr_user_handler(void) {
mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception));
MP_STATE_THREAD(mp_pending_exception) = &mp_watchdog_timeout_exception;

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/wifi/__init__.h"
#include "shared-bindings/wifi/__init__.h"
#include "shared-bindings/ipaddress/IPv4Address.h"
#include "shared-bindings/wifi/Radio.h"

View File

@ -39,6 +39,8 @@
#include "components/esp_rom/include/esp32s2/rom/ets_sys.h"
#endif
#include "supervisor/cpu.h"
void mp_hal_delay_us(mp_uint_t delay) {
ets_delay_us(delay);
}
@ -48,7 +50,7 @@ void mp_hal_delay_us(mp_uint_t delay) {
extern void xthal_window_spill(void);
#endif
mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs, uint8_t reg_count) {
mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) {
// xtensa has more registers than an instruction can address. The 16 that
// can be addressed are called the "window". When a function is called or
// returns the window rotates. This allows for more efficient function calls

View File

@ -39,6 +39,7 @@
#include "components/spi_flash/include/esp_partition.h"
#include "supervisor/flash.h"
#include "supervisor/usb.h"
STATIC const esp_partition_t *_partition;

View File

@ -93,7 +93,7 @@ TaskHandle_t circuitpython_task = NULL;
extern void esp_restart(void) NORETURN;
void tick_timer_cb(void *arg) {
STATIC void tick_timer_cb(void *arg) {
supervisor_tick();
// CircuitPython's VM is run in a separate FreeRTOS task from timer callbacks. So, we have to
@ -360,6 +360,7 @@ void port_idle_until_interrupt(void) {
// Wrap main in app_main that the IDF expects.
extern void main(void);
extern void app_main(void);
void app_main(void) {
main();
}

View File

@ -62,7 +62,7 @@ StaticTask_t usb_device_taskdef;
// USB Device Driver task
// This top level thread process all usb events and invoke callbacks
void usb_device_task(void *param) {
STATIC void usb_device_task(void *param) {
(void)param;
// RTOS forever loop

View File

@ -25,6 +25,7 @@
*/
#include "shared-module/canio/Match.h"
#include "shared-bindings/canio/Match.h"
void common_hal_canio_match_construct(canio_match_obj_t *self, int id, int mask, bool extended) {
self->id = id;

View File

@ -25,6 +25,7 @@
*/
#include "shared-module/canio/Message.h"
#include "shared-bindings/canio/Message.h"
#include <string.h>