Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
BLE Demo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
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
tag2y19
BLE Demo
Commits
2494325e
Commit
2494325e
authored
3 months ago
by
tag2y19
Browse files
Options
Downloads
Patches
Plain Diff
Add screen option to syscfg
parent
f838504f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/ble-demo/src/main.c
+22
-0
22 additions, 0 deletions
apps/ble-demo/src/main.c
apps/ble-demo/syscfg.yml
+3
-0
3 additions, 0 deletions
apps/ble-demo/syscfg.yml
with
25 additions
and
0 deletions
apps/ble-demo/src/main.c
+
22
−
0
View file @
2494325e
...
@@ -166,6 +166,7 @@ int main( void ) {
...
@@ -166,6 +166,7 @@ int main( void ) {
static
void
screen_init
(
void
)
{
static
void
screen_init
(
void
)
{
#if MYNEWT_VAL( SCREEN )
hal_i2c_enable
(
0
);
hal_i2c_enable
(
0
);
static
const
uint8_t
init
[]
=
{
static
const
uint8_t
init
[]
=
{
...
@@ -198,21 +199,29 @@ static void screen_init( void ) {
...
@@ -198,21 +199,29 @@ static void screen_init( void ) {
text16
(
"Hi!!! :)"
,
frame
,
0
,
0
);
text16
(
"Hi!!! :)"
,
frame
,
0
,
0
);
i2c_write
(
frame_buffer
,
sizeof
frame_buffer
);
i2c_write
(
frame_buffer
,
sizeof
frame_buffer
);
#endif
}
}
static
void
i2c_write
(
const
uint8_t
*
d
,
size_t
s
)
{
static
void
i2c_write
(
const
uint8_t
*
d
,
size_t
s
)
{
#if MYNEWT_VAL( SCREEN )
while
(
0
!=
hal_i2c_master_write
(
0
,
while
(
0
!=
hal_i2c_master_write
(
0
,
&
(
(
struct
hal_i2c_master_data
)
{
&
(
(
struct
hal_i2c_master_data
)
{
.
address
=
0x78
>>
1
,
.
address
=
0x78
>>
1
,
.
len
=
s
,
.
len
=
s
,
.
buffer
=
(
void
*
)
d
,
.
buffer
=
(
void
*
)
d
,
}
),
2
*
s
,
1
)
);
}
),
2
*
s
,
1
)
);
#else
(
void
)
d
;
(
void
)
s
;
#endif
}
}
static
int
text8
(
const
char
*
text
,
uint8_t
*
frame
,
int
line
,
int
x
)
{
static
int
text8
(
const
char
*
text
,
uint8_t
*
frame
,
int
line
,
int
x
)
{
#if MYNEWT_VAL( SCREEN )
uint8_t
*
write_pos
=
frame
+
(
line
*
128
)
+
x
;
uint8_t
*
write_pos
=
frame
+
(
line
*
128
)
+
x
;
int
i
=
0
;
int
i
=
0
;
...
@@ -243,11 +252,18 @@ static int text8( const char* text, uint8_t* frame, int line, int x ) {
...
@@ -243,11 +252,18 @@ static int text8( const char* text, uint8_t* frame, int line, int x ) {
}
}
return
i
;
return
i
;
#else
(
void
)
frame
;
(
void
)
line
;
(
void
)
x
;
return
strlen
(
text
);
#endif
};
};
static
int
text16
(
const
char
*
text
,
uint8_t
*
frame
,
int
line
,
int
x
)
{
static
int
text16
(
const
char
*
text
,
uint8_t
*
frame
,
int
line
,
int
x
)
{
#if MYNEWT_VAL( SCREEN )
uint8_t
*
write_pos
=
frame
+
(
line
*
128
)
+
x
;
uint8_t
*
write_pos
=
frame
+
(
line
*
128
)
+
x
;
int
i
=
0
;
int
i
=
0
;
...
@@ -279,6 +295,12 @@ static int text16( const char* text, uint8_t* frame, int line, int x ) {
...
@@ -279,6 +295,12 @@ static int text16( const char* text, uint8_t* frame, int line, int x ) {
}
}
return
i
;
return
i
;
#else
(
void
)
frame
;
(
void
)
line
;
(
void
)
x
;
return
strlen
(
text
);
#endif
};
};
...
...
This diff is collapsed.
Click to expand it.
apps/ble-demo/syscfg.yml
+
3
−
0
View file @
2494325e
...
@@ -11,6 +11,9 @@ syscfg.defs:
...
@@ -11,6 +11,9 @@ syscfg.defs:
CPUTIME_FREQ
:
CPUTIME_FREQ
:
description
:
"
Frequency
for
the
cputime
counter"
description
:
"
Frequency
for
the
cputime
counter"
value
:
'
50000'
value
:
'
50000'
SCREEN
:
description
:
"
Is
there
a
screen
there"
value
:
'
0'
syscfg.vals
:
syscfg.vals
:
BLE_ROLE_BROADCASTER
:
1
BLE_ROLE_BROADCASTER
:
1
...
...
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