-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.c
More file actions
44 lines (34 loc) · 665 Bytes
/
main.c
File metadata and controls
44 lines (34 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "picos.h"
#include "pico/stdlib.h"
#include <stdio.h>
PICOS_STACK(test, 128);
void test() {
volatile uint8_t i = 0;
for (;;) {
i++;
}
}
PICOS_STACK(test2, 128);
void test2() {
// Example from: https://wiki.segger.com/Cortex-M_Fault#Illegal_Memory_Write
int r = 0;
volatile unsigned int *p = (unsigned int *)0x00100000;
*p = 0x00BADA55;
for (;;) {
}
}
PICOS_STACK(test3, 128);
void test3() {
volatile uint8_t i = 0;
for (;;) {
i++;
}
}
int main() {
stdio_init_all();
picos_init();
PICOS_THREAD(test);
PICOS_THREAD(test2);
PICOS_THREAD(test3);
picos_start();
}