1 #include <stdio.h>
2 
3 #include "RP2040.h"
4 #include "pico/stdio.h"
5 
some_function(int i)6 __STATIC_FORCEINLINE int some_function(int i) {
7     return __CLZ(i);
8 }
9 
10 static bool pendsv_called;
11 
PendSV_Handler(void)12 void PendSV_Handler(void) {
13     pendsv_called = true;
14 }
15 
main(void)16 int main(void) {
17     stdio_init_all();
18     for(int i=0;i<10;i++) {
19         printf("%d %d\n", i, some_function(i));
20     }
21     SCB->ICSR = SCB_ICSR_PENDSVSET_Msk;
22     puts(pendsv_called ? "SUCCESS" : "FAILURE");
23 }
24