Skip to content

Commit c9475ad

Browse files
committed
Enable -Werror=missing-prototypes on espressif port
1 parent 621953c commit c9475ad

File tree

28 files changed

+38
-25
lines changed

28 files changed

+38
-25
lines changed

ports/espressif/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ endif
150150
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
151151
CFLAGS += $(OPTIMIZATION_FLAGS)
152152

153-
CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT)
153+
CFLAGS += $(INC) -Werror -Wall -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes
154154

155155
ifeq ($(IDF_TARGET_ARCH),xtensa)
156156
CFLAGS += -mlongcalls

ports/espressif/background.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "py/runtime.h"
2828
#include "supervisor/filesystem.h"
29+
#include "supervisor/port.h"
2930
#include "supervisor/shared/stack.h"
3031

3132
#include "freertos/FreeRTOS.h"

ports/espressif/bindings/espidf/__init__.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,7 @@ STATIC mp_obj_t espidf_erase_nvs(void) {
8282
MP_DEFINE_CONST_FUN_OBJ_0(espidf_erase_nvs_obj, espidf_erase_nvs);
8383

8484

85-
//| class IDFError(OSError):
86-
//| """Raised for certain generic ESP IDF errors."""
87-
//| ...
88-
//|
89-
NORETURN void mp_raise_espidf_IDFError(void) {
90-
nlr_raise(mp_obj_new_exception(&mp_type_espidf_IDFError));
91-
}
92-
93-
void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
85+
STATIC void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
9486
mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS;
9587
bool is_subclass = kind & PRINT_EXC_SUBCLASS;
9688
if (!is_subclass && (k == PRINT_EXC)) {

ports/espressif/cam.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef struct {
6969

7070
static cam_obj_t *cam_obj = NULL;
7171

72-
void IRAM_ATTR cam_isr(void *arg) {
72+
static void IRAM_ATTR cam_isr(void *arg) {
7373
cam_event_t cam_event = {0};
7474
BaseType_t HPTaskAwoken = pdFALSE;
7575
typeof(I2S0.int_st) int_st = I2S0.int_st;
@@ -85,7 +85,7 @@ void IRAM_ATTR cam_isr(void *arg) {
8585
}
8686
}
8787

88-
void IRAM_ATTR cam_vsync_isr(void *arg) {
88+
static void IRAM_ATTR cam_vsync_isr(void *arg) {
8989
cam_event_t cam_event = {0};
9090
BaseType_t HPTaskAwoken = pdFALSE;
9191
/*!< filter */
@@ -392,7 +392,7 @@ void cam_give(uint8_t *buffer) {
392392
}
393393
}
394394

395-
void cam_dma_config(const cam_config_t *config) {
395+
static void cam_dma_config(const cam_config_t *config) {
396396
int cnt = 0;
397397

398398
if (config->mode.jpeg) {

ports/espressif/common-hal/alarm/SleepMemory.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "py/runtime.h"
3131
#include "common-hal/alarm/SleepMemory.h"
32+
#include "shared-bindings/alarm/SleepMemory.h"
3233

3334
#include "esp_log.h"
3435
#include "esp_sleep.h"

ports/espressif/common-hal/alarm/pin/PinAlarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ gpio_isr_handle_t gpio_interrupt_handle;
7272
// Low and high are relative to pin number. 32+ is high. <32 is low.
7373
static volatile uint32_t pin_31_0_status = 0;
7474
static volatile uint32_t pin_63_32_status = 0;
75-
void gpio_interrupt(void *arg) {
75+
STATIC void gpio_interrupt(void *arg) {
7676
(void)arg;
7777

7878
gpio_ll_get_intr_status(&GPIO, xPortGetCoreID(), (uint32_t *)&pin_31_0_status);

ports/espressif/common-hal/alarm/time/TimeAlarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ esp_timer_handle_t pretend_sleep_timer;
6363
STATIC bool woke_up = false;
6464

6565
// This is run in the timer task. We use it to wake the main CircuitPython task.
66-
void timer_callback(void *arg) {
66+
STATIC void timer_callback(void *arg) {
6767
(void)arg;
6868
woke_up = true;
6969
xTaskNotifyGive(circuitpython_task);

ports/espressif/common-hal/alarm/touch/TouchAlarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) {
7575
}
7676

7777
// This is used to wake the main CircuitPython task.
78-
void touch_interrupt(void *arg) {
78+
STATIC void touch_interrupt(void *arg) {
7979
(void)arg;
8080
woke_up = true;
8181
BaseType_t task_wakeup;

ports/espressif/common-hal/analogio/AnalogIn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626

2727
#include "common-hal/analogio/AnalogIn.h"
28+
#include "shared-bindings/analogio/AnalogIn.h"
2829
#include "py/mperrno.h"
2930
#include "py/runtime.h"
3031
#include "supervisor/shared/translate.h"

ports/espressif/common-hal/canio/CAN.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
STATIC bool reserved_can;
4040

41-
twai_timing_config_t get_t_config(int baudrate) {
41+
STATIC twai_timing_config_t get_t_config(int baudrate) {
4242
switch (baudrate) {
4343
case 1000000: {
4444
// TWAI_TIMING_CONFIG_abc expands to a C designated initializer list
@@ -204,7 +204,7 @@ static void can_restart(void) {
204204
} while (port_get_raw_ticks(NULL) < deadline && (info.state == TWAI_STATE_BUS_OFF || info.state == TWAI_STATE_RECOVERING));
205205
}
206206

207-
void canio_maybe_auto_restart(canio_can_obj_t *self) {
207+
STATIC void canio_maybe_auto_restart(canio_can_obj_t *self) {
208208
if (self->auto_restart) {
209209
can_restart();
210210
}

0 commit comments

Comments
 (0)