aboutsummaryrefslogtreecommitdiff
path: root/write-stm-device/example.c
diff options
context:
space:
mode:
Diffstat (limited to 'write-stm-device/example.c')
-rw-r--r--write-stm-device/example.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/write-stm-device/example.c b/write-stm-device/example.c
index dd58b0e..64e802e 100644
--- a/write-stm-device/example.c
+++ b/write-stm-device/example.c
@@ -14,23 +14,23 @@ extern struct stm_dev g_stm_dev;
void main()
{
- unsigned int chan_start = 0;
- unsigned int width = PAGE_SIZE / BYTES_PER_CHANNEL;
unsigned int wrbytes = sizeof(unsigned int) * TEST_DATA_SIZE;
unsigned int real_wrbytes;
unsigned int trace_data[TEST_DATA_SIZE] = {0x5555aaaa, 0xaaaa5555, 0x66666666, 0x99999999};
- if (request_stm_resource(&g_stm_dev, chan_start, width))
+ if (request_stm_resource(&g_stm_dev, 0, 0))
return;
/*
* You can use any channel between [g_stm_dev.policy->channel ...
* (g_stm_dev.policy->channel + g_stm_dev.policy->width)]
*/
- real_wrbytes = stm_char_write(g_stm_dev.fd, (char *)trace_data, wrbytes);
+ real_wrbytes = stm_char_write(g_stm_dev.fd, (char *)trace_data,
+ wrbytes);
if (real_wrbytes != wrbytes)
- printf("write %d bytes and left % bytes data\n", real_wrbytes, wrbytes - real_wrbytes);
-
+ printf("write %d bytes and left % bytes data\n", real_wrbytes,
+ wrbytes - real_wrbytes);
+
printf("Success to write %d bytes\n", real_wrbytes);
release_stm_resource(&g_stm_dev);