Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3_cpp_extensions.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisin Dmitriy <d.lisin@thirdpin.ru>2019-06-07 17:33:11 +0300
committerLisin Dmitriy <d.lisin@thirdpin.ru>2019-06-07 17:33:11 +0300
commitef672e281ec2c607aac97f0f0621e84e83937545 (patch)
tree9323326e5e0e7ef8a77fa0cb2b1c00240752f340
parentad9af406e25eb137e70b1792c1ed140cb2d893fd (diff)
FEAT: Add define to disable library interrupt service
-rw-r--r--README.rst3
-rw-r--r--cm3cpp/irq/irq.cpp4
-rw-r--r--cm3cpp/irq/irq.hpp2
3 files changed, 9 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 9b7945c..5f24f8e 100644
--- a/README.rst
+++ b/README.rst
@@ -31,3 +31,6 @@ Library defines:
- ``CM3CPP_ENABLE_IMPLISIT_DESTRUCTOR_CALLS`` — do not call
``assert(false)`` if dangerous destructor of library class is
called.
+
+ - ``CM3CPP_CUSTOM_INTERRUPT_SERVICE`` — disable IInterruptable
+ and leave all opencm3 interrupt functions undeclared.
diff --git a/cm3cpp/irq/irq.cpp b/cm3cpp/irq/irq.cpp
index bc7320a..bcff9ff 100644
--- a/cm3cpp/irq/irq.cpp
+++ b/cm3cpp/irq/irq.cpp
@@ -11,6 +11,8 @@
namespace cm3cpp {
+#ifndef CM3CPP_CUSTOM_INTERRUPT_SERVICE
+
struct EmptyInterrupt : public IInterruptable
{
void call() {}
@@ -223,4 +225,6 @@ DEFINE_CALLBACK(dma2d_isr, ISR_DMA2D)
END_DECLS
+#endif // CM3CPP_CUSTOM_INTERRUPT_SERVICE
+
} // namespace cm3cpp
diff --git a/cm3cpp/irq/irq.hpp b/cm3cpp/irq/irq.hpp
index 1f09bdf..69b6fd4 100644
--- a/cm3cpp/irq/irq.hpp
+++ b/cm3cpp/irq/irq.hpp
@@ -193,6 +193,7 @@ enum Interrupt : uint32_t
};
#endif
+#ifndef CM3CPP_CUSTOM_INTERRUPT_SERVICE
class IInterruptable
{
public:
@@ -203,5 +204,6 @@ class IInterruptable
IInterruptable* interrupt_owner);
virtual void call() = 0;
};
+#endif
} /* namespace cm3cpp */