Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marc Schink
libjaylink-snippets
Commits
3805635e
Commit
3805635e
authored
Jun 25, 2016
by
Marc Schink
Browse files
Update for libjaylink API changes
parent
bc5373b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
device_info.c
View file @
3805635e
...
...
@@ -31,8 +31,7 @@ int main(int argc, char **argv)
uint8_t
caps
[
JAYLINK_DEV_EXT_CAPS_SIZE
];
struct
jaylink_hardware_version
hwver
;
uint32_t
interfaces
;
uint32_t
freq
;
uint16_t
div
;
struct
jaylink_speed
speed
;
struct
jaylink_swo_speed
swo_speed
;
uint8_t
config
[
JAYLINK_DEV_CONFIG_SIZE
];
bool
use_serial_number
;
...
...
@@ -68,9 +67,18 @@ int main(int argc, char **argv)
return
EXIT_FAILURE
;
}
ret
=
jaylink_
get_device_list
(
ctx
,
&
devs
);
ret
=
jaylink_
discovery_scan
(
ctx
,
0
);
if
(
ret
<
0
)
{
if
(
ret
!=
JAYLINK_OK
)
{
printf
(
"jaylink_discovery_scan() failed: %s.
\n
"
,
jaylink_strerror_name
(
ret
));
jaylink_exit
(
ctx
);
return
EXIT_FAILURE
;
}
ret
=
jaylink_get_devices
(
ctx
,
&
devs
,
NULL
);
if
(
ret
!=
JAYLINK_OK
)
{
printf
(
"jaylink_get_device_list() failed: %s.
\n
"
,
jaylink_strerror_name
(
ret
));
jaylink_exit
(
ctx
);
...
...
@@ -104,7 +112,7 @@ int main(int argc, char **argv)
jaylink_strerror_name
(
ret
));
}
jaylink_free_device
_list
(
devs
,
true
);
jaylink_free_device
s
(
devs
,
true
);
if
(
!
device_found
)
{
printf
(
"No J-Link device found.
\n
"
);
...
...
@@ -207,7 +215,7 @@ int main(int argc, char **argv)
}
if
(
jaylink_has_cap
(
caps
,
JAYLINK_DEV_CAP_GET_SPEEDS
))
{
ret
=
jaylink_get_speeds
(
devh
,
&
freq
,
&
div
);
ret
=
jaylink_get_speeds
(
devh
,
&
speed
);
if
(
ret
!=
JAYLINK_OK
)
{
printf
(
"jaylink_get_speeds() failed: "
...
...
@@ -222,7 +230,8 @@ int main(int argc, char **argv)
if
(
jaylink_has_cap
(
caps
,
JAYLINK_DEV_CAP_ADAPTIVE_CLOCKING
))
printf
(
" - Adaptive clocking
\n
"
);
printf
(
" - %u MHz / div; div >= %u
\n
"
,
freq
/
1000000
,
div
);
printf
(
" - %u MHz / div; div >= %u
\n
"
,
speed
.
freq
/
1000000
,
speed
.
div
);
}
if
(
jaylink_has_cap
(
caps
,
JAYLINK_DEV_CAP_SWO
))
{
...
...
efm32_debug_mode.c
View file @
3805635e
...
...
@@ -102,9 +102,18 @@ int main(int argc, char **argv)
return
EXIT_FAILURE
;
}
ret
=
jaylink_
get_device_list
(
ctx
,
&
devs
);
ret
=
jaylink_
discovery_scan
(
ctx
,
0
);
if
(
ret
<
0
)
{
if
(
ret
!=
JAYLINK_OK
)
{
printf
(
"jaylink_discovery_scan() failed: %s.
\n
"
,
jaylink_strerror_name
(
ret
));
jaylink_exit
(
ctx
);
return
EXIT_FAILURE
;
}
ret
=
jaylink_get_devices
(
ctx
,
&
devs
,
NULL
);
if
(
ret
!=
JAYLINK_OK
)
{
printf
(
"jaylink_get_device_list() failed: %s.
\n
"
,
jaylink_strerror_name
(
ret
));
jaylink_exit
(
ctx
);
...
...
@@ -138,7 +147,7 @@ int main(int argc, char **argv)
jaylink_strerror_name
(
ret
));
}
jaylink_free_device
_list
(
devs
,
true
);
jaylink_free_device
s
(
devs
,
true
);
if
(
!
device_found
)
{
printf
(
"No J-Link device found.
\n
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment