From 41fde87ed8d1fcd593777bdfae2fa9e65006d984 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 15 May 2015 12:05:06 +0200 Subject: build: add support for out of tree modules --- ucoo/dev/avrisp/Config | 2 +- ucoo/dev/avrisp/Module | 2 +- ucoo/dev/avrisp/avrisp_frame.cc | 2 +- ucoo/dev/avrisp/avrisp_frame.hh | 4 ++-- ucoo/dev/avrisp/avrisp_proto.cc | 20 ++++++++++---------- ucoo/dev/avrisp/test/Makefile | 3 ++- 6 files changed, 17 insertions(+), 16 deletions(-) (limited to 'ucoo/dev/avrisp') diff --git a/ucoo/dev/avrisp/Config b/ucoo/dev/avrisp/Config index cf3eb48..8233b8e 100644 --- a/ucoo/dev/avrisp/Config +++ b/ucoo/dev/avrisp/Config @@ -1,4 +1,4 @@ -[dev/avrisp] +[ucoo/dev/avrisp] frame_buffer_size = 281 proto_signature = "APBisp_2" proto_build_number = 0x0100 diff --git a/ucoo/dev/avrisp/Module b/ucoo/dev/avrisp/Module index d66f06f..cbec793 100644 --- a/ucoo/dev/avrisp/Module +++ b/ucoo/dev/avrisp/Module @@ -1 +1 @@ -dev_avrisp_SOURCES := avrisp.cc avrisp_proto.cc avrisp_frame.cc +ucoo_dev_avrisp_SOURCES := avrisp.cc avrisp_proto.cc avrisp_frame.cc diff --git a/ucoo/dev/avrisp/avrisp_frame.cc b/ucoo/dev/avrisp/avrisp_frame.cc index 4cc8c98..768eaf2 100644 --- a/ucoo/dev/avrisp/avrisp_frame.cc +++ b/ucoo/dev/avrisp/avrisp_frame.cc @@ -101,7 +101,7 @@ AvrIspFrame::accept_char (uint8_t c) len_ |= c; buffer_len_ = 0; if (len_ == 0 - || len_ > (UCOO_CONFIG_DEV_AVRISP_FRAME_BUFFER_SIZE - proto_head_ + || len_ > (CONFIG_UCOO_DEV_AVRISP_FRAME_BUFFER_SIZE - proto_head_ - proto_tail_)) state_ = AVRISP_FRAME_STATE_START; else diff --git a/ucoo/dev/avrisp/avrisp_frame.hh b/ucoo/dev/avrisp/avrisp_frame.hh index 5631122..fb32546 100644 --- a/ucoo/dev/avrisp/avrisp_frame.hh +++ b/ucoo/dev/avrisp/avrisp_frame.hh @@ -27,7 +27,7 @@ #include "ucoo/intf/stream.hh" -#include "config/dev/avrisp.hh" +#include "config/ucoo/dev/avrisp.hh" namespace ucoo { @@ -79,7 +79,7 @@ class AvrIspFrame /// Checksum current value. uint8_t cksum_; /// Buffer to store frame until validated. - uint8_t buffer_[UCOO_CONFIG_DEV_AVRISP_FRAME_BUFFER_SIZE]; + uint8_t buffer_[CONFIG_UCOO_DEV_AVRISP_FRAME_BUFFER_SIZE]; /// Used buffer length. int buffer_len_; /// Index to first byte to send from buffer, or -1 if not sending. diff --git a/ucoo/dev/avrisp/avrisp_proto.cc b/ucoo/dev/avrisp/avrisp_proto.cc index bdf0457..c08dfa2 100644 --- a/ucoo/dev/avrisp/avrisp_proto.cc +++ b/ucoo/dev/avrisp/avrisp_proto.cc @@ -25,7 +25,7 @@ #include "ucoo/utils/bytes.hh" -#include "config/dev/avrisp.hh" +#include "config/ucoo/dev/avrisp.hh" #include #include @@ -121,10 +121,10 @@ AvrIspProto::accept (uint8_t *data, int len) case AVRISP_PROTO_CMD_SIGN_ON: if (len != 1) break; data[1] = AVRISP_PROTO_STATUS_CMD_OK; - data[2] = sizeof (UCOO_CONFIG_DEV_AVRISP_PROTO_SIGNATURE); - memcpy (&data[3], UCOO_CONFIG_DEV_AVRISP_PROTO_SIGNATURE, - sizeof (UCOO_CONFIG_DEV_AVRISP_PROTO_SIGNATURE)); - return 3 + sizeof (UCOO_CONFIG_DEV_AVRISP_PROTO_SIGNATURE); + data[2] = sizeof (CONFIG_UCOO_DEV_AVRISP_PROTO_SIGNATURE); + memcpy (&data[3], CONFIG_UCOO_DEV_AVRISP_PROTO_SIGNATURE, + sizeof (CONFIG_UCOO_DEV_AVRISP_PROTO_SIGNATURE)); + return 3 + sizeof (CONFIG_UCOO_DEV_AVRISP_PROTO_SIGNATURE); case AVRISP_PROTO_CMD_SET_PARAMETER: if (len != 3) break; status = AVRISP_PROTO_STATUS_CMD_OK; @@ -155,19 +155,19 @@ AvrIspProto::accept (uint8_t *data, int len) data[2] = 1; break; case AVRISP_PROTO_PARAM_BUILD_NUMBER_LOW: - data[2] = bytes_unpack (UCOO_CONFIG_DEV_AVRISP_PROTO_BUILD_NUMBER, 0); + data[2] = bytes_unpack (CONFIG_UCOO_DEV_AVRISP_PROTO_BUILD_NUMBER, 0); break; case AVRISP_PROTO_PARAM_BUILD_NUMBER_HIGH: - data[2] = bytes_unpack (UCOO_CONFIG_DEV_AVRISP_PROTO_BUILD_NUMBER, 1); + data[2] = bytes_unpack (CONFIG_UCOO_DEV_AVRISP_PROTO_BUILD_NUMBER, 1); break; case AVRISP_PROTO_PARAM_HW_VER: - data[2] = UCOO_CONFIG_DEV_AVRISP_PROTO_HW_VERSION; + data[2] = CONFIG_UCOO_DEV_AVRISP_PROTO_HW_VERSION; break; case AVRISP_PROTO_PARAM_SW_MAJOR: - data[2] = bytes_unpack (UCOO_CONFIG_DEV_AVRISP_PROTO_SW_VERSION, 1); + data[2] = bytes_unpack (CONFIG_UCOO_DEV_AVRISP_PROTO_SW_VERSION, 1); break; case AVRISP_PROTO_PARAM_SW_MINOR: - data[2] = bytes_unpack (UCOO_CONFIG_DEV_AVRISP_PROTO_SW_VERSION, 0); + data[2] = bytes_unpack (CONFIG_UCOO_DEV_AVRISP_PROTO_SW_VERSION, 0); break; default: status = AVRISP_PROTO_STATUS_CMD_FAILED; diff --git a/ucoo/dev/avrisp/test/Makefile b/ucoo/dev/avrisp/test/Makefile index 80a8334..8419827 100644 --- a/ucoo/dev/avrisp/test/Makefile +++ b/ucoo/dev/avrisp/test/Makefile @@ -4,6 +4,7 @@ TARGETS = stm32f4 PROGS = test_avrisp test_avrisp_SOURCES = test_avrisp.cc -MODULES = dev/avrisp hal/spi hal/gpio base/test hal/usb utils +MODULES = ucoo/dev/avrisp ucoo/hal/spi ucoo/hal/gpio ucoo/base/test \ + ucoo/hal/usb ucoo/utils include $(BASE)/build/top.mk -- cgit v1.2.3