summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-01-25 18:34:05 +0100
committerxengineering <me@xengineering.eu>2022-01-25 18:34:05 +0100
commit2c72108ae0644a4317a00928cbb01d9ca3821a59 (patch)
treedcc8757ce09b08106da175b14990251892fece9d
parent2018ed033b58da6808d28fe76ff7b3005592e88d (diff)
downloadledcontrol-2c72108ae0644a4317a00928cbb01d9ca3821a59.tar
ledcontrol-2c72108ae0644a4317a00928cbb01d9ca3821a59.tar.zst
ledcontrol-2c72108ae0644a4317a00928cbb01d9ca3821a59.zip
Add license header and minor improvements
-rw-r--r--firmware/main.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/firmware/main.c b/firmware/main.c
index 8e39278..264d3f5 100644
--- a/firmware/main.c
+++ b/firmware/main.c
@@ -1,6 +1,27 @@
// vim: shiftwidth=4 tabstop=4 noexpandtab
+/*
+ ledcontrol firmware
+ Copyright (C) 2021 xengineering
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+ Contact: me@xengineering.eu
+*/
+
+
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/timer.h>
@@ -15,11 +36,10 @@ static void timer_init(void);
void tim2_isr(void);
-void main(void)
+int main(void)
{
clock_init();
gpio_init();
- gpio_clear(GPIOC, GPIO13); // set onboard LED on
nvic_init();
timer_init();
@@ -56,6 +76,7 @@ static void gpio_init(void)
GPIO_CNF_OUTPUT_PUSHPULL,
GPIO13
);
+ gpio_clear(GPIOC, GPIO13); // set initial value to 'on'
// setup PB0 (connected to TIM3_CH3) for PWM
gpio_set_mode(