Skip to content

Commit

Permalink
TEMPORARY - DROP Improved stm32 GPIO driver
Browse files Browse the repository at this point in the history
TEMPORARY: SUBMITTED IN atomvm#836.
Complete rewrite of the stm32 gpio driver using updated APIs.

Signed-off-by: Winford <winford@object.stream>
  • Loading branch information
UncleGrumpy committed Oct 4, 2023
1 parent b182647 commit d0da4ea
Show file tree
Hide file tree
Showing 9 changed files with 717 additions and 241 deletions.
10 changes: 10 additions & 0 deletions src/platforms/stm32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ option(AVM_NEWLIB_NANO "Use 'nano' newlib. Saves 46kB, no `long long` support" O
option(AVM_LOG_DISABLE "Disable log output" OFF)
option(AVM_ENABLE_LOG_COLOR "Use color log output" OFF)
option(AVM_ENABLE_LOG_LINES "Include source and line info for all enbled levels" OFF)
option(AVM_DISABLE_GPIO_NIFS "Disable GPIO nifs (input and output)" OFF)
option(AVM_DISABLE_GPIO_PORT_DRIVER "Disable GPIO 'port' driver (input, output, and interrupts)" OFF)

set(AVM_DISABLE_SMP ON FORCE)

Expand Down Expand Up @@ -59,6 +61,14 @@ if (AVM_ENABLE_LOG_LINES)
add_compile_definitions(ENABLE_LOG_LINE_INFO)
endif()

# Configure Drivers
if (AVM_DISABLE_GPIO_NIFS)
add_compile_definitions(AVM_DISABLE_GPIO_NIFS)
endif()
if (AVM_DISABLE_GPIO_PORT_DRIVER)
add_compile_definitions(AVM_DISABLE_GPIO_PORT_DRIVER)
endif()

# Include an error in case the user forgets to specify ARM as a toolchain
if (NOT CMAKE_TOOLCHAIN_FILE)
message(FATAL_ERROR "Cross compiling only. Please use -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake or use\
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/stm32/src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ project (libAtomVMPlatformSTM32)

set(HEADER_FILES
avm_log.h
gpiodriver.h
gpio_driver.h
platform_defaultatoms.h
stm_sys.h
../../../../libAtomVM/platform_nifs.h
../../../../libAtomVM/sys.h
)

set(SOURCE_FILES
gpiodriver.c
gpio_driver.c
platform_defaultatoms.c
platform_nifs.c
sys.c
Expand Down
Loading

0 comments on commit d0da4ea

Please sign in to comment.