Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4861

C/C++ • Re: Finding CLOCKS_PER_SEC

$
0
0
I can't help much as I don't have the time. I did plug "{auto x=CLOCKS_PER_SEC;}" just before the first xTaskCreate() in main(), into a FreeRTOS c++ project I was working on and it compiled, Note my freertos folder is timestamped back to "Nov 11 2022" but the pico-sdk is current. I updated pico-sdk yesterday because I rebuilt my QT dev environment to use xgcc 13.2.0 which falls foul of "<cstdint>" but that's another story. With those caveats out the way, here's the project file..

Code:

cmake_minimum_required(VERSION 3.13)#set(CMAKE_VERBOSE_MAKEFILE ON)#set(CMAKE_RULE_MESSAGES OFF)include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)include($ENV{PIMORONI_PICO_PATH}/pimoroni_pico_import.cmake)set(APP emon)project(${APP})add_compile_definitions(CYW43_HOST_NAME="${APP}"LWIP_DEBUG=1)pico_sdk_init()add_subdirectory($ENV{FREERTOS_KERNEL_PATH}/portable/ThirdParty/GCC/RP2040 FreeRTOS_Kernel)include(${PIMORONI_PICO_PATH}/libraries/pico_graphics/pico_graphics.cmake)include(${PIMORONI_PICO_PATH}/drivers/st7789/st7789.cmake)include(${PIMORONI_PICO_PATH}/drivers/bme68x/bme68x.cmake)include(${PIMORONI_PICO_PATH}/common/pimoroni_bus.cmake)include(${PIMORONI_PICO_PATH}/libraries/bitmap_fonts/bitmap_fonts.cmake)include(${PIMORONI_PICO_PATH}/libraries/hershey_fonts/hershey_fonts.cmake)include(${PIMORONI_PICO_PATH}/libraries/breakout_rtc/breakout_rtc.cmake)include(${PIMORONI_PICO_PATH}/drivers/rv3028/rv3028.cmake)include(${PIMORONI_PICO_PATH}/common/pimoroni_i2c.cmake)set(CLIB clib)file(GLOB CLIB_S "${CLIB}/*.c")file(GLOB CLIB_H "${CLIB}/*.h")add_library(${CLIB} STATIC ${CLIB_S} ${CLIB_H})target_compile_options(${CLIB} PRIVATE -DCLIB)target_link_libraries(${CLIB})set(CPPLIB cpplib)file(GLOB CPPLIB_S "${CPPLIB}/*.cpp")file(GLOB CPPLIB_H "${CPPLIB}/*.hpp")add_library(${CPPLIB} STATIC ${CPPLIB_S} ${CPPLIB_H})target_compile_options(${CPPLIB} PRIVATE -DCPPLIB)target_link_libraries(${CPPLIB})file(GLOB APP_S "${APP}/*.cpp" "${APP}/*.c")file(GLOB APP_H "${APP}/*.hpp" "${APP}/*.h" "*.h")add_executable(${APP} ${APP_S} ${APP_H} ${ULIB_S})target_compile_definitions(${APP} PRIVATE        NO_SYS=0)target_include_directories(${APP} PRIVATE    ${CMAKE_CURRENT_LIST_DIR})target_link_options(${APP} PRIVATE "LINKER:--no-warn-rwx-segments")target_link_libraries(${APP} ${CPPLIB} ${CLIB}    pico_stdlib    hardware_rtc    FreeRTOS-Kernel-Heap4    pico_cyw43_arch_lwip_sys_freertos#    pico_graphics st7789    breakout_rtc    bme68x)pico_add_extra_outputs(${APP})
..and the environment is sourced via a "~/.picorc" file containing this..

Code:

: ${PICO_BOARD:=pico_w}: ${PICO_SDK_PATH:=$HOME/usr/src/rpi/pico/pico-sdk}: ${PICO_EXTRAS_PATH:=$HOME/usr/src/rpi/pico/pico-extras}: ${PICO_EXAMPLES_PATH:=$HOME/usr/src/rpi/pico/pico-examples}: ${PICO_PLAYGROUND_PATH:=$HOME/usr/src/rpi/pico/pico-playground}export PICO_SDK_PATH PICO_EXTRAS_PATH PICO_EXAMPLES_PATH PICO_PLAYGROUND_PATHexport PICO_BOARDexport PATH=/usr/local/qt/xgcc/arm-none-eabi/bin:$PATH#export PICO_BOARD=pico_w#export PICO_BOARD=pico: ${FREERTOS_KERNEL_PATH:=$HOME/usr/src/rpi/pico/freertos/FreeRTOS-Kernel}export FREERTOS_KERNEL_PATH: ${PIMORONI_PICO_PATH:=$HOME/usr/src/rpi/pico/pimoroni-pico}export PIMORONI_PICO_PATH
Something in one of the above must have pushed the right button. ;-)

Statistics: Posted by swampdog — Sun Jun 23, 2024 11:43 pm



Viewing all articles
Browse latest Browse all 4861

Trending Articles