Skip to content

Commit adac5ee

Browse files
authored
Merge pull request #5563 from jepler/enable-error-missing-prototypes
Additional missing-prototypes fixes
2 parents a817a60 + cd6599c commit adac5ee

File tree

143 files changed

+252
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+252
-175
lines changed

devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c

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

3434
#include "shared-bindings/_bleio/__init__.h"
3535
#include "shared-bindings/_bleio/Connection.h"
36+
#include "shared-bindings/_bleio/CharacteristicBuffer.h"
3637
#include "supervisor/shared/tick.h"
3738
#include "common-hal/_bleio/CharacteristicBuffer.h"
3839

devices/ble_hci/common-hal/_bleio/Connection.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ typedef struct {
8585
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);
8686
mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection);
8787
bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle);
88+
void bleio_connection_clear(bleio_connection_internal_t *self);
8889

8990
#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H

devices/ble_hci/common-hal/_bleio/att.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// Derived from ArduinoBLE.
22
// Copyright 2020 Dan Halbert for Adafruit Industries
33

4+
// Some functions here are unused now, but may be used in the future.
5+
// Don't warn or error about this, and depend on the compiler & linker to
6+
// eliminate the associated code.
7+
#pragma GCC diagnostic ignored "-Wunused"
8+
#pragma GCC diagnostic ignored "-Wunused-function"
9+
410
/*
511
This file is part of the ArduinoBLE library.
612
Copyright (c) 2018 Arduino SA. All rights reserved.
@@ -857,7 +863,7 @@ STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
857863
}
858864
}
859865

860-
int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) {
866+
static int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) {
861867
struct __packed req {
862868
struct bt_att_hdr h;
863869
struct bt_att_find_info_req r;
@@ -925,7 +931,7 @@ STATIC void process_find_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
925931
}
926932
}
927933

928-
void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) {
934+
static void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) {
929935
struct bt_att_read_group_req *req = (struct bt_att_read_group_req *)data;
930936
uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8);
931937

@@ -1009,7 +1015,7 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui
10091015
}
10101016
}
10111017

1012-
int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) {
1018+
static int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) {
10131019

10141020
typedef struct __packed {
10151021
struct bt_att_hdr h;
@@ -1305,7 +1311,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
13051311
}
13061312
}
13071313

1308-
int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) {
1314+
static int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) {
13091315
typedef struct __packed {
13101316
struct bt_att_hdr h;
13111317
struct bt_att_read_type_req r;
@@ -1715,7 +1721,7 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
17151721
}
17161722

17171723
// FIX Do we need all of these?
1718-
void check_att_err(uint8_t err) {
1724+
static void check_att_err(uint8_t err) {
17191725
const compressed_string_t *msg = NULL;
17201726
switch (err) {
17211727
case 0:

ports/atmel-samd/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align -Wno
291291
endif
292292

293293
SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF))
294-
$(patsubst $(SRC_ASF),%.c,%.o): CFLAGS += -Wno-missing-prototypes
294+
$(patsubst %.c,$(BUILD)/%.o,$(SRC_ASF)): CFLAGS += -Wno-missing-prototypes
295295

296296
SRC_PERIPHERALS := \
297297
peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/adc.c \
@@ -310,7 +310,7 @@ SRC_PERIPHERALS := \
310310
peripherals/samd/sercom.c \
311311
peripherals/samd/timers.c \
312312

313-
$(patsubst $(SRC_PERIPHERALS),%.c,%.o): CFLAGS += -Wno-missing-prototypes
313+
$(patsubst %.c,$(BUILD)/%.o,$(SRC_PERIPHERALS)): CFLAGS += -Wno-missing-prototypes
314314

315315
SRC_C += \
316316
audio_dma.c \
@@ -328,6 +328,8 @@ SRC_C += \
328328
timer_handler.c \
329329
$(SRC_PERIPHERALS) \
330330

331+
$(BUILD)/lib/tinyusb/src/portable/microchip/samd/dcd_samd.o: CFLAGS += -Wno-missing-prototypes
332+
331333
# This is an OR because it filters to any 1s and then checks to see if it is not
332334
# empty.
333335
ifneq (,$(filter 1,$(CIRCUITPY_PWMIO) $(CIRCUITPY_AUDIOIO) $(CIRCUITPY_RGBMATRIX)))

ports/atmel-samd/boards/pewpew_m4/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef struct {
5050

5151
#define DELAY 0x80
5252

53-
uint32_t lookupCfg(uint32_t key, uint32_t defl) {
53+
STATIC uint32_t lookupCfg(uint32_t key, uint32_t defl) {
5454
const uint32_t *ptr = UF2_BINFO->config_data;
5555
if (!ptr || (((uint32_t)ptr) & 3) || *ptr != CFG_MAGIC0) {
5656
// no config data!

ports/atmel-samd/common-hal/alarm/SleepMemory.c

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

2929
#include "py/runtime.h"
3030
#include "common-hal/alarm/SleepMemory.h"
31+
#include "shared-bindings/alarm/SleepMemory.h"
3132
#include "shared-bindings/nvm/ByteArray.h"
3233

3334
void alarm_sleep_memory_reset(void) {

ports/atmel-samd/common-hal/audiobusio/PDMIn.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,3 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se
485485

486486
return values_output;
487487
}
488-
489-
void common_hal_audiobusio_pdmin_record_to_file(audiobusio_pdmin_obj_t* self, uint8_t* buffer, uint32_t length) {
490-
}

ports/atmel-samd/common-hal/busio/__init__.c

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

2727
#include "samd/sercom.h"
28+
#include "common-hal/busio/__init__.h"
2829

2930
static bool never_reset_sercoms[SERCOM_INST_NUM];
3031

ports/atmel-samd/common-hal/canio/Listener.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ STATIC void install_extended_filter(CanMramXidfe *extended, int id1, int id2, in
195195

196196

197197
#define NO_ID (-1)
198-
void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) {
198+
STATIC void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) {
199199
int fifo = self->fifo_idx;
200200

201201
if (!nmatch) {

ports/atmel-samd/common-hal/countio/Counter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#include "common-hal/countio/Counter.h"
3+
#include "shared-bindings/countio/Counter.h"
34

45
#include "atmel_start_pins.h"
56

0 commit comments

Comments
 (0)