Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
IamJH_RPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
한이지
IamJH_RPI
Commits
f1580ae7
Commit
f1580ae7
authored
1 year ago
by
sunwoo Song
Browse files
Options
Downloads
Patches
Plain Diff
modify: matrix.c remove test or debugging code
parent
7df10c42
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matrix.c
+23
-97
23 additions, 97 deletions
matrix.c
with
23 additions
and
97 deletions
matrix.c
+
23
−
97
View file @
f1580ae7
...
...
@@ -154,13 +154,6 @@ void draw_dot(int cs, int row, int col)
void
update_matrix
()
{
/* for (int i = 0 ; i < 3; i++) {
for (int j=0;j<8;j++) {
printf("%x ", matrix[i][j]);
} printf("\n");
} printf("\n");
*/
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
GPIOWrite
(
CS
[
0
],
LOW
);
...
...
@@ -172,20 +165,6 @@ void update_matrix()
void
board_to_matrix
()
{
/* for (int i = 0; i < CS_NUM; i++) {
a = 0;
for (int j = 0; j < 8; j++) {
for (int k = 0; k < 8; k++) {
if (board[j][i * 8 + k])
a |= 1;
a <<= 1;
}
a >>= 1;
matrix[i][j] = a;
}
}
*/
memset
(
matrix
,
0
,
sizeof
(
matrix
));
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
...
...
@@ -292,46 +271,6 @@ int move_player(short key)
return
1
;
}
void
test_led
()
{
usleep
(
1000
*
500
);
int
a
=
-
1
;
while
(
1
)
{
memset
(
matrix
,
0
,
sizeof
(
matrix
));
a
=
(
a
+
1
)
&
0x07
;
if
(
a
&
1
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
draw_dot
(
0
,
a
,
i
);
// draw_dot(1, a, i);
// draw_dot(2, a, i);
}
for
(
int
i
=
5
;
i
<=
7
;
i
++
)
draw_dot
(
1
,
a
,
i
);
}
else
{
for
(
int
i
=
4
;
i
<
8
;
i
++
)
{
draw_dot
(
0
,
a
,
i
);
// draw_dot(1, a, i);
// draw_dot(2, a, i);
}
for
(
int
i
=
1
;
i
<=
3
;
i
++
)
draw_dot
(
1
,
a
,
i
);
}
for
(
int
i
=
1
;
i
<
3
;
i
++
)
draw_dot
(
2
,
a
,
i
+
2
);
update_matrix
();
printf
(
"a: %d
\n
"
,
a
);
usleep
(
1000
*
200
);
}
}
void
error_handling
(
char
*
str
)
{
printf
(
"%s
\n
"
,
str
);
...
...
@@ -539,8 +478,6 @@ int func()
while
(
1
)
{
// write(sock, "0", 1);
// usleep(150 * 1000);
usleep
(
100
);
if
(
finished
)
{
...
...
@@ -615,8 +552,7 @@ int main(int argc, char **argv)
memset
(
matrix
,
0
,
sizeof
(
matrix
));
update_matrix
();
if
(
argc
==
3
)
{
char
start_msg
[
2
];
start_msg
[
0
]
=
'0'
;
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
);
...
...
@@ -642,22 +578,12 @@ int main(int argc, char **argv)
break
;
}
}
}
memset
(
matrix
,
0
,
sizeof
(
matrix
));
update_matrix
();
bullets
=
lstnew
(
NULL
);
get_millisec
(
1
);
if
(
argc
==
2
)
{
printf
(
"Hiasdf
\n
"
);
memset
(
matrix
,
0
,
sizeof
(
matrix
));
update_matrix
();
test_led
();
}
else
func
();
return
(
0
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment