summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhysick <96335032+DegustatorPonos@users.noreply.github.com>2025-12-18 16:37:25 +0500
committerPhysick <96335032+DegustatorPonos@users.noreply.github.com>2025-12-18 16:37:25 +0500
commitdf6f89abeab60e91a348484cdceadb758290f234 (patch)
treee666933a0906cf80d063e71c6ac3c62827f8a5db /src/main.c
Template init
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..7b446ca
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,14 @@
+#define STM32F1
+#include <libopencm3/stm32/rcc.h>
+#include <libopencm3/stm32/gpio.h>
+
+int main(void) {
+ rcc_periph_clock_enable(RCC_GPIOC);
+
+ gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO13);
+ while (1) {
+ for (int i = 0; i < 1000000; i++)
+ __asm__("nop");
+ gpio_toggle(GPIOC, GPIO13);
+ }
+}