Skip to content
Permalink
Browse files

Lib/MicroPython: Added I2C Support

  • Loading branch information...
oliviermartin committed Feb 25, 2017
1 parent 3610d5e commit b1745045137f66b702c58f0d1fdf706882e8e2ae
@@ -27,5 +27,9 @@
# Heap for MicroPython Garbage collector # Heap for MicroPython Garbage collector
set(FIRMWARE_HEAP 0x2000) set(FIRMWARE_HEAP 0x2000)


if (BOARD STREQUAL "Nordic/nRF52DK")
set(SUPPORT_I2C 1)
endif()

# List of modules needed by the application # List of modules needed by the application
set(LIST_MODULES CMSIS Lib/PolyMCU Lib/MicroPython) set(LIST_MODULES CMSIS Lib/PolyMCU Lib/MicroPython)
@@ -50,6 +50,10 @@ if (BOARD MATCHES "Nordic/")
list(APPEND micropython_lib_SRCS board/nordic/pin.c board/nordic/nRF52_pins.c board/nordic/pin_named_pins.c) list(APPEND micropython_lib_SRCS board/nordic/pin.c board/nordic/nRF52_pins.c board/nordic/pin_named_pins.c)
endif() endif()


if (SUPPORT_I2C)
list(APPEND micropython_lib_SRCS i2c.c)
endif()

if(NOT IS_DIRECTORY ${MICROPYTHON_SRC_DIR}) if(NOT IS_DIRECTORY ${MICROPYTHON_SRC_DIR})
include(ExternalProject) include(ExternalProject)


@@ -130,6 +134,7 @@ add_custom_command(OUTPUT ${MICROPYTHON_BUILD_DIR}/_frozen_mpy.c
list(APPEND micropython_lib_SRCS ${MICROPYTHON_SRC_DIR}/lib/utils/pyexec.c list(APPEND micropython_lib_SRCS ${MICROPYTHON_SRC_DIR}/lib/utils/pyexec.c
${MICROPYTHON_SRC_DIR}/lib/libc/string0.c ${MICROPYTHON_SRC_DIR}/lib/libc/string0.c
${MICROPYTHON_SRC_DIR}/lib/mp-readline/readline.c ${MICROPYTHON_SRC_DIR}/lib/mp-readline/readline.c
${MICROPYTHON_SRC_DIR}/stmhal/bufhelper.c
${MICROPYTHON_BUILD_DIR}/_frozen_mpy.c) ${MICROPYTHON_BUILD_DIR}/_frozen_mpy.c)


add_library(polymcu_micropython STATIC ${micropython_lib_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/libmicropython.a) add_library(polymcu_micropython STATIC ${micropython_lib_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/libmicropython.a)
@@ -33,4 +33,6 @@
#define PYB_LED_COUNT 4 #define PYB_LED_COUNT 4
#define PYB_LED_HAS_INTENSITY 0 #define PYB_LED_HAS_INTENSITY 0


#define PYB_I2C_COUNT 1

#endif #endif
Oops, something went wrong.

0 comments on commit b174504

Please sign in to comment.
You can’t perform that action at this time.