summaryrefslogtreecommitdiff
path: root/project/Core/Src/Activties/activity6.c
blob: c32c03e5add7e3f19dbc9ea00c7879310fde55ae (plain) (blame)
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
/*
 * 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++;
		}
	}


}