generated from hqqeee/STM32F051R8T6_Template_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
43 lines (42 loc) · 765 Bytes
/
main.c
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
36
37
38
39
40
41
42
43
#include "config.h"
#include "irq_handlers.h"
#include "dyn_display.h"
int main(void)
{
rcc_config();
gpio_config();
timer6_config();
timer2_config();
SysTick_Config(SystemCoreClock/1000);
while(1)
{
if(set_time_f)
{
/* while time-setting mode is on last 2 digit is blinking */
for(int i = 0; i < 8000; i++)
{
display_number(key_pressed);
}
for(int i = 0; i < 160000; i++)
{
}
}
if(alarm_time_f)
{
/* blink in alarm-setting mode */
for(int i = 0; i < 8000; i++)
{
display_number(alarm_time);
}
for(int i = 0; i < 160000; i++)
{
}
}
/* if alarm time has come show some animations on display */
if(disp_number == alarm_time)
{
startup_animation();
}
display_number(disp_number);
}
}