summaryrefslogtreecommitdiff
path: root/project/Core/Src/Activties
diff options
context:
space:
mode:
Diffstat (limited to 'project/Core/Src/Activties')
-rw-r--r--project/Core/Src/Activties/activity10.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/project/Core/Src/Activties/activity10.c b/project/Core/Src/Activties/activity10.c
new file mode 100644
index 0000000..78261ff
--- /dev/null
+++ b/project/Core/Src/Activties/activity10.c
@@ -0,0 +1,27 @@
+/*
+ * activity10.c
+ *
+ * Created on: Oct 28, 2025
+ * Author: sowgro
+ */
+// create a clock that prints once per second using interrupts
+// configure systick handler for interrupts
+// write interrupt handler
+// print every second
+
+#include "systick.h"
+#include <stdio.h>
+
+void activity10_run() {
+ init_systick();
+}
+
+void SysTick_Handler() {
+ static int i = 0;
+ i++;
+
+ if (!(i & 1023)) {
+ printf("%d\r\n", i>>10);
+ }
+
+}