Skip to content

Commit

Permalink
Merge pull request #7470 from microdev1/espnow
Browse files Browse the repository at this point in the history
Add ESP-NOW Support
  • Loading branch information
dhalbert authored Mar 10, 2023
2 parents 3c92f59 + 58f28b9 commit b6a7613
Show file tree
Hide file tree
Showing 27 changed files with 1,535 additions and 136 deletions.
30 changes: 15 additions & 15 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ msgstr ""
msgid "%q init failed"
msgstr ""

#: shared-bindings/dualbank/__init__.c
#: ports/espressif/bindings/espnow/Peer.c shared-bindings/dualbank/__init__.c
msgid "%q is %q"
msgstr ""

Expand Down Expand Up @@ -242,7 +242,7 @@ msgstr ""
msgid "%q=%q"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
#, c-format
msgid "%s error 0x%x"
msgstr ""
Expand Down Expand Up @@ -510,6 +510,7 @@ msgstr ""
msgid "Already have all-matches listener"
msgstr ""

#: ports/espressif/bindings/espnow/ESPNow.c
#: ports/espressif/common-hal/espulp/ULP.c
#: shared-module/memorymonitor/AllocationAlarm.c
#: shared-module/memorymonitor/AllocationSize.c
Expand Down Expand Up @@ -681,7 +682,7 @@ msgstr ""
msgid "CIRCUITPY drive could not be found or created."
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "CRC or checksum was invalid"
msgstr ""

Expand Down Expand Up @@ -1072,7 +1073,7 @@ msgstr ""
msgid "GNSS init"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Generic Failure"
msgstr ""

Expand Down Expand Up @@ -1255,8 +1256,7 @@ msgstr ""
msgid "Invalid MAC address"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c
#: ports/espressif/common-hal/espidf/__init__.c py/moduerrno.c
msgid "Invalid argument"
msgstr ""

Expand All @@ -1282,7 +1282,7 @@ msgstr ""
msgid "Invalid multicast MAC address"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Invalid size"
msgstr ""

Expand All @@ -1291,7 +1291,7 @@ msgstr ""
msgid "Invalid socket for TLS"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Invalid state"
msgstr ""

Expand Down Expand Up @@ -1323,7 +1323,7 @@ msgstr ""
msgid "Layer must be a Group or TileGrid subclass"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "MAC address was invalid"
msgstr ""

Expand Down Expand Up @@ -1679,19 +1679,19 @@ msgstr ""
msgid "Operation not permitted"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Operation or feature not supported"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Operation timed out"
msgstr ""

#: ports/raspberrypi/common-hal/mdns/Server.c
msgid "Out of MDNS service slots"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Out of memory"
msgstr ""

Expand Down Expand Up @@ -1867,7 +1867,7 @@ msgstr ""
msgid "Read-only filesystem"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Received response was invalid"
msgstr ""

Expand All @@ -1887,7 +1887,7 @@ msgstr ""
msgid "Requested AES mode is unsupported"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Requested resource not found"
msgstr ""

Expand Down Expand Up @@ -2338,7 +2338,7 @@ msgstr ""
msgid "Value length > max_length"
msgstr ""

#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c
#: ports/espressif/common-hal/espidf/__init__.c
msgid "Version was invalid"
msgstr ""

Expand Down
23 changes: 19 additions & 4 deletions ports/espressif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ ifeq ($(DEBUG), 1)
# CFLAGS += -fno-inline -fno-ipa-sra
else
CFLAGS += -DNDEBUG -ggdb3
OPTIMIZATION_FLAGS ?= -O2
# RISC-V is larger than xtensa
# Use -Os for RISC-V when it overflows
ifeq ($(IDF_TARGET_ARCH),riscv)
OPTIMIZATION_FLAGS ?= -Os
else
OPTIMIZATION_FLAGS ?= -O2
endif
endif

# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
Expand Down Expand Up @@ -214,7 +218,6 @@ endif
SRC_C += \
background.c \
mphalport.c \
bindings/espidf/__init__.c \
boards/$(BOARD)/board.c \
boards/$(BOARD)/pins.c \
shared/netutils/netutils.c \
Expand Down Expand Up @@ -248,8 +251,6 @@ ifneq ($(CIRCUITPY_BLEIO),0)
SRC_C += common-hal/_bleio/ble_events.c
endif

SRC_C += $(wildcard common-hal/espidf/*.c)

ifneq ($(CIRCUITPY_ESPCAMERA),0)
SRC_CAMERA := \
$(wildcard common-hal/espcamera/*.c) \
Expand All @@ -259,6 +260,20 @@ CFLAGS += -isystem esp32-camera/driver/include
CFLAGS += -isystem esp32-camera/conversions/include
endif

ifneq ($(CIRCUITPY_ESPIDF),0)
SRC_ESPIDF := \
$(wildcard common-hal/espidf/*.c) \
$(wildcard bindings/espidf/*.c)
SRC_C += $(SRC_ESPIDF)
endif

ifneq ($(CIRCUITPY_ESPNOW),0)
SRC_ESPNOW := \
$(wildcard common-hal/espnow/*.c) \
$(wildcard bindings/espnow/*.c)
SRC_C += $(SRC_ESPNOW)
endif

ifneq ($(CIRCUITPY_ESPULP),0)
SRC_ULP := \
$(wildcard common-hal/espulp/*.c) \
Expand Down
Loading

0 comments on commit b6a7613

Please sign in to comment.