Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolò Caruso
Skyward Boardcore
Commits
95a31bf7
Commit
95a31bf7
authored
2 years ago
by
Davide Mor
Browse files
Options
Downloads
Patches
Plain Diff
[cc3135] Added dummy read just before initialization
parent
ebddc98c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/shared/radio/CC3135/CC3135.cpp
+13
-0
13 additions, 0 deletions
src/shared/radio/CC3135/CC3135.cpp
src/shared/radio/CC3135/CC3135.h
+3
-0
3 additions, 0 deletions
src/shared/radio/CC3135/CC3135.h
src/tests/drivers/CC3135/test-cc3135.cpp
+5
-7
5 additions, 7 deletions
src/tests/drivers/CC3135/test-cc3135.cpp
with
21 additions
and
7 deletions
src/shared/radio/CC3135/CC3135.cpp
+
13
−
0
View file @
95a31bf7
...
@@ -49,6 +49,9 @@ CC3135::CC3135(std::unique_ptr<ICC3135Iface> &&iface) : iface(std::move(iface))
...
@@ -49,6 +49,9 @@ CC3135::CC3135(std::unique_ptr<ICC3135Iface> &&iface) : iface(std::move(iface))
CC3135
::
Error
CC3135
::
init
(
bool
wait_for_init
)
CC3135
::
Error
CC3135
::
init
(
bool
wait_for_init
)
{
{
if
(
iface
->
is_spi
())
dummyDeviceRead
();
if
(
wait_for_init
)
if
(
wait_for_init
)
{
{
DeviceInitInfo
init_info
=
{};
DeviceInitInfo
init_info
=
{};
...
@@ -88,6 +91,16 @@ CC3135::Error CC3135::devigeGet(uint8_t set_id, uint8_t option, Buffer result)
...
@@ -88,6 +91,16 @@ CC3135::Error CC3135::devigeGet(uint8_t set_id, uint8_t option, Buffer result)
Buffer
::
from
(
&
rx_command
),
result
);
Buffer
::
from
(
&
rx_command
),
result
);
}
}
CC3135
::
Error
CC3135
::
dummyDeviceRead
()
{
ResponseHeader
header
;
TRY
(
readHeader
(
&
header
));
defaultPacketHandler
(
header
);
return
Error
::
NO_ERROR
;
}
CC3135
::
Error
CC3135
::
setMode
(
CC3135Defs
::
Mode
mode
)
CC3135
::
Error
CC3135
::
setMode
(
CC3135Defs
::
Mode
mode
)
{
{
WlanSetMode
tx_command
=
{};
WlanSetMode
tx_command
=
{};
...
...
This diff is collapsed.
Click to expand it.
src/shared/radio/CC3135/CC3135.h
+
3
−
0
View file @
95a31bf7
...
@@ -83,6 +83,9 @@ private:
...
@@ -83,6 +83,9 @@ private:
CC3135
::
Error
devigeGet
(
uint8_t
set_id
,
uint8_t
option
,
Buffer
result
);
CC3135
::
Error
devigeGet
(
uint8_t
set_id
,
uint8_t
option
,
Buffer
result
);
//! Read something from the device, to wake it up?
CC3135
::
Error
dummyDeviceRead
();
// Functions dedicated to interrupt servicing
// Functions dedicated to interrupt servicing
//! Wait for an incoming interrupt (only callable in service thread).
//! Wait for an incoming interrupt (only callable in service thread).
...
...
This diff is collapsed.
Click to expand it.
src/tests/drivers/CC3135/test-cc3135.cpp
+
5
−
7
View file @
95a31bf7
...
@@ -86,7 +86,7 @@ using irq = Gpio<GPIOA_BASE, 4>;
...
@@ -86,7 +86,7 @@ using irq = Gpio<GPIOA_BASE, 4>;
using
hib
=
Gpio
<
GPIOA_BASE
,
6
>
;
using
hib
=
Gpio
<
GPIOA_BASE
,
6
>
;
#define CC3135_SPI SPI1
#define CC3135_SPI SPI1
#define CC3135_HIB
//
#define CC3135_HIB
#endif
#endif
#endif
#endif
...
@@ -190,7 +190,7 @@ int main()
...
@@ -190,7 +190,7 @@ int main()
GpioPin
cs_pin
=
cs
::
getPin
();
GpioPin
cs_pin
=
cs
::
getPin
();
SPIBusConfig
config
=
{};
SPIBusConfig
config
=
{};
config
.
clockDivider
=
SPI
::
ClockDivider
::
DIV_
64
;
config
.
clockDivider
=
SPI
::
ClockDivider
::
DIV_
32
;
config
.
mode
=
SPI
::
Mode
::
MODE_0
;
config
.
mode
=
SPI
::
Mode
::
MODE_0
;
config
.
bitOrder
=
SPI
::
BitOrder
::
MSB_FIRST
;
config
.
bitOrder
=
SPI
::
BitOrder
::
MSB_FIRST
;
...
@@ -201,18 +201,16 @@ int main()
...
@@ -201,18 +201,16 @@ int main()
std
::
unique_ptr
<
ICC3135Iface
>
iface
(
new
CC3135Uart
(
CC3135_UART
));
std
::
unique_ptr
<
ICC3135Iface
>
iface
(
new
CC3135Uart
(
CC3135_UART
));
#endif
#endif
Thread
::
sleep
(
5000
);
printf
(
"[cc3135] Initializing...
\n
"
);
printf
(
"[cc3135] Initializing...
\n
"
);
cc3135
=
new
CC3135
(
std
::
move
(
iface
));
cc3135
=
new
CC3135
(
std
::
move
(
iface
));
cc3135
->
handleIrq
();
//
cc3135->handleIrq();
if
(
cc3135
->
init
(
tru
e
)
!=
CC3135
::
Error
::
NO_ERROR
)
if
(
cc3135
->
init
(
fals
e
)
!=
CC3135
::
Error
::
NO_ERROR
)
{
{
printf
(
"[cc3135] Failed to start cc3135, retrying...
\n
"
);
printf
(
"[cc3135] Failed to start cc3135, retrying...
\n
"
);
Thread
::
sleep
(
2000
);
Thread
::
sleep
(
2000
);
return
;
return
0
;
// miosix::reboot();
// miosix::reboot();
}
}
...
...
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