UAVCAN: Add a patch to make the verified version of UAVCAN compatible with the current NuttX code base

This commit is contained in:
Gregory Nutt 2016-02-15 19:11:52 -06:00
parent d5c3bae6cd
commit 7537a963b4
3 changed files with 41 additions and 0 deletions

View File

@ -47,6 +47,7 @@ LIBUAVCAN_UNPACKNAME = libuavcan-$(LIBUAVCAN_VERSION)
LIBUAVCAN_PACKNAME = $(LIBUAVCAN_UNPACKNAME)$(PACKEXT) LIBUAVCAN_PACKNAME = $(LIBUAVCAN_UNPACKNAME)$(PACKEXT)
LIBUAVCAN_DSDL_PATH = libuavcan$(DELIM)dsdl LIBUAVCAN_DSDL_PATH = libuavcan$(DELIM)dsdl
LIBUAVCAN_PYUAVCAN_PATH = libuavcan$(DELIM)libuavcan$(DELIM)dsdl_compiler$(DELIM)pyuavcan LIBUAVCAN_PYUAVCAN_PATH = libuavcan$(DELIM)libuavcan$(DELIM)dsdl_compiler$(DELIM)pyuavcan
LIBUAVCAN_PATCHNAME = nuttx-$(LIBUAVCAN_VERSION).patch
DSDL_URL = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_DSDL_URL))) DSDL_URL = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_DSDL_URL)))
DSDL_VERSION = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_DSDL_VERSION))) DSDL_VERSION = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_DSDL_VERSION)))
@ -204,6 +205,9 @@ $(PYUAVCAN_UNPACKNAME): $(PYUAVCAN_PACKNAME)
libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME) libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME)
$(Q) cp -R $(LIBUAVCAN_UNPACKNAME) libuavcan $(Q) cp -R $(LIBUAVCAN_UNPACKNAME) libuavcan
$(Q) if [ -r $(LIBUAVCAN_PATCHNAME) ]; then \
cat $(LIBUAVCAN_PATCHNAME) | patch -p0 || { echo "ERROR: Patch failed"; exit 1; }; \
fi
$(call DELDIR, $(LIBUAVCAN_DSDL_PATH)) $(call DELDIR, $(LIBUAVCAN_DSDL_PATH))
$(Q) cp -R $(DSDL_UNPACKNAME) $(LIBUAVCAN_DSDL_PATH) $(Q) cp -R $(DSDL_UNPACKNAME) $(LIBUAVCAN_DSDL_PATH)
$(call DELDIR, $(LIBUAVCAN_PYUAVCAN_PATH)) $(call DELDIR, $(LIBUAVCAN_PYUAVCAN_PATH))
@ -244,6 +248,7 @@ clean:
distclean: clean distclean: clean
$(call DELFILE, Make.dep) $(call DELFILE, Make.dep)
$(call DELFILE, .depend) $(call DELFILE, .depend)
$(call DEFLFILE, .libuavcan_patched)
$(call DELDIR, $(LIBUAVCAN_UNPACKNAME)) $(call DELDIR, $(LIBUAVCAN_UNPACKNAME))
$(call DELFILE, $(LIBUAVCAN_PACKNAME)) $(call DELFILE, $(LIBUAVCAN_PACKNAME))
$(call DELDIR, $(DSDL_UNPACKNAME)) $(call DELDIR, $(DSDL_UNPACKNAME))

View File

@ -0,0 +1,25 @@
--- libuavcan/libuavcan_drivers/stm32/driver/src/internal.hpp.orig 2016-02-15 18:43:32.799005338 -0600
+++ libuavcan/libuavcan_drivers/stm32/driver/src/internal.hpp 2016-02-15 18:45:09.621004803 -0600
@@ -9,6 +9,7 @@
#if UAVCAN_STM32_CHIBIOS
# include <hal.h>
#elif UAVCAN_STM32_NUTTX
+# include <nuttx/irq.h>
# include <nuttx/arch.h>
# include <arch/board/board.h>
# include <chip/stm32_tim.h>
@@ -97,12 +98,12 @@
const irqstate_t flags_;
CriticalSectionLocker()
- : flags_(irqsave())
+ : flags_(enter_critical_section())
{ }
~CriticalSectionLocker()
{
- irqrestore(flags_);
+ leave_critical_section(flags_);
}
};

11
examples/uavcan/.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
/Make.dep
/.depend
/.built
/*.asm
/*.obj
/*.rel
/*.lst
/*.sym
/*.adb
/*.lib
/*.src