diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-09-26 10:25:07 -0400 |
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-09-26 10:25:07 -0400 |
| commit | 0062ce3d8c64ed7b0cf0c94e8dcc2cc316df4fb1 (patch) | |
| tree | a89bca21c59fb9b5f88532b24628ba05258115f6 /project/Core/Src | |
| parent | 86130c8747a4af7ce93f4ac93d1c4d9c94c917eb (diff) | |
| download | 340-repo-Sowgro-0062ce3d8c64ed7b0cf0c94e8dcc2cc316df4fb1.tar.gz 340-repo-Sowgro-0062ce3d8c64ed7b0cf0c94e8dcc2cc316df4fb1.tar.bz2 340-repo-Sowgro-0062ce3d8c64ed7b0cf0c94e8dcc2cc316df4fb1.zip | |
submit activity6
Diffstat (limited to '')
| -rw-r--r-- | project/Core/Src/Activties/activity4.c (renamed from project/Core/Src/Activties/midi_header.c) | 2 | ||||
| -rw-r--r-- | project/Core/Src/Activties/activity5.c | 2 | ||||
| -rw-r--r-- | project/Core/Src/Activties/activity6.c | 35 | ||||
| -rw-r--r-- | project/Core/Src/main.c | 9 |
4 files changed, 42 insertions, 6 deletions
diff --git a/project/Core/Src/Activties/midi_header.c b/project/Core/Src/Activties/activity4.c index de3dc68..44653e1 100644 --- a/project/Core/Src/Activties/midi_header.c +++ b/project/Core/Src/Activties/activity4.c @@ -18,7 +18,7 @@ typedef struct { uint16_t division; } header; -void run() { +void activity4_run() { header* p_header; p_header = (header *) (get_song(0).p_song); diff --git a/project/Core/Src/Activties/activity5.c b/project/Core/Src/Activties/activity5.c index 9201f70..f214ca2 100644 --- a/project/Core/Src/Activties/activity5.c +++ b/project/Core/Src/Activties/activity5.c @@ -17,7 +17,7 @@ void read_and_print_char() { } } -void run2() { +void activity5_run() { for(;;) { read_and_print_char(); } diff --git a/project/Core/Src/Activties/activity6.c b/project/Core/Src/Activties/activity6.c new file mode 100644 index 0000000..c32c03e --- /dev/null +++ b/project/Core/Src/Activties/activity6.c @@ -0,0 +1,35 @@ +/* + * activity6.c + * + * Created on: Sep 25, 2025 + * Author: sowgro + */ + +#include <stdint.h> +#include <stdio.h> + +typedef struct { + uint32_t CSR; + uint32_t RVR; + uint32_t CVR; + uint32_t CALIB; +} sys_tick; + + +void activity6_run() { + sys_tick *s = (sys_tick *) 0xE000E010; + printf("%lu\r\n", s->CVR); + + s->RVR = 8000000; + s->CSR = 1; + + int count = 0; + for(;;) { + if (!s->CVR) { + printf("%i\r\n", count); + count++; + } + } + + +} diff --git a/project/Core/Src/main.c b/project/Core/Src/main.c index ff819f2..0ea5a3f 100644 --- a/project/Core/Src/main.c +++ b/project/Core/Src/main.c @@ -8,9 +8,9 @@ #include "LED.h" #include "UART.h" #include "demo.h" +#include "activity4.h" #include "activity5.h" -#include "midi_header.h" - +#include "activity6.h" #include <stdio.h> int main(void){ @@ -22,8 +22,9 @@ int main(void){ // printf("Hello world \r\n"); -// run(); - run2(); +// activity4_run(); +// activity5_run(); + activity6_run(); // application run function // run_demo() ; |
