Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MiniMatrixRPi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MiniMatrixTeam
MiniMatrixRPi
Commits
616116d8
Commit
616116d8
authored
Jun 4, 2021
by
ftomi
Browse files
Options
Downloads
Patches
Plain Diff
Reset, spi speed fix
parent
854cb4d4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test_anim/spisender.cpp
+3
-3
3 additions, 3 deletions
test_anim/spisender.cpp
test_anim/spisender.h
+1
-1
1 addition, 1 deletion
test_anim/spisender.h
with
4 additions
and
4 deletions
test_anim/spisender.cpp
+
3
−
3
View file @
616116d8
...
@@ -11,9 +11,9 @@ SpiSender::SpiSender()
...
@@ -11,9 +11,9 @@ SpiSender::SpiSender()
pinMode
(
resetPin
,
OUTPUT
);
pinMode
(
resetPin
,
OUTPUT
);
pullUpDnControl
(
readyPin
,
PUD_DOWN
);
pullUpDnControl
(
readyPin
,
PUD_DOWN
);
digitalWrite
(
resetPin
,
LOW
);
digitalWrite
(
resetPin
,
LOW
);
usleep
(
1000
00
);
usleep
(
1000
);
digitalWrite
(
resetPin
,
HIGH
);
digitalWrite
(
resetPin
,
HIGH
);
usleep
(
1000
00
);
usleep
(
1000
);
// Wait for startup (doesn't work without it)
fd
=
wiringPiSPISetup
(
SPI_CHANNEL
,
SPI_SPEED
);
fd
=
wiringPiSPISetup
(
SPI_CHANNEL
,
SPI_SPEED
);
uint8_t
dummy
=
0
;
uint8_t
dummy
=
0
;
wiringPiSPIDataRW
(
SPI_CHANNEL
,
&
dummy
,
1
);
wiringPiSPIDataRW
(
SPI_CHANNEL
,
&
dummy
,
1
);
...
@@ -26,7 +26,7 @@ SpiSender::~SpiSender()
...
@@ -26,7 +26,7 @@ SpiSender::~SpiSender()
bool
SpiSender
::
sendFrame
(
const
SpiFrame
&
frame
)
const
bool
SpiSender
::
sendFrame
(
const
SpiFrame
&
frame
)
const
{
{
//
while (!canSend());
while
(
!
canSend
());
uint8_t
dummy
=
0
;
uint8_t
dummy
=
0
;
wiringPiSPIDataRW
(
SPI_CHANNEL
,
(
uint8_t
*
)
frame
.
data
,
64
*
24
*
2
);
wiringPiSPIDataRW
(
SPI_CHANNEL
,
(
uint8_t
*
)
frame
.
data
,
64
*
24
*
2
);
wiringPiSPIDataRW
(
SPI_CHANNEL
,
&
dummy
,
1
);
wiringPiSPIDataRW
(
SPI_CHANNEL
,
&
dummy
,
1
);
...
...
This diff is collapsed.
Click to expand it.
test_anim/spisender.h
+
1
−
1
View file @
616116d8
...
@@ -8,7 +8,7 @@ class SpiSender
...
@@ -8,7 +8,7 @@ class SpiSender
private:
private:
const
int
readyPin
=
6
;
// WiringPi PIN. (22 on header)
const
int
readyPin
=
6
;
// WiringPi PIN. (22 on header)
const
int
resetPin
=
5
;
// WiringPi PIN. (18 on header)
const
int
resetPin
=
5
;
// WiringPi PIN. (18 on header)
const
int
SPI_SPEED
=
1
0
00000
;
const
int
SPI_SPEED
=
1
8
00000
;
const
int
SPI_CHANNEL
=
0
;
const
int
SPI_CHANNEL
=
0
;
int
fd
=
0
;
int
fd
=
0
;
bool
firstFrame
=
true
;
bool
firstFrame
=
true
;
...
...
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