Using lwip sntp to set the RTC.
This commit is contained in:
parent
8b5f6f99e3
commit
d7d6151efc
4 changed files with 56 additions and 190 deletions
|
@ -1,7 +1,6 @@
|
|||
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(SOURCES
|
||||
ntp_time.cpp
|
||||
abfall.cpp
|
||||
)
|
||||
|
||||
|
@ -16,6 +15,21 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required
|
||||
)
|
||||
|
||||
#add_definitions(
|
||||
# -DSNTP_SERVER_DNS=1
|
||||
# -DSNTP_SERVER_ADDRESS="pool.ntp.org"
|
||||
# -DSNTP_STARTUP_DELAY=0
|
||||
# -DSNTP_SET_SYSTEM_TIME=set_system_time
|
||||
#)
|
||||
|
||||
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
||||
SNTP_SERVER_DNS=1
|
||||
SNTP_SERVER_ADDRESS="pool.ntp.org"
|
||||
SNTP_STARTUP_DELAY=0
|
||||
SNTP_SET_SYSTEM_TIME=set_system_time
|
||||
SNTP_UPDATE_DELAY=86400
|
||||
)
|
||||
|
||||
set_target_properties(${CMAKE_PROJECT_NAME}
|
||||
PROPERTIES
|
||||
CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
|
@ -30,6 +44,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
|
|||
pico_stdlib
|
||||
pico_cyw43_arch_lwip_threadsafe_background
|
||||
pico_lwip_http
|
||||
pico_lwip_sntp
|
||||
hardware_rtc
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue