summaryrefslogtreecommitdiff
path: root/contrib/libdcc/example.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-08 05:05:57 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-08 05:05:57 +0000
commiteadd49bef0960e015de084a41571c32e2ffbff41 (patch)
tree1f1298eeed49a67f56d5cf4d161657f5d79bbe38 /contrib/libdcc/example.c
parent9d4f9dbd0b75805efc2d3f18afe02bb164a86f0e (diff)
downloadopenocd_libswd-eadd49bef0960e015de084a41571c32e2ffbff41.tar.gz
openocd_libswd-eadd49bef0960e015de084a41571c32e2ffbff41.tar.bz2
openocd_libswd-eadd49bef0960e015de084a41571c32e2ffbff41.tar.xz
openocd_libswd-eadd49bef0960e015de084a41571c32e2ffbff41.zip
Signed-off-by: Frederik Kriewitz <frederik@kriewitz.eu> libdcc bugfixes + trace point function
git-svn-id: svn://svn.berlios.de/openocd/trunk@1028 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'contrib/libdcc/example.c')
-rw-r--r--contrib/libdcc/example.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/contrib/libdcc/example.c b/contrib/libdcc/example.c
index 42a9bd58..d456f395 100644
--- a/contrib/libdcc/example.c
+++ b/contrib/libdcc/example.c
@@ -1,6 +1,8 @@
/***************************************************************************
* Copyright (C) 2008 by Spencer Oliver *
* spen@spen-soft.co.uk *
+ * Copyright (C) 2008 by Frederik Kriewtz *
+ * frederik@kriewitz.eu *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -20,13 +22,37 @@
#include "dcc_stdio.h"
+/* enable openocd debugmsg at the gdb prompt:
+ * monitor target_request debugmsgs enable
+ *
+ * create a trace point:
+ * monitor trace point 1
+ *
+ * to show how often the trace point was hit:
+ * monitor trace point
+*/
+
int main(void)
{
- /* enable openocd debugmsg at the gdb prompt
- * monitor target_request debugmsgs enable */
-
dbg_write_str("hello world");
- dbg_write_char('a');
-
- while(1) {}
+
+ dbg_write_char('t');
+ dbg_write_char('e');
+ dbg_write_char('s');
+ dbg_write_char('t');
+ dbg_write_char('\n');
+
+ unsigned long test_u32 = 0x01234567;
+ dbg_write_u32(&test_u32, 1);
+
+ static const unsigned short test_u16[] = {0x0123, 0x4567, 0x89AB, 0xCDEF, 0x0123, 0x4567, 0x89AB, 0xCDEF};
+ dbg_write_u16(test_u16, 8);
+
+ static const unsigned char test_u8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0XDD, 0xEE, 0xFF};
+ dbg_write_u8(test_u8, 16);
+
+ while(1)
+ {
+ dbg_trace_point(0);
+ }
}