summaryrefslogtreecommitdiff
path: root/firmware/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/main.c')
-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(