Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Paul-Louis Harraud
escalade
Commits
7cc3ad89
Commit
7cc3ad89
authored
May 31, 2021
by
Camille Segall
Browse files
re add attiny.c
parent
4046d89c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
stm32/src/attiny.c
stm32/src/attiny.c
+29
-0
No files found.
stm32/src/attiny.c
0 → 100644
View file @
7cc3ad89
#include "attiny.h"
#include <stdlib.h>
attiny
new_slave
(
void
){
attiny
slave
;
slave
.
stateled
=
0
;
slave
.
adresse
=
0
;
return
slave
;
}
attiny
define_slave
(
char
*
buffer
){
attiny
slave
;
slave
.
stateled
=
buffer
[
0
]
-
48
;
if
(
buffer
[
1
]
<
57
&&
buffer
[
2
]
<
57
)
{
slave
.
adresse
=
((
buffer
[
1
]
-
48
)
*
16
+
buffer
[
2
]
-
48
)
*
2
;
}
else
if
(
buffer
[
1
]
>
64
&&
buffer
[
2
]
<
57
)
{
slave
.
adresse
=
((
buffer
[
1
]
-
55
)
*
16
+
buffer
[
2
]
-
48
)
*
2
;
}
else
if
(
buffer
[
1
]
<
57
&&
buffer
[
2
]
>
64
)
{
slave
.
adresse
=
((
buffer
[
1
]
-
48
)
*
16
+
buffer
[
2
]
-
55
)
*
2
;
}
else
if
(
buffer
[
1
]
>
64
&&
buffer
[
2
]
>
64
)
{
slave
.
adresse
=
((
buffer
[
1
]
-
55
)
*
16
+
buffer
[
2
]
-
55
)
*
2
;
}
return
slave
;
}
Write
Preview
Markdown
is supported
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