- signaling the same link state multiple times fixed
- building as CMake library target added
This commit is contained in:
parent
bb7a8e1f16
commit
30f3e890ba
@ -1,7 +1,13 @@
|
||||
target_sources(
|
||||
${CMAKE_PROJECT_NAME}
|
||||
PUBLIC
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
set(ETHERLIB_TARGET etherlib)
|
||||
|
||||
if (ETHERLIB_TARGET_TAG)
|
||||
set(ETHERLIB_TARGET "${ETHERLIB_TARGET}_${ETHERLIB_TARGET_TAG}")
|
||||
message("Custom EtherLib target: ${ETHERLIB_TARGET}")
|
||||
endif()
|
||||
|
||||
set(ETHERLIB_SRC
|
||||
apps/http_server.c
|
||||
apps/http_server.h
|
||||
apps/ftp_server.c
|
||||
@ -89,3 +95,18 @@ target_sources(
|
||||
utils.c
|
||||
utils.h
|
||||
)
|
||||
|
||||
add_library(${ETHERLIB_TARGET} STATIC ${ETHERLIB_SRC})
|
||||
target_include_directories(${ETHERLIB_TARGET} PRIVATE ${ETHERLIB_INCLUDES})
|
||||
target_compile_options(${ETHERLIB_TARGET} PRIVATE
|
||||
${ETHERLIB_CPU_PARAMS}
|
||||
-Wall
|
||||
-Wextra
|
||||
#-Wpedantic
|
||||
-Wno-unused-parameter
|
||||
|
||||
$<$<COMPILE_LANGUAGE:ASM>:-x assembler-with-cpp -MMD -MP>
|
||||
$<$<CONFIG:Debug>:-O0 -g3 -ggdb>
|
||||
$<$<CONFIG:Release>:-Og -g0>
|
||||
)
|
||||
target_compile_definitions(${ETHERLIB_TARGET} PRIVATE ${ETHERLIB_COMPILE_DEFS})
|
@ -120,7 +120,6 @@ static ThreadReturnType task_ethintf(ThreadParamType param) {
|
||||
} else { // if link is off
|
||||
dhcp_stop(intf->dhcp);
|
||||
}
|
||||
}
|
||||
|
||||
// print generic message
|
||||
MSG("ETH LINK: %s%s", (ls ? (ANSI_COLOR_BGREEN "UP ") : (ANSI_COLOR_BRED "DOWN\n")), ANSI_COLOR_RESET);
|
||||
@ -129,6 +128,8 @@ static ThreadReturnType task_ethintf(ThreadParamType param) {
|
||||
if (ls) {
|
||||
MSG("(%u Mbps, %s duplex)\n", speed, duplex ? "FULL" : "HALF");
|
||||
}
|
||||
}
|
||||
|
||||
} break;
|
||||
case ETH_IIE_TRANSMIT_NOTIFY: {
|
||||
intf->ioDef->llTxTrigger(intf->ioDef, intf->txQ);
|
||||
@ -219,6 +220,6 @@ void ethinf_down(EthInterface *intf) {
|
||||
intf->up = false;
|
||||
}
|
||||
|
||||
void ethinf_set_intercept_callback(EthInterface * intf, EthIntfInterceptCb cb) {
|
||||
void ethinf_set_intercept_callback(EthInterface *intf, EthIntfInterceptCb cb) {
|
||||
intf->interceptCb = cb;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user