64f9e34fc3
Complete working firmware including: - CMakeLists.txt for Pico SDK build - SSD1306 OLED driver (128x32, I2C) - High-resolution latency measurement using hardware timer - Debounced button with short/long press detection - Three modes: Single, Continuous, Stats - USB serial debugging output Includes 8x8 font with numbers and letters for display.
42 lines
816 B
CMake
42 lines
816 B
CMake
cmake_minimum_required(VERSION 3.13)
|
|
|
|
# Initialize pico-sdk from installed location
|
|
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
|
|
|
|
project(sn_l00 C CXX ASM)
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
pico_sdk_init()
|
|
|
|
add_executable(sn_l00
|
|
src/main.c
|
|
src/display.c
|
|
src/latency.c
|
|
src/button.c
|
|
)
|
|
|
|
# Use RP2040-Zero pin definitions
|
|
target_compile_definitions(sn_l00 PRIVATE
|
|
PICO_DEFAULT_I2C=0
|
|
PICO_DEFAULT_I2C_SDA_PIN=0
|
|
PICO_DEFAULT_I2C_SCL_PIN=1
|
|
)
|
|
|
|
target_include_directories(sn_l00 PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
)
|
|
|
|
target_link_libraries(sn_l00
|
|
pico_stdlib
|
|
hardware_i2c
|
|
hardware_timer
|
|
hardware_gpio
|
|
)
|
|
|
|
# Enable USB serial for debugging
|
|
pico_enable_stdio_usb(sn_l00 1)
|
|
pico_enable_stdio_uart(sn_l00 0)
|
|
|
|
pico_add_extra_outputs(sn_l00)
|