]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
ulcdd: Added configuration for the used tty
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 1 May 2008 02:46:22 +0000 (04:46 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 1 May 2008 02:46:22 +0000 (04:46 +0200)
build/_infrastructure/Makefile.rules
build/ppc/config.target
src/ulcdd/Makefile.omk
src/ulcdd/uoled.c

index 36d14bd33ec01b6d8da506029174d81cac9b9d05..b60ffb571281b20dfe653fddad3e523596de42ed 100644 (file)
@@ -120,8 +120,12 @@ CONFIG_FILE_OK = y
 endif
 endif #$(CONFIG_FILE_OK)
 
+
+CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(MAKERULES_DIR)/config.target) $(wildcard $(CONFIG_FILE))
+
+
 export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR
-export CONFIG_FILE OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT
+export CONFIG_FILE CONFIG_FILES OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT
 # OMK_SERIALIZE_INCLUDED has to be exported to submakes because passes
 # must to be serialized only in the toplevel make.
 
@@ -1064,12 +1068,12 @@ endif
 # Syntax: $(call BUILD_CONFIG_H_template,<stamp_dir>,<header_file_path>,<list_of_options_to_export>,<header_barrier>)
 define BUILD_CONFIG_H_template
 
-$(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
+$(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(CONFIG_FILES)
        @$(QUIET_CMD_ECHO) "  CONFGEN $$(@:%.stamp=%)"
        @if [ ! -d `dirname $(2).tmp` ] ; then \
                mkdir -p `dirname $(2).tmp` ; fi
        @echo "/* Automatically generated from */" > "$(2).tmp"
-       @echo "/* config file: $$< */" >> "$(2).tmp"
+       @echo "/* config files: $$(^:$(MAKERULES_DIR)/%=%) */" >> "$(2).tmp"
        $(if $(DOXYGEN),@echo "/** @file */" >> "$(2).tmp")
        @echo "#ifndef $(4)" >> "$(2).tmp"
        @echo "#define $(4)" >> "$(2).tmp"
index 6c9fe0fcdc3b33135192b8c4002b201e995d8221..1c2ddda91a98934a9ab65bca08b4c71f2206f7b3 100644 (file)
@@ -13,4 +13,5 @@ CXXFLAGS = -fno-strict-aliasing
 
 INCLUDES = -I/usr/powerpc-603e-linux-gnu/gcc/4.1.1/lib/include/c++/4.1.1 -I /usr/powerpc-603e-linux-gnu/gcc/4.1.1/lib/include/c++/4.1.1/powerpc-603e-linux-gnu
 
-IDL_COMPILER = orte-idl
\ No newline at end of file
+IDL_COMPILER = orte-idl
+CONFIG_UOLED_TTY="/dev/ttyPSC2"
\ No newline at end of file
index c1662190e4f651429cba8c3fae5a44b574930521..1540006fd4b5db86133dfcb8048f4ded0634f2fc 100644 (file)
@@ -11,5 +11,5 @@ include_HEADERS = uoled.h oledlib.h
 lib_LOADLIBES = sercom
 
 
-default_CONFIG = CONFIG_DEBUG_UOLED=n
+default_CONFIG = CONFIG_DEBUG_UOLED=n CONFIG_UOLED_TTY="/dev/null"
 LOCAL_CONFIG_H = uoled_config.h
index 64f2a5ecb8c4d4204321165386eef48ebfa3f9fa..fe63dedb55c5504b77816bf8d910b4a7187c4c7b 100644 (file)
@@ -20,7 +20,7 @@ static struct sercom_data sercom;
 
 struct sercom_data* uoled_init(void(*sighandler)(int)) 
 {
-       strcpy((char *)&sercom.devname, "/dev/ttyUSB0");
+       strcpy((char *)&sercom.devname, CONFIG_UOLED_TTY);
        sercom.baudrate = 2400;
        sercom.parity = SERCOM_PARNONE;
        sercom.databits = 8;