Add basic CMSIS core headers (#384)
Adds a new cmsis_core INTERFACE library, which provides the basic CMSIS macros/definitions, and RP2040.h and system_RP2040.h By default the isr_ methods in the vector table are renamed to their CMSIS versions, but this can be overridden by defining PICO_CMSIS_RENAME_EXCEPTIONS=0
This commit is contained in:
4
test/cmsis_test/CMakeLists.txt
Normal file
4
test/cmsis_test/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
add_executable(cmsis_test cmsis_test.c)
|
||||
|
||||
target_link_libraries(cmsis_test PRIVATE pico_stdlib cmsis_core)
|
||||
pico_add_extra_outputs(cmsis_test)
|
23
test/cmsis_test/cmsis_test.c
Normal file
23
test/cmsis_test/cmsis_test.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "RP2040.h"
|
||||
#include "pico/stdio.h"
|
||||
|
||||
__STATIC_FORCEINLINE int some_function(int i) {
|
||||
return __CLZ(i);
|
||||
}
|
||||
|
||||
static bool pendsv_called;
|
||||
|
||||
void PendSV_Handler(void) {
|
||||
pendsv_called = true;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
stdio_init_all();
|
||||
for(int i=0;i<10;i++) {
|
||||
printf("%d %d\n", i, some_function(i));
|
||||
}
|
||||
SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
|
||||
puts(pendsv_called ? "SUCCESS" : "FAILURE");
|
||||
}
|
Reference in New Issue
Block a user