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/Activties/activity6.c | |
| 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 'project/Core/Src/Activties/activity6.c')
| -rw-r--r-- | project/Core/Src/Activties/activity6.c | 35 |
1 files changed, 35 insertions, 0 deletions
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++; + } + } + + +} |
