Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
ln
firmware
Commits
60d1c78d
Verified
Commit
60d1c78d
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
chore(ble): Switch to correct logging utilities
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
f0a9fd42
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/ble.c
+21
-14
21 additions, 14 deletions
epicardium/ble/ble.c
with
21 additions
and
14 deletions
epicardium/ble/ble.c
+
21
−
14
View file @
60d1c78d
#include
"modules/log.h"
#include
"fs_util.h"
#include
"wsf_types.h"
#include
"wsf_buf.h"
#include
"wsf_trace.h"
...
...
@@ -5,7 +9,6 @@
#include
"hci_vs.h"
#include
"att_api.h"
#include
"fs_util.h"
#include
"FreeRTOS.h"
#include
"timers.h"
...
...
@@ -66,18 +69,19 @@ static bool_t myTrace(const uint8_t *pBuf, uint32_t len)
/*************************************************************************************************/
static
void
WsfInit
(
void
)
{
uint32_t
bytesUsed
;
uint32_t
bytesUsed
__attribute__
((
unused
))
;
WsfTimerInit
();
SystemHeapStart
=
(
uint32_t
)
&
SystemHeap
;
memset
(
SystemHeap
,
0
,
sizeof
(
SystemHeap
));
//printf("SystemHeapStart = 0x%x\n", SystemHeapStart);
//printf("SystemHeapSize = 0x%x\n", SystemHeapSize);
bytesUsed
=
WsfBufInit
(
WSF_BUF_POOLS
,
mainPoolDesc
);
printf
(
"bytesUsed = %u
\n
"
,
(
unsigned
int
)
bytesUsed
);
WsfTraceRegisterHandler
(
myTrace
);
WsfTraceEnable
(
TRUE
);
bytesUsed
=
WsfBufInit
(
WSF_BUF_POOLS
,
mainPoolDesc
);
APP_TRACE_INFO1
(
"bytesUsed = %u"
,
(
unsigned
int
)
bytesUsed
);
}
/*************************************************************************************************/
/* TODO: We need a source of MACs */
...
...
@@ -87,7 +91,7 @@ static void setAddress(void)
char
buf
[
32
];
fs_read_text_file
(
"mac.txt"
,
buf
,
sizeof
(
buf
));
printf
(
"mac file: %s
\n
"
,
buf
);
APP_TRACE_INFO1
(
"mac file
contents
: %s"
,
buf
);
int
a
,
b
,
c
,
d
,
e
,
f
;
if
(
sscanf
(
buf
,
"%x:%x:%x:%x:%x:%x"
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
,
&
f
)
==
6
)
{
bdAddr
[
0
]
=
f
;
...
...
@@ -98,13 +102,16 @@ static void setAddress(void)
bdAddr
[
5
]
=
a
;
}
printf
(
"Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X
\n
"
,
bdAddr
[
5
],
bdAddr
[
4
],
bdAddr
[
3
],
bdAddr
[
2
],
bdAddr
[
1
],
bdAddr
[
0
]);
LOG_INFO
(
"ble"
,
"Setting MAC address to %02X:%02X:%02X:%02X:%02X:%02X"
,
bdAddr
[
5
],
bdAddr
[
4
],
bdAddr
[
3
],
bdAddr
[
2
],
bdAddr
[
1
],
bdAddr
[
0
]
);
HciVsSetBdAddr
(
bdAddr
);
}
/*************************************************************************************************/
...
...
@@ -162,10 +169,10 @@ static void scheduleTimer(void)
);
//printf("insert done\n");
}
else
{
printf
(
"c
ould not create timer
\n
"
);
LOG_ERR
(
"ble"
,
"C
ould not create timer"
);
}
}
else
{
printf
(
"No timer running
\n
"
);
APP_TRACE_INFO0
(
"No timer running"
);
}
}
/*************************************************************************************************/
...
...
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