Git Product home page Git Product logo

Comments (1)

nicoverduin avatar nicoverduin commented on September 13, 2024

Seems like the linker just wants to add everything into the flash. Now I just made a link to the csrc folder and added the files in my CMakeLists.txt and it compiles fine. Now the programs are reduce to something like 50+ kbytes

My CMakeLists.xt
`# @file CmakeLists.txt

@brief used to generate the correct makefiles including ucglib

@author Nico Verduin

@Date 22-2-2023

if we use ucglib update the variable below with correct path

set (UCGLIB "../ucglib/csrc/")

give the project the root folder name

cmake_path(GET CMAKE_CURRENT_SOURCE_DIR FILENAME PROJECT_NAME)
string(REPLACE " " "_" ProjectId ${PROJECT_NAME})
project(${PROJECT_NAME})

let's get all the sources

set(PROJECT_SOURCE_DIRS "*.c *.h")

if we use UCG lib add its folders as well

if (DEFINED UCGLIB)
# add UCGLIB sources
set(PROJECT_SOURCE_DIRS ${PROJECT_SOURCE_DIRS} ${UCGLIB}.c ${UCGLIB}.h)
# search in folder
include_directories(${UCGLIB})
endif()

get all the sources and includes from current project dir and UCGLIB

file(GLOB PROJECT_SRC CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIRS})

set dependencies for our firmware

add_executable(${PROJECT_NAME}
main.c
${PROJECT_SRC}
)

enable usb output, disable uart output

pico_enable_stdio_usb(${PROJECT_NAME} 1)
pico_enable_stdio_uart(${PROJECT_NAME} 0)

pull in common dependencies and additional spi hardware support

target_link_libraries(${PROJECT_NAME} pico_stdlib hardware_spi hardware_gpio)

create map/bin/hex file etc.

pico_add_extra_outputs(${PROJECT_NAME})

add url via pico_set_program_url

example_auto_set_url(${PROJECT_NAME})

`

from ucglib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.