sercomm: Include in libosmocore Makefile

Change-Id: If9d50d634381f43b2c67b97fea36a462a66e4559
This commit is contained in:
Harald Welte 2017-05-14 21:48:41 +02:00
parent fe71ee9d99
commit 7af6d22a4e
4 changed files with 6 additions and 5 deletions

View File

@ -36,6 +36,7 @@ nobase_include_HEADERS = \
osmocom/core/rate_ctr.h \ osmocom/core/rate_ctr.h \
osmocom/core/stat_item.h \ osmocom/core/stat_item.h \
osmocom/core/select.h \ osmocom/core/select.h \
osmocom/core/sercomm.h \
osmocom/core/signal.h \ osmocom/core/signal.h \
osmocom/core/socket.h \ osmocom/core/socket.h \
osmocom/core/statistics.h \ osmocom/core/statistics.h \

View File

@ -58,7 +58,7 @@ struct osmo_sercomm_inst {
}; };
#ifndef HOST_BUILD #ifdef EMBEDDED
#include <uart.h> #include <uart.h>
/* helper functions for target */ /* helper functions for target */
void osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, enum uart_baudrate bdrt); void osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, enum uart_baudrate bdrt);

View File

@ -17,7 +17,7 @@ libosmocore_la_SOURCES = timer.c timer_gettimeofday.c select.c signal.c msgb.c b
conv.c application.c rbtree.c strrb.c \ conv.c application.c rbtree.c strrb.c \
loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \
macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \
viterbi.c viterbi_gen.c viterbi.c viterbi_gen.c sercomm.c
BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c

View File

@ -29,7 +29,7 @@
#include <osmocom/core/sercomm.h> #include <osmocom/core/sercomm.h>
#include <osmocom/core/linuxlist.h> #include <osmocom/core/linuxlist.h>
#ifdef HOST_BUILD #ifndef EMBEDDED
# define DEFAULT_RX_MSG_SIZE 2048 # define DEFAULT_RX_MSG_SIZE 2048
static inline void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} static inline void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {}
@ -107,7 +107,7 @@ void osmo_sercomm_sendmsg(struct osmo_sercomm_inst *sercomm, uint8_t dlci, struc
msgb_enqueue(&sercomm->tx.dlci_queues[dlci], msg); msgb_enqueue(&sercomm->tx.dlci_queues[dlci], msg);
sercomm_drv_unlock(&flags); sercomm_drv_unlock(&flags);
#ifndef HOST_BUILD #ifdef EMBEDDED
/* tell UART that we have something to send */ /* tell UART that we have something to send */
uart_irq_enable(sercomm->uart_id, UART_IRQ_TX_EMPTY, 1); uart_irq_enable(sercomm->uart_id, UART_IRQ_TX_EMPTY, 1);
#endif #endif
@ -126,7 +126,7 @@ unsigned int osmo_sercomm_tx_queue_depth(struct osmo_sercomm_inst *sercomm, uint
return num; return num;
} }
#ifndef HOST_BUILD #ifdef EMBEDDED
/* wait until everything has been transmitted, then grab the lock and /* wait until everything has been transmitted, then grab the lock and
* change the baud rate as requested */ * change the baud rate as requested */
void osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, enum uart_baudrate bdrt) void osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, enum uart_baudrate bdrt)