summaryrefslogtreecommitdiff
path: root/ucoo
diff options
context:
space:
mode:
authorNicolas Schodet2015-05-15 12:05:06 +0200
committerNicolas Schodet2019-10-07 00:44:50 +0200
commit41fde87ed8d1fcd593777bdfae2fa9e65006d984 (patch)
tree48a82b5ba790741d1f0bcc97eb183ea4b045d7b0 /ucoo
parent751a7d2ba7a0fbb9c6dae2d91891f0cc74897a2a (diff)
build: add support for out of tree modules
Diffstat (limited to 'ucoo')
-rw-r--r--ucoo/arch/Module3
-rw-r--r--ucoo/arch/host/Module2
-rw-r--r--ucoo/arch/host/mex/Config2
-rw-r--r--ucoo/arch/host/mex/Module4
-rw-r--r--ucoo/arch/host/mex/mex_socket.host.cc4
-rw-r--r--ucoo/base/proto/Config2
-rw-r--r--ucoo/base/proto/Module2
-rw-r--r--ucoo/base/proto/proto.cc4
-rw-r--r--ucoo/base/proto/proto.hh4
-rw-r--r--ucoo/base/proto/test/Makefile2
-rw-r--r--ucoo/base/stdio/Module2
-rw-r--r--ucoo/base/test/Config4
-rw-r--r--ucoo/base/test/Module2
-rw-r--r--ucoo/base/test/test.cc4
-rw-r--r--ucoo/base/test/test/Makefile2
-rw-r--r--ucoo/dev/avrisp/Config2
-rw-r--r--ucoo/dev/avrisp/Module2
-rw-r--r--ucoo/dev/avrisp/avrisp_frame.cc2
-rw-r--r--ucoo/dev/avrisp/avrisp_frame.hh4
-rw-r--r--ucoo/dev/avrisp/avrisp_proto.cc20
-rw-r--r--ucoo/dev/avrisp/test/Makefile3
-rw-r--r--ucoo/dev/lcd/Module2
-rw-r--r--ucoo/dev/lcd/test/Makefile2
-rw-r--r--ucoo/dev/usdist/Module2
-rw-r--r--ucoo/dev/xmodem/Module2
-rw-r--r--ucoo/hal/adc/Module2
-rw-r--r--ucoo/hal/adc/test/Makefile2
-rw-r--r--ucoo/hal/gpio/Module2
-rw-r--r--ucoo/hal/gpio/test/Makefile2
-rw-r--r--ucoo/hal/i2c/Config2
-rw-r--r--ucoo/hal/i2c/Module2
-rw-r--r--ucoo/hal/i2c/i2c.host.cc10
-rw-r--r--ucoo/hal/i2c/i2c_hard.stm32.cc2
-rw-r--r--ucoo/hal/i2c/i2c_hard.stm32.hh4
-rw-r--r--ucoo/hal/i2c/test/Makefile2
-rw-r--r--ucoo/hal/spi/Module2
-rw-r--r--ucoo/hal/spi/test/Makefile2
-rw-r--r--ucoo/hal/uart/Config2
-rw-r--r--ucoo/hal/uart/Module2
-rw-r--r--ucoo/hal/uart/test/Config2
-rw-r--r--ucoo/hal/uart/test/Makefile4
-rw-r--r--ucoo/hal/uart/uart.stm32.hh6
-rw-r--r--ucoo/hal/usb/Config2
-rw-r--r--ucoo/hal/usb/Module2
-rw-r--r--ucoo/hal/usb/test/Config2
-rw-r--r--ucoo/hal/usb/test/Makefile2
-rw-r--r--ucoo/hal/usb/test/test_usb.cc12
-rw-r--r--ucoo/hal/usb/usb.stm32.cc6
-rw-r--r--ucoo/hal/usb/usb.stm32.hh6
-rw-r--r--ucoo/hal/usb/usb_desc.stm32.c38
-rw-r--r--ucoo/intf/Module2
-rw-r--r--ucoo/utils/Module2
-rw-r--r--ucoo/utils/test/Makefile2
53 files changed, 106 insertions, 104 deletions
diff --git a/ucoo/arch/Module b/ucoo/arch/Module
index 8ed9210..9a4989e 100644
--- a/ucoo/arch/Module
+++ b/ucoo/arch/Module
@@ -1,2 +1,3 @@
-arch_SOURCES := arch.host.cc arch.stm32.cc arch.stm32f1.cc arch.stm32f4.cc \
+ucoo_arch_SOURCES := arch.host.cc \
+ arch.stm32.cc arch.stm32f1.cc arch.stm32f4.cc \
syscalls.newlib.cc syscalls.cc
diff --git a/ucoo/arch/host/Module b/ucoo/arch/host/Module
index 2c7fead..f96adbf 100644
--- a/ucoo/arch/host/Module
+++ b/ucoo/arch/host/Module
@@ -1,2 +1,2 @@
-arch_host_SOURCES := host.host.cc host_stream.host.cc
+ucoo_arch_host_SOURCES := host.host.cc host_stream.host.cc
host_LIBS += -lutil
diff --git a/ucoo/arch/host/mex/Config b/ucoo/arch/host/mex/Config
index de679f0..87076f6 100644
--- a/ucoo/arch/host/mex/Config
+++ b/ucoo/arch/host/mex/Config
@@ -1,2 +1,2 @@
-[arch/host/mex]
+[ucoo/arch/host/mex]
default_address = "localhost", "2442"
diff --git a/ucoo/arch/host/mex/Module b/ucoo/arch/host/mex/Module
index 941482b..01835ed 100644
--- a/ucoo/arch/host/mex/Module
+++ b/ucoo/arch/host/mex/Module
@@ -1,2 +1,2 @@
-arch_host_mex_SOURCES := mex_msg.host.cc mex_node.host.cc mex_socket.host.cc \
- socket.host.c
+ucoo_arch_host_mex_SOURCES := mex_msg.host.cc mex_node.host.cc \
+ mex_socket.host.cc socket.host.c
diff --git a/ucoo/arch/host/mex/mex_socket.host.cc b/ucoo/arch/host/mex/mex_socket.host.cc
index 41a6e01..20fc491 100644
--- a/ucoo/arch/host/mex/mex_socket.host.cc
+++ b/ucoo/arch/host/mex/mex_socket.host.cc
@@ -25,7 +25,7 @@
#include "ucoo/common.hh"
-#include "config/arch/host/mex.hh"
+#include "config/ucoo/arch/host/mex.hh"
#include "socket.h"
#include <unistd.h>
@@ -43,7 +43,7 @@ Socket::~Socket ()
void
Socket::connect ()
{
- fd_ = socket_client UCOO_CONFIG_ARCH_HOST_MEX_DEFAULT_ADDRESS;
+ fd_ = socket_client CONFIG_UCOO_ARCH_HOST_MEX_DEFAULT_ADDRESS;
}
int
diff --git a/ucoo/base/proto/Config b/ucoo/base/proto/Config
index 4edaa6b..82174c9 100644
--- a/ucoo/base/proto/Config
+++ b/ucoo/base/proto/Config
@@ -1,2 +1,2 @@
-[base/proto]
+[ucoo/base/proto]
args_max_size = 16
diff --git a/ucoo/base/proto/Module b/ucoo/base/proto/Module
index 68f866f..ff93e67 100644
--- a/ucoo/base/proto/Module
+++ b/ucoo/base/proto/Module
@@ -1 +1 @@
-base_proto_SOURCES = proto.cc
+ucoo_base_proto_SOURCES = proto.cc
diff --git a/ucoo/base/proto/proto.cc b/ucoo/base/proto/proto.cc
index 838a79b..20d87b3 100644
--- a/ucoo/base/proto/proto.cc
+++ b/ucoo/base/proto/proto.cc
@@ -213,7 +213,7 @@ void
Proto::accept_digit (int c)
{
// Test for argument list overflow.
- if (size_ >= UCOO_CONFIG_BASE_PROTO_ARGS_MAX_SIZE)
+ if (size_ >= CONFIG_UCOO_BASE_PROTO_ARGS_MAX_SIZE)
{
handler_.proto_handle (*this, '?', 0, 0);
step_ = IDLE;
@@ -243,7 +243,7 @@ void
Proto::accept_char (int c)
{
// Test for argument list overflow or unwanted char.
- if (size_ >= UCOO_CONFIG_BASE_PROTO_ARGS_MAX_SIZE || !std::isprint (c))
+ if (size_ >= CONFIG_UCOO_BASE_PROTO_ARGS_MAX_SIZE || !std::isprint (c))
{
handler_.proto_handle (*this, '?', 0, 0);
step_ = IDLE;
diff --git a/ucoo/base/proto/proto.hh b/ucoo/base/proto/proto.hh
index a4ee999..2b1e2e2 100644
--- a/ucoo/base/proto/proto.hh
+++ b/ucoo/base/proto/proto.hh
@@ -26,7 +26,7 @@
#include "ucoo/common.hh"
#include "ucoo/intf/stream.hh"
-#include "config/base/proto.hh"
+#include "config/ucoo/base/proto.hh"
namespace ucoo {
@@ -89,7 +89,7 @@ class Proto
/// Received message current size.
int size_;
/// Message arguments being received.
- uint8_t args_[UCOO_CONFIG_BASE_PROTO_ARGS_MAX_SIZE];
+ uint8_t args_[CONFIG_UCOO_BASE_PROTO_ARGS_MAX_SIZE];
/// Command being received.
char cmd_;
};
diff --git a/ucoo/base/proto/test/Makefile b/ucoo/base/proto/test/Makefile
index f02be13..8c093f0 100644
--- a/ucoo/base/proto/test/Makefile
+++ b/ucoo/base/proto/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = host stm32f4
PROGS = test_proto
test_proto_SOURCES = test_proto.cc
-MODULES = base/proto base/test hal/usb
+MODULES = ucoo/base/proto ucoo/base/test ucoo/hal/usb
include $(BASE)/build/top.mk
diff --git a/ucoo/base/stdio/Module b/ucoo/base/stdio/Module
index f9cffeb..73f11f4 100644
--- a/ucoo/base/stdio/Module
+++ b/ucoo/base/stdio/Module
@@ -1 +1 @@
-base_stdio_SOURCES := stdio.cc
+ucoo_base_stdio_SOURCES := stdio.cc
diff --git a/ucoo/base/test/Config b/ucoo/base/test/Config
index 133808b..0269ef4 100644
--- a/ucoo/base/test/Config
+++ b/ucoo/base/test/Config
@@ -1,5 +1,5 @@
-[base/test]
+[ucoo/base/test]
wait = false
-[base/test:stm32]
+[ucoo/base/test:stm32]
wait = true
diff --git a/ucoo/base/test/Module b/ucoo/base/test/Module
index 9a3c77b..7a3c57e 100644
--- a/ucoo/base/test/Module
+++ b/ucoo/base/test/Module
@@ -1 +1 @@
-base_test_SOURCES := test.cc test.host.cc test.stm32.cc
+ucoo_base_test_SOURCES := test.cc test.host.cc test.stm32.cc
diff --git a/ucoo/base/test/test.cc b/ucoo/base/test/test.cc
index 4f2e8f0..3a04209 100644
--- a/ucoo/base/test/test.cc
+++ b/ucoo/base/test/test.cc
@@ -27,7 +27,7 @@
#include "ucoo/base/stdio/stdio.hh"
#include "ucoo/utils/delay.hh"
-#include "config/base/test.hh"
+#include "config/ucoo/base/test.hh"
#include <cstdarg>
@@ -38,7 +38,7 @@ TestSuite::TestSuite (const char *test_suite)
test_nb_ (0), fail_nb_ (0), in_test_ (false)
{
test_stream_setup ();
- if (UCOO_CONFIG_BASE_TEST_WAIT)
+ if (CONFIG_UCOO_BASE_TEST_WAIT)
{
Stream &s = test_stream ();
int n;
diff --git a/ucoo/base/test/test/Makefile b/ucoo/base/test/test/Makefile
index 610c71a..64e5021 100644
--- a/ucoo/base/test/test/Makefile
+++ b/ucoo/base/test/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = host stm32f4
PROGS = test_test
test_test_SOURCES = test_test.cc
-MODULES = utils base/test hal/usb
+MODULES = ucoo/utils ucoo/base/test ucoo/hal/usb
include $(BASE)/build/top.mk
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 <cstring>
#include <algorithm>
@@ -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
diff --git a/ucoo/dev/lcd/Module b/ucoo/dev/lcd/Module
index 1934cc8..651bf85 100644
--- a/ucoo/dev/lcd/Module
+++ b/ucoo/dev/lcd/Module
@@ -1 +1 @@
-dev_lcd_SOURCES := lcd_spi.cc
+ucoo_dev_lcd_SOURCES := lcd_spi.cc
diff --git a/ucoo/dev/lcd/test/Makefile b/ucoo/dev/lcd/test/Makefile
index f8bef65..d11d882 100644
--- a/ucoo/dev/lcd/test/Makefile
+++ b/ucoo/dev/lcd/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = stm32f1
PROGS = test_lcd
test_lcd_SOURCES = test_lcd.cc
-MODULES = intf utils hal/gpio hal/spi dev/lcd
+MODULES = ucoo/intf ucoo/utils ucoo/hal/gpio ucoo/hal/spi ucoo/dev/lcd
include $(BASE)/build/top.mk
diff --git a/ucoo/dev/usdist/Module b/ucoo/dev/usdist/Module
index bedbac4..f5c9a3d 100644
--- a/ucoo/dev/usdist/Module
+++ b/ucoo/dev/usdist/Module
@@ -1 +1 @@
-dev_usdist_SOURCES = usdist.cc
+ucoo_dev_usdist_SOURCES = usdist.cc
diff --git a/ucoo/dev/xmodem/Module b/ucoo/dev/xmodem/Module
index 37bc5eb..56c525e 100644
--- a/ucoo/dev/xmodem/Module
+++ b/ucoo/dev/xmodem/Module
@@ -1 +1 @@
-dev_xmodem_SOURCES = xmodem.cc
+ucoo_dev_xmodem_SOURCES = xmodem.cc
diff --git a/ucoo/hal/adc/Module b/ucoo/hal/adc/Module
index f633ffd..cc10647 100644
--- a/ucoo/hal/adc/Module
+++ b/ucoo/hal/adc/Module
@@ -1 +1 @@
-hal_adc_SOURCES = adc.host.cc adc_hard.stm32f4.cc
+ucoo_hal_adc_SOURCES = adc.host.cc adc_hard.stm32f4.cc
diff --git a/ucoo/hal/adc/test/Makefile b/ucoo/hal/adc/test/Makefile
index fc46e0d..c6c8a3c 100644
--- a/ucoo/hal/adc/test/Makefile
+++ b/ucoo/hal/adc/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = stm32f4
stm32f4_PROGS = test_adc
test_adc_SOURCES = test_adc.cc
-MODULES = hal/adc base/test hal/usb utils
+MODULES = ucoo/hal/adc ucoo/base/test ucoo/hal/usb ucoo/utils
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/gpio/Module b/ucoo/hal/gpio/Module
index e5ccdec..b6f0b42 100644
--- a/ucoo/hal/gpio/Module
+++ b/ucoo/hal/gpio/Module
@@ -1 +1 @@
-hal_gpio_SOURCES = gpio.host.cc gpio.stm32f4.cc gpio.stm32f1.cc
+ucoo_hal_gpio_SOURCES = gpio.host.cc gpio.stm32f4.cc gpio.stm32f1.cc
diff --git a/ucoo/hal/gpio/test/Makefile b/ucoo/hal/gpio/test/Makefile
index 68e4c1f..4a5c155 100644
--- a/ucoo/hal/gpio/test/Makefile
+++ b/ucoo/hal/gpio/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = stm32f4 stm32f1
PROGS = test_gpio
test_gpio_SOURCES = test_gpio.stm32f4.cc test_gpio.stm32f1.cc
-MODULES = hal/gpio utils
+MODULES = ucoo/hal/gpio ucoo/utils
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/i2c/Config b/ucoo/hal/i2c/Config
index 3871f5c..3bbcc3a 100644
--- a/ucoo/hal/i2c/Config
+++ b/ucoo/hal/i2c/Config
@@ -1,4 +1,4 @@
-[hal/i2c]
+[ucoo/hal/i2c]
# Size of slave buffer, used for both reception and transmission.
slave_buffer_size = 64
# Activate debug trace.
diff --git a/ucoo/hal/i2c/Module b/ucoo/hal/i2c/Module
index ae93f22..872be6f 100644
--- a/ucoo/hal/i2c/Module
+++ b/ucoo/hal/i2c/Module
@@ -1 +1 @@
-hal_i2c_SOURCES := i2c.host.cc i2c_slave_data_buffer.cc i2c_hard.stm32.cc
+ucoo_hal_i2c_SOURCES := i2c.host.cc i2c_slave_data_buffer.cc i2c_hard.stm32.cc
diff --git a/ucoo/hal/i2c/i2c.host.cc b/ucoo/hal/i2c/i2c.host.cc
index 4a2553b..6b3181b 100644
--- a/ucoo/hal/i2c/i2c.host.cc
+++ b/ucoo/hal/i2c/i2c.host.cc
@@ -23,7 +23,7 @@
// }}}
#include "i2c.host.hh"
-#include "config/hal/i2c.hh"
+#include "config/ucoo/hal/i2c.hh"
namespace ucoo {
@@ -77,7 +77,7 @@ I2cHostShared::send (uint8_t addr, const char *buf, int count)
{
if (addr == (*i)->slave_addr_)
{
- assert (count <= UCOO_CONFIG_HAL_I2C_SLAVE_BUFFER_SIZE);
+ assert (count <= CONFIG_UCOO_HAL_I2C_SLAVE_BUFFER_SIZE);
(*i)->slave_data_handler_->to_recv (buf, count);
return count;
}
@@ -99,7 +99,7 @@ I2cHostShared::recv (uint8_t addr, char *buf, int count)
{
if (addr == (*i)->slave_addr_)
{
- assert (count <= UCOO_CONFIG_HAL_I2C_SLAVE_BUFFER_SIZE);
+ assert (count <= CONFIG_UCOO_HAL_I2C_SLAVE_BUFFER_SIZE);
return (*i)->slave_data_handler_->to_send (buf, count);
}
}
@@ -125,7 +125,7 @@ I2cHostShared::handle_read (mex::Msg &msg)
{
if (addr == (*i)->slave_addr_)
{
- assert (size <= UCOO_CONFIG_HAL_I2C_SLAVE_BUFFER_SIZE);
+ assert (size <= CONFIG_UCOO_HAL_I2C_SLAVE_BUFFER_SIZE);
char buf[size];
int n = (*i)->slave_data_handler_->to_send (buf, size);
mex::Msg rsp (read_mtype_);
@@ -147,7 +147,7 @@ I2cHostShared::handle_write (mex::Msg &msg)
if (addr == (*i)->slave_addr_)
{
int size = msg.len ();
- assert (size <= UCOO_CONFIG_HAL_I2C_SLAVE_BUFFER_SIZE);
+ assert (size <= CONFIG_UCOO_HAL_I2C_SLAVE_BUFFER_SIZE);
(*i)->slave_data_handler_->to_recv (msg.pop (size), size);
break;
}
diff --git a/ucoo/hal/i2c/i2c_hard.stm32.cc b/ucoo/hal/i2c/i2c_hard.stm32.cc
index 9afe241..14a4486 100644
--- a/ucoo/hal/i2c/i2c_hard.stm32.cc
+++ b/ucoo/hal/i2c/i2c_hard.stm32.cc
@@ -32,7 +32,7 @@
namespace ucoo {
/// Local trace.
-static Trace<UCOO_CONFIG_HAL_I2C_TRACE> i2c_trace;
+static Trace<CONFIG_UCOO_HAL_I2C_TRACE> i2c_trace;
/// Information on I2C hardware structure.
struct i2c_hardware_t
diff --git a/ucoo/hal/i2c/i2c_hard.stm32.hh b/ucoo/hal/i2c/i2c_hard.stm32.hh
index 94e4259..98e4930 100644
--- a/ucoo/hal/i2c/i2c_hard.stm32.hh
+++ b/ucoo/hal/i2c/i2c_hard.stm32.hh
@@ -25,7 +25,7 @@
// }}}
#include "ucoo/intf/i2c.hh"
-#include "config/hal/i2c.hh"
+#include "config/ucoo/hal/i2c.hh"
namespace ucoo {
@@ -68,7 +68,7 @@ class I2cHard : public I2c
/// Handler called to source or sink data for slave exchanges.
DataHandler *slave_data_handler_;
/// Slave buffer.
- char slave_buf_[UCOO_CONFIG_HAL_I2C_SLAVE_BUFFER_SIZE];
+ char slave_buf_[CONFIG_UCOO_HAL_I2C_SLAVE_BUFFER_SIZE];
/// Current buffer count (bytes to send), or buffer size (available room).
int buf_count_;
/// Current buffer index (position to read byte to send or write received
diff --git a/ucoo/hal/i2c/test/Makefile b/ucoo/hal/i2c/test/Makefile
index 5046862..ca6915e 100644
--- a/ucoo/hal/i2c/test/Makefile
+++ b/ucoo/hal/i2c/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = host stm32f4
PROGS = test_i2c
test_i2c_SOURCES = test_i2c.cc
-MODULES = hal/i2c utils base/test hal/usb
+MODULES = ucoo/hal/i2c ucoo/utils ucoo/base/test ucoo/hal/usb
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/spi/Module b/ucoo/hal/spi/Module
index fe9737f..46a0fe2 100644
--- a/ucoo/hal/spi/Module
+++ b/ucoo/hal/spi/Module
@@ -1 +1 @@
-hal_spi_SOURCES := spi_soft.cc spi_hard.stm32.cc
+ucoo_hal_spi_SOURCES := spi_soft.cc spi_hard.stm32.cc
diff --git a/ucoo/hal/spi/test/Makefile b/ucoo/hal/spi/test/Makefile
index 76b8230..eb872a0 100644
--- a/ucoo/hal/spi/test/Makefile
+++ b/ucoo/hal/spi/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = stm32f4
PROGS = test_spi
test_spi_SOURCES = test_spi.cc
-MODULES = hal/spi hal/gpio utils base/test hal/usb
+MODULES = ucoo/hal/spi ucoo/hal/gpio ucoo/utils ucoo/base/test ucoo/hal/usb
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/uart/Config b/ucoo/hal/uart/Config
index 0a67d63..1229b76 100644
--- a/ucoo/hal/uart/Config
+++ b/ucoo/hal/uart/Config
@@ -1,4 +1,4 @@
-[hal/uart]
+[ucoo/hal/uart]
# Size of reception buffer.
rx_buffer = 32
# Size of transmission buffer.
diff --git a/ucoo/hal/uart/Module b/ucoo/hal/uart/Module
index a9d185e..8b1bac2 100644
--- a/ucoo/hal/uart/Module
+++ b/ucoo/hal/uart/Module
@@ -1 +1 @@
-hal_uart_SOURCES = uart.stm32.cc
+ucoo_hal_uart_SOURCES = uart.stm32.cc
diff --git a/ucoo/hal/uart/test/Config b/ucoo/hal/uart/test/Config
index 4fd7571..91c7ed5 100644
--- a/ucoo/hal/uart/test/Config
+++ b/ucoo/hal/uart/test/Config
@@ -1,4 +1,4 @@
-[hal/uart]
+[ucoo/hal/uart]
rx_buffer = 32
tx_buffer = 8
diff --git a/ucoo/hal/uart/test/Makefile b/ucoo/hal/uart/test/Makefile
index 6989dd2..b1e9c71 100644
--- a/ucoo/hal/uart/test/Makefile
+++ b/ucoo/hal/uart/test/Makefile
@@ -6,7 +6,7 @@ stm32f4_PROGS = test_uart_disc
test_uart_SOURCES = test_uart.cc
test_uart_disc_SOURCES = test_uart_disc.cc
-MODULES = hal/uart
-test_uart_disc_MODULES = $(MODULES) base/test hal/usb
+MODULES = ucoo/hal/uart
+test_uart_disc_MODULES = $(MODULES) ucoo/base/test ucoo/hal/usb
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/uart/uart.stm32.hh b/ucoo/hal/uart/uart.stm32.hh
index 1dd3d54..7d74946 100644
--- a/ucoo/hal/uart/uart.stm32.hh
+++ b/ucoo/hal/uart/uart.stm32.hh
@@ -26,7 +26,7 @@
#include "ucoo/intf/stream.hh"
#include "ucoo/utils/fifo.hh"
-#include "config/hal/uart.hh"
+#include "config/ucoo/hal/uart.hh"
namespace ucoo {
@@ -64,9 +64,9 @@ class Uart : public Stream
/// UART number.
int n_;
/// RX FIFO, filled by interrupt handler.
- Fifo<char, UCOO_CONFIG_HAL_UART_RX_BUFFER> rx_fifo_;
+ Fifo<char, CONFIG_UCOO_HAL_UART_RX_BUFFER> rx_fifo_;
/// TX FIFO, emptied by interrupt handler.
- Fifo<char, UCOO_CONFIG_HAL_UART_TX_BUFFER> tx_fifo_;
+ Fifo<char, CONFIG_UCOO_HAL_UART_TX_BUFFER> tx_fifo_;
/// Error character, inserted in case of error.
char error_char_;
/// Is it enabled?
diff --git a/ucoo/hal/usb/Config b/ucoo/hal/usb/Config
index 80341e8..0ec69c3 100644
--- a/ucoo/hal/usb/Config
+++ b/ucoo/hal/usb/Config
@@ -1,4 +1,4 @@
-[hal/usb]
+[ucoo/hal/usb]
# Theses are APBTeam IDs, given by Openmoko!
vendor_id = 0x1d50
product_id = 0x6052
diff --git a/ucoo/hal/usb/Module b/ucoo/hal/usb/Module
index 433c8b2..e47e0e8 100644
--- a/ucoo/hal/usb/Module
+++ b/ucoo/hal/usb/Module
@@ -1 +1 @@
-hal_usb_SOURCES = usb.stm32.cc usb_desc.stm32.c
+ucoo_hal_usb_SOURCES = usb.stm32.cc usb_desc.stm32.c
diff --git a/ucoo/hal/usb/test/Config b/ucoo/hal/usb/test/Config
index 49b2f0b..a29fd20 100644
--- a/ucoo/hal/usb/test/Config
+++ b/ucoo/hal/usb/test/Config
@@ -1,2 +1,2 @@
-[hal/usb]
+[ucoo/hal/usb]
stream_nb = 1
diff --git a/ucoo/hal/usb/test/Makefile b/ucoo/hal/usb/test/Makefile
index 9ef0eab..95e4648 100644
--- a/ucoo/hal/usb/test/Makefile
+++ b/ucoo/hal/usb/test/Makefile
@@ -4,6 +4,6 @@ TARGETS = stm32f4
PROGS = test_usb
test_usb_SOURCES = test_usb.cc
-MODULES = hal/usb
+MODULES = ucoo/hal/usb
include $(BASE)/build/top.mk
diff --git a/ucoo/hal/usb/test/test_usb.cc b/ucoo/hal/usb/test/test_usb.cc
index a1fe362..914e084 100644
--- a/ucoo/hal/usb/test/test_usb.cc
+++ b/ucoo/hal/usb/test/test_usb.cc
@@ -31,22 +31,22 @@ main (int argc, const char **argv)
ucoo::UsbStreamControl usc ("APBTeam", "USB test");
ucoo::UsbStream us[] = {
ucoo::UsbStream (usc, 0),
-#if UCOO_CONFIG_HAL_USB_STREAM_NB >= 2
+#if CONFIG_UCOO_HAL_USB_STREAM_NB >= 2
ucoo::UsbStream (usc, 1),
#endif
-#if UCOO_CONFIG_HAL_USB_STREAM_NB >= 3
+#if CONFIG_UCOO_HAL_USB_STREAM_NB >= 3
ucoo::UsbStream (usc, 2),
#endif
};
- if (UCOO_CONFIG_HAL_USB_STREAM_NB > 1)
+ if (CONFIG_UCOO_HAL_USB_STREAM_NB > 1)
{
- for (int i = 0; i < UCOO_CONFIG_HAL_USB_STREAM_NB; i++)
+ for (int i = 0; i < CONFIG_UCOO_HAL_USB_STREAM_NB; i++)
us[i].block (false);
}
char buf[6];
while (1)
{
- for (int i = 0; i < UCOO_CONFIG_HAL_USB_STREAM_NB; i++)
+ for (int i = 0; i < CONFIG_UCOO_HAL_USB_STREAM_NB; i++)
{
int len = us[i].read (buf + 2, sizeof (buf) - 2);
if (len)
@@ -54,7 +54,7 @@ main (int argc, const char **argv)
buf[0] = i + '0';
buf[1] = '>';
len += 2;
- if (UCOO_CONFIG_HAL_USB_STREAM_NB == 1)
+ if (CONFIG_UCOO_HAL_USB_STREAM_NB == 1)
us[i].write (buf, len);
else
{
diff --git a/ucoo/hal/usb/usb.stm32.cc b/ucoo/hal/usb/usb.stm32.cc
index 37595e8..93f1782 100644
--- a/ucoo/hal/usb/usb.stm32.cc
+++ b/ucoo/hal/usb/usb.stm32.cc
@@ -31,7 +31,7 @@
#include "usb_desc.stm32.h"
#if defined (TARGET_stm32f4)
-# if UCOO_CONFIG_HAL_USB_DRIVER_HS
+# if CONFIG_UCOO_HAL_USB_DRIVER_HS
# define usb_isr otg_hs_isr
# define usb_driver otghs_usb_driver
# else
@@ -82,7 +82,7 @@ UsbStreamControl::UsbStreamControl (const char *vendor, const char *product)
strings[0] = vendor;
strings[1] = product;
#if defined (TARGET_stm32f4)
-# if UCOO_CONFIG_HAL_USB_DRIVER_HS
+# if CONFIG_UCOO_HAL_USB_DRIVER_HS
rcc_periph_clock_enable (RCC_OTGHS);
rcc_periph_clock_enable (RCC_GPIOB);
gpio_mode_setup (GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE,
@@ -103,7 +103,7 @@ UsbStreamControl::UsbStreamControl (const char *vendor, const char *product)
strings, lengthof (strings),
usb_control_buffer, sizeof (usb_control_buffer));
usbd_register_set_config_callback (usbdev, set_config);
-#if UCOO_CONFIG_HAL_USB_DRIVER_HS
+#if CONFIG_UCOO_HAL_USB_DRIVER_HS
nvic_enable_irq (NVIC_OTG_HS_IRQ);
#else
nvic_enable_irq (NVIC_OTG_FS_IRQ);
diff --git a/ucoo/hal/usb/usb.stm32.hh b/ucoo/hal/usb/usb.stm32.hh
index 118e883..11ce16c 100644
--- a/ucoo/hal/usb/usb.stm32.hh
+++ b/ucoo/hal/usb/usb.stm32.hh
@@ -26,7 +26,7 @@
#include "ucoo/intf/stream.hh"
#include "ucoo/common.hh"
-#include "config/hal/usb.hh"
+#include "config/ucoo/hal/usb.hh"
#include <libopencm3/usb/usbd.h>
@@ -54,9 +54,9 @@ class UsbStreamControl
static void rx_callback (usbd_device *usbdev, uint8_t ep);
private:
/// Size of endpoints.
- static const int ep_size_ = UCOO_CONFIG_HAL_USB_EP_SIZE;
+ static const int ep_size_ = CONFIG_UCOO_HAL_USB_EP_SIZE;
/// Number of streams (also interfaces or pair of endpoints).
- static const int stream_nb_ = UCOO_CONFIG_HAL_USB_STREAM_NB;
+ static const int stream_nb_ = CONFIG_UCOO_HAL_USB_STREAM_NB;
/// Pointer to the one and only instance.
static UsbStreamControl *instance_;
/// Whether device is currently configured.
diff --git a/ucoo/hal/usb/usb_desc.stm32.c b/ucoo/hal/usb/usb_desc.stm32.c
index 8d6fc87..ae14d14 100644
--- a/ucoo/hal/usb/usb_desc.stm32.c
+++ b/ucoo/hal/usb/usb_desc.stm32.c
@@ -23,7 +23,7 @@
* }}} */
#include "usb_desc.stm32.h"
-#include "config/hal/usb.hh"
+#include "config/ucoo/hal/usb.hh"
const struct usb_device_descriptor usb_desc_dev = {
.bLength = USB_DT_DEVICE_SIZE,
@@ -33,8 +33,8 @@ const struct usb_device_descriptor usb_desc_dev = {
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = 64,
- .idVendor = UCOO_CONFIG_HAL_USB_VENDOR_ID,
- .idProduct = UCOO_CONFIG_HAL_USB_PRODUCT_ID,
+ .idVendor = CONFIG_UCOO_HAL_USB_VENDOR_ID,
+ .idProduct = CONFIG_UCOO_HAL_USB_PRODUCT_ID,
.bcdDevice = 0x0000,
.iManufacturer = 1,
.iProduct = 2,
@@ -48,7 +48,7 @@ static const struct usb_endpoint_descriptor usb_desc_endp_1[] = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x01,
.bmAttributes = USB_ENDPOINT_ATTR_BULK,
- .wMaxPacketSize = UCOO_CONFIG_HAL_USB_EP_SIZE,
+ .wMaxPacketSize = CONFIG_UCOO_HAL_USB_EP_SIZE,
.bInterval = 0,
},
{
@@ -56,7 +56,7 @@ static const struct usb_endpoint_descriptor usb_desc_endp_1[] = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x81,
.bmAttributes = USB_ENDPOINT_ATTR_BULK,
- .wMaxPacketSize = UCOO_CONFIG_HAL_USB_EP_SIZE,
+ .wMaxPacketSize = CONFIG_UCOO_HAL_USB_EP_SIZE,
.bInterval = 0,
},
};
@@ -77,7 +77,7 @@ static const struct usb_interface_descriptor usb_desc_iface_1[] = {
},
};
-#if UCOO_CONFIG_HAL_USB_STREAM_NB >= 2
+#if CONFIG_UCOO_HAL_USB_STREAM_NB >= 2
static const struct usb_endpoint_descriptor usb_desc_endp_2[] = {
{
@@ -85,7 +85,7 @@ static const struct usb_endpoint_descriptor usb_desc_endp_2[] = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x02,
.bmAttributes = USB_ENDPOINT_ATTR_BULK,
- .wMaxPacketSize = UCOO_CONFIG_HAL_USB_EP_SIZE,
+ .wMaxPacketSize = CONFIG_UCOO_HAL_USB_EP_SIZE,
.bInterval = 0,
},
{
@@ -93,7 +93,7 @@ static const struct usb_endpoint_descriptor usb_desc_endp_2[] = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x82,
.bmAttributes = USB_ENDPOINT_ATTR_BULK,
- .wMaxPacketSize = UCOO_CONFIG_HAL_USB_EP_SIZE,
+ .wMaxPacketSize = CONFIG_UCOO_HAL_USB_EP_SIZE,
.bInterval = 0,
},
};
@@ -114,9 +114,9 @@ static const struct usb_interface_descriptor usb_desc_iface_2[] = {
},
};
-#endif /* UCOO_CONFIG_HAL_USB_STREAM_NB >= 2 */
+#endif /* CONFIG_UCOO_HAL_USB_STREAM_NB >= 2 */
-#if UCOO_CONFIG_HAL_USB_STREAM_NB >= 3
+#if CONFIG_UCOO_HAL_USB_STREAM_NB >= 3
static const struct usb_endpoint_descriptor usb_desc_endp_3[] = {
{
@@ -124,7 +124,7 @@ static const struct usb_endpoint_descriptor usb_desc_endp_3[] = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x03,
.bmAttributes = USB_ENDPOINT_ATTR_BULK,
- .wMaxPacketSize = UCOO_CONFIG_HAL_USB_EP_SIZE,
+ .wMaxPacketSize = CONFIG_UCOO_HAL_USB_EP_SIZE,
.bInterval = 0,
},
{
@@ -132,7 +132,7 @@ static const struct usb_endpoint_descriptor usb_desc_endp_3[] = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = 0x83,
.bmAttributes = USB_ENDPOINT_ATTR_BULK,
- .wMaxPacketSize = UCOO_CONFIG_HAL_USB_EP_SIZE,
+ .wMaxPacketSize = CONFIG_UCOO_HAL_USB_EP_SIZE,
.bInterval = 0,
},
};
@@ -153,9 +153,9 @@ static const struct usb_interface_descriptor usb_desc_iface_3[] = {
},
};
-#endif /* UCOO_CONFIG_HAL_USB_STREAM_NB >= 3 */
+#endif /* CONFIG_UCOO_HAL_USB_STREAM_NB >= 3 */
-#if UCOO_CONFIG_HAL_USB_STREAM_NB > 3
+#if CONFIG_UCOO_HAL_USB_STREAM_NB > 3
# error "too many streams requested"
#endif
@@ -164,13 +164,13 @@ static const struct usb_interface usb_desc_ifaces[] = {
.num_altsetting = 1,
.altsetting = usb_desc_iface_1,
},
-#if UCOO_CONFIG_HAL_USB_STREAM_NB >= 2
+#if CONFIG_UCOO_HAL_USB_STREAM_NB >= 2
{
.num_altsetting = 1,
.altsetting = usb_desc_iface_2,
},
#endif
-#if UCOO_CONFIG_HAL_USB_STREAM_NB >= 3
+#if CONFIG_UCOO_HAL_USB_STREAM_NB >= 3
{
.num_altsetting = 1,
.altsetting = usb_desc_iface_3,
@@ -182,11 +182,11 @@ const struct usb_config_descriptor usb_desc_config = {
.bLength = USB_DT_CONFIGURATION_SIZE,
.bDescriptorType = USB_DT_CONFIGURATION,
.wTotalLength = 0,
- .bNumInterfaces = UCOO_CONFIG_HAL_USB_STREAM_NB,
+ .bNumInterfaces = CONFIG_UCOO_HAL_USB_STREAM_NB,
.bConfigurationValue = 1,
.iConfiguration = 0,
- .bmAttributes = 0x80 | (UCOO_CONFIG_HAL_USB_SELF_POWERED ? 0x40 : 0),
- .bMaxPower = UCOO_CONFIG_HAL_USB_MAX_POWER / 2,
+ .bmAttributes = 0x80 | (CONFIG_UCOO_HAL_USB_SELF_POWERED ? 0x40 : 0),
+ .bMaxPower = CONFIG_UCOO_HAL_USB_MAX_POWER / 2,
.interface = usb_desc_ifaces,
};
diff --git a/ucoo/intf/Module b/ucoo/intf/Module
index fb0aec1..db0f820 100644
--- a/ucoo/intf/Module
+++ b/ucoo/intf/Module
@@ -1 +1 @@
-intf_SOURCES = stream.cc spi_master.cc lcd.cc
+ucoo_intf_SOURCES = stream.cc spi_master.cc lcd.cc
diff --git a/ucoo/utils/Module b/ucoo/utils/Module
index a37070f..1d101e4 100644
--- a/ucoo/utils/Module
+++ b/ucoo/utils/Module
@@ -1 +1 @@
-utils_SOURCES := delay.arm.cc crc.cc
+ucoo_utils_SOURCES := delay.arm.cc crc.cc
diff --git a/ucoo/utils/test/Makefile b/ucoo/utils/test/Makefile
index 01fb2ce..e490582 100644
--- a/ucoo/utils/test/Makefile
+++ b/ucoo/utils/test/Makefile
@@ -7,6 +7,6 @@ test_fifo_SOURCES = test_fifo.cc
test_delay_SOURCES = test_delay.cc
test_crc_SOURCES = test_crc.cc
-MODULES = utils base/test hal/usb
+MODULES = ucoo/utils ucoo/base/test ucoo/hal/usb
include $(BASE)/build/top.mk