Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/cyw43_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
#ifndef CYW43_INCLUDED_CYW43_INTERNAL_H
#define CYW43_INCLUDED_CYW43_INTERNAL_H

#include "cyw43_ll.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (cyw43_internal.h) is not a public header, so I don't think it needs anything added to it.


#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>

#define BUS_FUNCTION (0)
#define BACKPLANE_FUNCTION (1)
#define WLAN_FUNCTION (2)
Expand Down
4 changes: 4 additions & 0 deletions src/cyw43_sdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#ifndef CYW43_INCLUDED_CYW43_SDIO_H
#define CYW43_INCLUDED_CYW43_SDIO_H

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we sort these alphabetically by file name?


// These must be provided by a port, if the SDIO bus interface is used.
void cyw43_sdio_init(void);
void cyw43_sdio_reinit(void);
Expand Down
5 changes: 5 additions & 0 deletions src/cyw43_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
#ifndef CYW43_INCLUDED_CYW43_SPI_H
#define CYW43_INCLUDED_CYW43_SPI_H

#include "cyw43_internal.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange that a public header needs to include an internal header... need to think about this some more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange that a public header needs to include an internal header... need to think about this some more.

Agreed. The supposedly internal cyw43_int_t in the supposedly public API makes for a visibilty mismatch.

I'll handle the other remarks in the meantime.


#include <stdint.h>
#include <stddef.h>

// Test register value
#define TEST_PATTERN 0xFEEDBEADu

Expand Down
24 changes: 23 additions & 1 deletion tests/sdio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,32 @@ $(OBJ): | $(OBJ_DIRS)
$(OBJ_DIRS):
$(MKDIR) -p $@

# "Include-what-you-use"-test compilation for public headers
PUBLIC_HEADER := \
src/cyw43.h \
src/cyw43_btbus.h \
src/cyw43_country.h \
src/cyw43_sdio.h \
src/cyw43_spi.h \
src/cyw43_stats.h \

vpath %.h . $(CYW43_TOP)

PUBLIC_HEADER_GCH := $(patsubst %,$(BUILD)/%.gch,$(PUBLIC_HEADER))

# Static pattern rule testing header compilation by making a pre-compiled header of each
$(PUBLIC_HEADER_GCH): $(BUILD)/%.h.gch: %.h
# Pass -Wno-pedantic to suppress "empty translation unit" errors
$(CC) $(CFLAGS) -Wno-pedantic -c $< -o $@

# Add to phony test target trigger
test: $(PUBLIC_HEADER_GCH)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this header test (pre-compiled headers) to a completely separate test? Eg tests/headers/?


# Dependency generation
%.o: %.d
%.gch: %.d
CFLAGS += -MP -MMD
DEP := $(OBJ:.o=.d)
DEP := $(OBJ:.o=.d) $(PUBLIC_HEADER_GCH:.gch=.d)
$(DEP):

-include $(DEP)