Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Kroužek
safe-soldering-station
Commits
2a84f0aa
Commit
2a84f0aa
authored
Jun 12, 2016
by
Martin Vítek
Browse files
Add wellcome()
parent
7befa503
Changes
1
Hide whitespace changes
Inline
Side-by-side
SW/main.cpp
View file @
2a84f0aa
...
...
@@ -12,6 +12,12 @@ static void uart_tx(const unsigned char data);
static
uint8_t
uart_rx
();
static
void
uart_string
(
const
char
*
text
);
static
void
wellcome
();
const
HD44780_config
lcd_config
=
{
PORTD
,
PIN2_bm
,
PIN3_bm
,
PIN4_bm
,
PIN5_bm
,
PIN6_bm
,
PIN7_bm
};
HD44780
lcd
(
lcd_config
);
int
main
()
{
gpio
led
(
PORTD
,
PIN0_bm
);
...
...
@@ -21,22 +27,14 @@ int main()
backlight
.
set_direction
(
OUTPUT
);
backlight
.
on
();
clock_ini
();
uart_ini
();
uart_string
(
"
\n\r
Safe Soldering Station v1.0
\n\r
"
);
PORTC
.
DIRSET
=
PIN4_bm
|
PIN5_bm
|
PIN6_bm
|
PIN7_bm
;
PORTC
.
OUTCLR
=
PIN4_bm
|
PIN5_bm
|
PIN6_bm
|
PIN7_bm
;
const
HD44780_config
lcd_config
=
{
PORTD
,
PIN2_bm
,
PIN3_bm
,
PIN4_bm
,
PIN5_bm
,
PIN6_bm
,
PIN7_bm
};
HD44780
lcd
(
lcd_config
);
clock_ini
();
uart_ini
();
lcd
.
init
();
lcd
.
gotoxy_new
(
0
,
0
);
lcd
.
write_text
(
"Safe Soldering"
);
lcd
.
gotoxy_new
(
1
,
4
);
lcd
.
write_text
(
"Station v1.0"
);
wellcome
();
for
(;;)
{
...
...
@@ -112,3 +110,20 @@ static void uart_string(const char *text)
text
++
;
}
}
static
void
wellcome
()
{
uart_string
(
"
\n\r
Safe Soldering Station v1.0
\n\r
"
);
lcd
.
gotoxy_new
(
0
,
0
);
lcd
.
write_text
(
"Safe Soldering"
);
lcd
.
gotoxy_new
(
1
,
4
);
lcd
.
write_text
(
"Station v1.0"
);
_delay_ms
(
750
);
lcd
.
clear
();
lcd
.
gotoxy_new
(
0
,
0
);
lcd
.
write_text
(
"by OK1KVK.cz"
);
lcd
.
gotoxy_new
(
1
,
12
);
lcd
.
write_text
(
"2016"
);
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment