QuantumLeaps / qpcpp

QP/C++ Real-Time Embedded Framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
https://www.state-machine.com/products/qp
386 stars 82 forks source link

__NVIC_PRIO_BITS not declared in scope #3

Closed wallarug closed 4 years ago

wallarug commented 4 years ago

Hi there!

I've encounter an error that looks like it is stemming from this repository. I was wondering if I could get some assistance.

I am working on a new port for Adafruit SeeSaw for a SAMD51 board. It depends on the State Machine found in this repository.

StackTrace

Building robohatmm1
lib/qp/extras/fw_log.cpp
In file included from ./lib/qp/include/qpcpp.h:65:0,
                 from ./include/bsp.h:34,
                 from lib/qp/extras/fw_log.cpp:32:
lib/qp/ports/arm-cm/qxk/gnu/qf_port.h:101:56: error: '__NVIC_PRIO_BITS' was not declared in this scope
     #define QF_AWARE_ISR_CMSIS_PRI (QF_BASEPRI >> (8 - __NVIC_PRIO_BITS))
                                                        ^
./lib/qp/include/qassert.h:301:36: note: in definition of macro 'Q_ASSERT_COMPILE'
     extern int_t Q_assert_compile[(test_) ? 1 : -1]
                                    ^~~~~
./include/bsp.h:45:50: note: in expansion of macro 'QF_AWARE_ISR_CMSIS_PRI'
 Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);

It looks like __NVIC_PRIO_BITS is not defined or included. I know that this comes from sam.h but unsure which file I should be including sam.h for qp to work correctly.

Any advise would be greatly appreciated.

Thanks in Advance.

wallarug commented 4 years ago

Hi there,

I sorted this one out all by myself 😄 .

I needed to include it in a file higher up in my project. include/bsp.h which is mentioned in the stack trace above.

Have a good weekend!