aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfateba <tfateba@35acf78f-673a-0410-8e92-d51de3d6d3f4>2016-12-04 15:27:31 +0000
committertfateba <tfateba@35acf78f-673a-0410-8e92-d51de3d6d3f4>2016-12-04 15:27:31 +0000
commitb4bb9f7ddce01ceeaf5a25bbfca2cebcf211acec (patch)
tree5646798f6559a6e069d90aa3657e3f03f19de186
parent8c7eea1196e21c0701ec7d8415982726f35fca89 (diff)
downloadChibiOS-b4bb9f7ddce01ceeaf5a25bbfca2cebcf211acec.tar.gz
ChibiOS-b4bb9f7ddce01ceeaf5a25bbfca2cebcf211acec.tar.bz2
ChibiOS-b4bb9f7ddce01ceeaf5a25bbfca2cebcf211acec.zip
Fixed building error and invalid configuration files for AVR Arduino Uno demo.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9951 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--demos/AVR/RT-ARDUINOUNO/Makefile8
-rw-r--r--demos/AVR/RT-ARDUINOUNO/chconf.h92
-rw-r--r--demos/AVR/RT-ARDUINOUNO/main.c2
-rw-r--r--demos/AVR/RT-ARDUINOUNO/mcuconf.h10
4 files changed, 74 insertions, 38 deletions
diff --git a/demos/AVR/RT-ARDUINOUNO/Makefile b/demos/AVR/RT-ARDUINOUNO/Makefile
index 7911b1054..e3f4560ee 100644
--- a/demos/AVR/RT-ARDUINOUNO/Makefile
+++ b/demos/AVR/RT-ARDUINOUNO/Makefile
@@ -254,12 +254,12 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
# Type: avrdude -c ?
# to get a full listing.
#
-AVRDUDE_PROGRAMMER = avrisp2
+AVRDUDE_PROGRAMMER = arduino
# com1 = serial port. Use lpt1 to connect to parallel port.
-AVRDUDE_PORT = /dev/tty.usbmodem00034091
+AVRDUDE_PORT = /dev/ttyACM0
-AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+AVRDUDE_WRITE_FLASH = -D -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
# Uncomment the following if you want avrdude's erase cycle counter.
@@ -278,7 +278,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
AVRDUDE_FLAGS = -p $(MCU)
AVRDUDE_FLAGS += -P $(AVRDUDE_PORT)
-AVRDUDE_FLAGS += -b 57600
+AVRDUDE_FLAGS += -b 115200
AVRDUDE_FLAGS += -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
diff --git a/demos/AVR/RT-ARDUINOUNO/chconf.h b/demos/AVR/RT-ARDUINOUNO/chconf.h
index 0e999aa50..4b231009b 100644
--- a/demos/AVR/RT-ARDUINOUNO/chconf.h
+++ b/demos/AVR/RT-ARDUINOUNO/chconf.h
@@ -28,6 +28,8 @@
#ifndef CHCONF_H
#define CHCONF_H
+#define _CHIBIOS_RT_CONF_
+
/*===========================================================================*/
/**
* @name System timers settings
@@ -181,16 +183,6 @@
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
/**
- * @brief Atomic semaphore API.
- * @details If enabled then the semaphores the @p chSemSignalWait() API
- * is included in the kernel.
- *
- * @note The default is @p TRUE.
- * @note Requires @p CH_CFG_USE_SEMAPHORES.
- */
-#define CH_USE_SEMSW TRUE
-
-/**
* @brief Mutexes APIs.
* @details If enabled then the mutexes APIs are included in the kernel.
*
@@ -297,18 +289,6 @@
#define CH_CFG_USE_HEAP FALSE
/**
- * @brief C-runtime allocator.
- * @details If enabled the the heap allocator APIs just wrap the C-runtime
- * @p malloc() and @p free() functions.
- *
- * @note The default is @p FALSE.
- * @note Requires @p CH_CFG_USE_HEAP.
- * @note The C-runtime may or may not require @p CH_CFG_USE_MEMCORE, see the
- * appropriate documentation.
- */
-#define CH_CFG_USE_MALLOC_HEAP FALSE
-
-/**
* @brief Memory Pools Allocator APIs.
* @details If enabled then the memory pools allocator APIs are included
* in the kernel.
@@ -378,7 +358,14 @@
*
* @note The default is @p FALSE.
*/
-#define CH_DBG_ENABLE_TRACE FALSE
+#define CH_DBG_ENABLE_TRACE CH_DBG_TRACE_MASK_DISABLED
+
+/**
+ * @brief Trace buffer entries.
+ * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
+ * different from @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_BUFFER_SIZE 128
/**
* @brief Debug option, stack checks.
@@ -424,9 +411,9 @@
/**
* @brief Threads descriptor structure extension.
- * @details User fields added to the end of the @p Thread structure.
+ * @details User fields added to the end of the @p thread_t structure.
*/
-#define THREAD_EXT_FIELDS \
+#define CH_CFG_THREAD_EXTRA_FIELDS \
/* Add threads custom fields here.*/
/**
@@ -436,19 +423,15 @@
* @note It is invoked from within @p chThdInit() and implicitly from all
* the threads creation APIs.
*/
-#define THREAD_EXT_INIT_HOOK(tp) { \
+#define CH_CFG_THREAD_INIT_HOOK(tp) { \
/* Add threads initialization code here.*/ \
}
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
- *
- * @note It is inserted into lock zone.
- * @note It is also invoked when the threads simply return in order to
- * terminate.
*/
-#define THREAD_EXT_EXIT_HOOK(tp) { \
+#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
}
@@ -461,6 +444,40 @@
}
/**
+ * @brief ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
+ /* IRQ prologue code here.*/ \
+}
+
+/**
+ * @brief ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
+ /* IRQ epilogue code here.*/ \
+}
+
+/**
+ * @brief Idle thread enter hook.
+ * @note This hook is invoked within a critical zone, no OS functions
+ * should be invoked from here.
+ * @note This macro can be used to activate a power saving mode.
+ */
+#define CH_CFG_IDLE_ENTER_HOOK() { \
+ /* Idle-enter code here.*/ \
+}
+
+/**
+ * @brief Idle thread leave hook.
+ * @note This hook is invoked within a critical zone, no OS functions
+ * should be invoked from here.
+ * @note This macro can be used to deactivate a power saving mode.
+ */
+#define CH_CFG_IDLE_LEAVE_HOOK() { \
+ /* Idle-leave code here.*/ \
+}
+
+/**
* @brief Idle Loop hook.
* @details This hook is continuously invoked by the idle thread loop.
*/
@@ -473,7 +490,7 @@
* @details This hook is invoked in the system tick handler immediately
* after processing the virtual timers queue.
*/
-#define SYSTEM_TICK_EVENT_HOOK() { \
+#define CH_CFG_SYSTEM_TICK_HOOK() { \
/* System tick event code here.*/ \
}
@@ -482,10 +499,19 @@
* @details This hook is invoked in case to a system halting error before
* the system is halted.
*/
-#define SYSTEM_HALT_HOOK() { \
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
/* System halt code here.*/ \
}
+/**
+ * @brief Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ * trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) { \
+ /* Trace code here.*/ \
+}
+
/** @} */
/*===========================================================================*/
diff --git a/demos/AVR/RT-ARDUINOUNO/main.c b/demos/AVR/RT-ARDUINOUNO/main.c
index a182b2058..4b25768f4 100644
--- a/demos/AVR/RT-ARDUINOUNO/main.c
+++ b/demos/AVR/RT-ARDUINOUNO/main.c
@@ -17,7 +17,7 @@
#include "ch.h"
#include "hal.h"
-static WORKING_AREA(waThread1, 32);
+static THD_WORKING_AREA(waThread1, 32);
static THD_FUNCTION(Thread1, arg) {
(void)arg;
diff --git a/demos/AVR/RT-ARDUINOUNO/mcuconf.h b/demos/AVR/RT-ARDUINOUNO/mcuconf.h
index c801a12d3..316262607 100644
--- a/demos/AVR/RT-ARDUINOUNO/mcuconf.h
+++ b/demos/AVR/RT-ARDUINOUNO/mcuconf.h
@@ -31,6 +31,16 @@
#define AVR_ADC_USE_ADC1 FALSE
/*
+ * EXT drivers system settings.
+ */
+#define AVR_EXT_USE_INT0 FALSE
+#define AVR_EXT_USE_INT1 FALSE
+#define AVR_EXT_USE_INT2 FALSE
+#define AVR_EXT_USE_INT3 FALSE
+#define AVR_EXT_USE_INT4 FALSE
+#define AVR_EXT_USE_INT5 FALSE
+
+/*
* CAN driver system settings.
*/