Skip to content

Commit ef2b637

Browse files
authored
Merge pull request micropython#5582 from jepler/mimxrt10xx-prototypes
Mimxrt10xx: enable -Werror=missing-prototypes
2 parents 18b3e6c + edeb31f commit ef2b637

File tree

18 files changed

+38
-11
lines changed

18 files changed

+38
-11
lines changed

ports/mimxrt10xx/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ else
9292
#CFLAGS += -flto -flto-partition=none
9393
endif
9494

95-
CFLAGS += $(INC) -ggdb -Wall -Wno-cast-align -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
95+
CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes
9696

9797
# TODO: add these when -Werror is applied
9898
# Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align
@@ -148,7 +148,7 @@ SRC_SDK := \
148148
system_$(CHIP_FAMILY).c \
149149

150150
SRC_SDK := $(addprefix sdk/devices/$(CHIP_FAMILY)/, $(SRC_SDK))
151-
$(addprefix $(BUILD)/, $(SRC_SDK:.c=.o)): CFLAGS += -Wno-undef
151+
$(addprefix $(BUILD)/, $(SRC_SDK:.c=.o)): CFLAGS += -Wno-undef -Wno-missing-prototypes -Wno-cast-align
152152

153153
SRC_C += \
154154
background.c \

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

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

2828
#include "common-hal/analogio/AnalogIn.h"
29+
#include "shared-bindings/analogio/AnalogIn.h"
2930
#include "shared-bindings/microcontroller/Pin.h"
3031

3132
#include <string.h>

ports/mimxrt10xx/common-hal/busio/I2C.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ typedef struct {
4141
const mcu_periph_obj_t *sda;
4242
} busio_i2c_obj_t;
4343

44+
void i2c_reset(void);
45+
4446
#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_I2C_H

ports/mimxrt10xx/common-hal/busio/UART.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void config_periph_pin(const mcu_periph_obj_t *periph) {
6565
| IOMUXC_SW_PAD_CTL_PAD_SRE(0));
6666
}
6767

68-
void LPUART_UserCallback(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *user_data) {
68+
STATIC void LPUART_UserCallback(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *user_data) {
6969
busio_uart_obj_t *self = (busio_uart_obj_t *)user_data;
7070

7171
if (status == kStatus_LPUART_RxIdle) {

ports/mimxrt10xx/common-hal/busio/UART.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ typedef struct {
5151
const mcu_periph_obj_t *rts;
5252
} busio_uart_obj_t;
5353

54+
void uart_reset(void);
5455
#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_UART_H

ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U
4242

43-
void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) {
43+
STATIC void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) {
4444
IOMUXC_SetPinConfig(0, 0, 0, 0, pin->cfg_reg,
4545
IOMUXC_SW_PAD_CTL_PAD_HYS(1)
4646
| IOMUXC_SW_PAD_CTL_PAD_PUS((pull == PULL_UP) ? 2 : 0)

ports/mimxrt10xx/common-hal/microcontroller/Processor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <math.h>
2929

3030
#include "common-hal/microcontroller/Processor.h"
31+
#include "shared-bindings/microcontroller/Processor.h"
3132
#include "shared-bindings/microcontroller/ResetReason.h"
3233

3334
#include "fsl_tempmon.h"

ports/mimxrt10xx/common-hal/os/__init__.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "py/objtuple.h"
3232
#include "py/qstr.h"
3333

34+
#include "shared-bindings/os/__init__.h"
35+
3436
#include "fsl_trng.h"
3537

3638
STATIC const qstr os_uname_info_fields[] = {
@@ -58,7 +60,7 @@ mp_obj_t common_hal_os_uname(void) {
5860
return (mp_obj_t)&os_uname_info_obj;
5961
}
6062

61-
bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
63+
bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
6264
trng_config_t trngConfig;
6365

6466
TRNG_GetDefaultConfig(&trngConfig);

ports/mimxrt10xx/common-hal/rtc/RTC.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "py/runtime.h"
3232
#include "shared/timeutils/timeutils.h"
3333
#include "shared-bindings/rtc/__init__.h"
34+
#include "shared-bindings/rtc/RTC.h"
35+
#include "common-hal/rtc/RTC.h"
3436
#include "supervisor/shared/translate.h"
3537

3638
#include "fsl_snvs_hp.h"

ports/mimxrt10xx/mphalport.c

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

28+
#include "py/mphal.h"
2829
#include "py/mpstate.h"
2930
#include "py/smallint.h"
3031

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy